tkernel_2/lib/libtk/src/sysdepend/tef_em1d/prreg.c | bare source | permlink (0.02 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * T-Kernel 2.0 Software Package 4: * 5: * Copyright 2011 by Ken Sakamura. 6: * This software is distributed under the latest version of T-License 2.x. 7: *---------------------------------------------------------------------- 8: * 9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17. 10: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/01. 11: * 12: *---------------------------------------------------------------------- 13: */ 14: 15: /* 16: * @(#)prreg.c (libtk/EM1-D512) 17: * 18: * Display task register value 19: */ 20: 21: #include <basic.h> 22: #include <tk/tkernel.h> 23: #include <sys/misc.h> 24: 25: /* 26: * Uses prfn to display the contents of gr, er, and cr. 27: * prfn must be a printf compatible function. 28: */ 29: EXPORT W PrintTaskRegister( int (*prfn)( const char *format, ... ), 30: T_REGS *gr, T_EIT *er, T_CREGS *cr ) 31: { 32: /* 33: * PC: 12345678 CPSR:12345678 TMF:12345678 34: * R0: 12345678 R1: 12345678 R2: 12345678 R3: 12345678 35: * R4: 12345678 R5: 12345678 R6: 12345678 R7: 12345678 36: * R8: 12345678 R9: 12345678 R10:12345678 R11:12345678 37: * IP: 12345678 LR: 12345678 38: * USP:12345678 SSP:12345678 LSID:1234 UATB:12345678 39: */ 40: (*prfn)("PC: %08x CPSR:%08x TMF:%08x\n", 41: (UW)er->pc, er->cpsr, er->taskmode); 42: (*prfn)("R0: %08x R1: %08x R2: %08x R3: %08x\n", 43: gr->r[0], gr->r[1], gr->r[2], gr->r[3]); 44: (*prfn)("R4: %08x R5: %08x R6: %08x R7: %08x\n", 45: gr->r[4], gr->r[5], gr->r[6], gr->r[7]); 46: (*prfn)("R8: %08x R9: %08x R10:%08x R11:%08x\n", 47: gr->r[8], gr->r[9], gr->r[10], gr->r[11]); 48: (*prfn)("IP: %08x LR: %08x\n", 49: gr->r[12], (UW)gr->lr); 50: (*prfn)("USP:%08x SSP:%08x LSID:%-4d UATB:%08x\n", 51: (UW)cr->usp, (UW)cr->ssp, cr->lsid, (UW)cr->uatb); 52: return 6; /* Number of display rows */ 53: }