tkernel_2/monitor/cmdsvc/src/armv6/cpudep.h | bare source | permlink (0.00 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: * cpudep.h 17: * 18: * CPU-dependent definitions(ARM) 19: */ 20: 21: #include <tk/sysdef.h> 22: 23: #ifndef _in_asm_source_ 24: 25: IMPORT W bootFlag; /* boot flag */ 26: 27: /* 28: * Memory access through physical address 29: * In the case of ARM, actually it is an access by logical address. 30: */ 31: Inline UW rd_w( UW *pa ) 32: { 33: return *pa; 34: } 35: Inline UH rd_h( UH *pa ) 36: { 37: return *pa; 38: } 39: Inline UB rd_b( UB *pa ) 40: { 41: return *pa; 42: } 43: 44: Inline void wr_w( UW *pa, UW data ) 45: { 46: *pa = data; 47: } 48: Inline void wr_h( UH *pa, UH data ) 49: { 50: *pa = data; 51: } 52: Inline void wr_b( UB *pa, UB data ) 53: { 54: *pa = data; 55: } 56: 57: /* 58: * read/write the ARM-specific registered under monitor management 59: * read/set the value of registers at the time of monitor entry. 60: */ 61: IMPORT UW getCP15( W reg, W opcd ); /* CP15 register reg: CRn, opcd: Op2 */ 62: IMPORT UW getCurPCX( void ); /* PC register (unmodified) */ 63: IMPORT void setCurPCX( UW val ); /* PC register (unmodified) */ 64: IMPORT UW getCurCPSR( void ); /* CPSR register */ 65: IMPORT UW getCurSPSR( void ); /* SPSR register */ 66: 67: /* 68: * Validate PC address 69: * Allow only ARM instructions (on 4 bytes boundary). 70: * If addr is valid then return 0, otherwise return -1. 71: */ 72: IMPORT W invalidPC2( UW addr ); 73: 74: /* 75: * obtain step address 76: */ 77: IMPORT W getStepAddr( UW pc, UW cpsr, W mode, UW* npc, UW *rep ); 78: 79: #endif /* _in_asm_source_ */