/*
    PrintReg.c, Copyright (c) by Silvio Dragone & David Reist,
    Swiss Federal Institute of Technology,
    Computer Engineering and Networks Laboratory.
 
    TOPSY -- A Teachable Operating System.
             Implementation of a tiny and simple
             micro kernel for teaching purposes.
 
    For further information, please visit http://www.tik.ee.ethz.ch/~topsy
 
    This software is provided under the terms of the GNU General Public Licence.
 
    A full copy of the GNU GPL is provided in the file COPYING found in the
    development root of Topsy.
*/

#include "TMScheduler.h"
#include "TMHal.h"
#include "Support.h"

extern Scheduler scheduler;


void printRegisters()
{
  printf("A0: %lx\n", scheduler.running->contextPtr->argument[0]);
  printf("A1: %lx\n", scheduler.running->contextPtr->argument[1]);
  printf("A2: %lx\n", scheduler.running->contextPtr->argument[2]);
  printf("A3: %lx\n", scheduler.running->contextPtr->argument[3]);
  printf("V0: %lx\n", scheduler.running->contextPtr->saveGPR[0]);
  printf("V1: %lx\n", scheduler.running->contextPtr->saveGPR[1]);
  printf("V2: %lx\n", scheduler.running->contextPtr->saveGPR[2]);
  printf("V3: %lx\n", scheduler.running->contextPtr->saveGPR[3]);
  printf("V4: %lx\n", scheduler.running->contextPtr->saveGPR[4]);
  printf("V5: %lx\n", scheduler.running->contextPtr->saveGPR[5]);
  printf("SL: %lx\n", scheduler.running->contextPtr->stackLimit);
  printf("FP: %lx\n", scheduler.running->contextPtr->framePointer);
  printf("IP: %lx\n", scheduler.running->contextPtr->scratchRegister);
  printf("SP: %lx\n", scheduler.running->contextPtr->stackPointer);
  printf("LR: %lx\n", scheduler.running->contextPtr->linkRegister);
  printf("PC: %lx\n", scheduler.running->contextPtr->programCounter);
  printf("SR: %lx\n", scheduler.running->contextPtr->statusRegister);
}
