|
RTEMS
5.0.0
|
Go to the documentation of this file. 23 #ifndef _RTEMS_SCORE_MIPS_H 24 #define _RTEMS_SCORE_MIPS_H 48 #if (__mips == 3) || (__mips == 32) 50 #define SR_INTERRUPT_ENABLE_BITS 0x01 52 #define SR_INTERRUPT_ENABLE_BITS SR_IE 56 #define SR_INTERRUPT_ENABLE_BITS SR_IEC 59 #error "mips interrupt enable bits: unknown architecture level!" 71 #if defined(__mips_soft_float) 72 #define MIPS_HAS_FPU 0 74 #define MIPS_HAS_FPU 1 79 #define CPU_MODEL_NAME "ISA Level 1 or 2" 80 #elif (__mips == 3) || (__mips == 32) 82 #define CPU_MODEL_NAME "ISA Level 4" 84 #define CPU_MODEL_NAME "ISA Level 3" 87 #error "Unknown MIPS ISA level" 94 #define CPU_NAME "MIPS" 101 #define MIPS_EXCEPTION_BASE 0 103 #define MIPS_EXCEPTION_INT MIPS_EXCEPTION_BASE+0 104 #define MIPS_EXCEPTION_MOD MIPS_EXCEPTION_BASE+1 105 #define MIPS_EXCEPTION_TLBL MIPS_EXCEPTION_BASE+2 106 #define MIPS_EXCEPTION_TLBS MIPS_EXCEPTION_BASE+3 107 #define MIPS_EXCEPTION_ADEL MIPS_EXCEPTION_BASE+4 108 #define MIPS_EXCEPTION_ADES MIPS_EXCEPTION_BASE+5 109 #define MIPS_EXCEPTION_IBE MIPS_EXCEPTION_BASE+6 110 #define MIPS_EXCEPTION_DBE MIPS_EXCEPTION_BASE+7 111 #define MIPS_EXCEPTION_SYSCALL MIPS_EXCEPTION_BASE+8 112 #define MIPS_EXCEPTION_BREAK MIPS_EXCEPTION_BASE+9 113 #define MIPS_EXCEPTION_RI MIPS_EXCEPTION_BASE+10 114 #define MIPS_EXCEPTION_CPU MIPS_EXCEPTION_BASE+11 115 #define MIPS_EXCEPTION_OVERFLOW MIPS_EXCEPTION_BASE+12 116 #define MIPS_EXCEPTION_TRAP MIPS_EXCEPTION_BASE+13 117 #define MIPS_EXCEPTION_VCEI MIPS_EXCEPTION_BASE+14 119 #define MIPS_EXCEPTION_FPE MIPS_EXCEPTION_BASE+15 120 #define MIPS_EXCEPTION_C2E MIPS_EXCEPTION_BASE+16 122 #define MIPS_EXCEPTION_WATCH MIPS_EXCEPTION_BASE+23 124 #define MIPS_EXCEPTION_VCED MIPS_EXCEPTION_BASE+31 126 #define MIPS_INTERRUPT_BASE MIPS_EXCEPTION_BASE+32 132 #define mips_get_sr( _x ) \ 134 __asm__ volatile( "mfc0 %0, $12; nop" : "=r" (_x) : ); \ 137 #define mips_set_sr( _x ) \ 139 unsigned int __x = (_x); \ 140 __asm__ volatile( "mtc0 %0, $12; nop" : : "r" (__x) ); \ 148 #define mips_get_cause( _x ) \ 150 __asm__ volatile( "mfc0 %0, $13; nop" : "=r" (_x) : ); \ 154 #define mips_set_cause( _x ) \ 156 unsigned int __x = (_x); \ 157 __asm__ volatile( "mtc0 %0, $13; nop" : : "r" (__x) ); \ 167 #define mips_get_dcic( _x ) \ 169 __asm__ volatile( "mfc0 %0, $7; nop" : "=r" (_x) : ); \ 173 #define mips_set_dcic( _x ) \ 175 unsigned int __x = (_x); \ 176 __asm__ volatile( "mtc0 %0, $7; nop" : : "r" (__x) ); \ 187 #define mips_get_bpcrm( _x, _y ) \ 189 __asm__ volatile( "mfc0 %0, $3; nop" : "=r" (_x) : ); \ 190 __asm__ volatile( "mfc0 %0, $11; nop" : "=r" (_y) : ); \ 194 #define mips_set_bpcrm( _x, _y ) \ 196 unsigned int __x = (_x); \ 197 unsigned int __y = (_y); \ 198 __asm__ volatile( "mtc0 %0, $11; nop" : : "r" (__y) ); \ 199 __asm__ volatile( "mtc0 %0, $3; nop" : : "r" (__x) ); \ 212 #define mips_get_bdarm( _x, _y ) \ 214 __asm__ volatile( "mfc0 %0, $5; nop" : "=r" (_x) : ); \ 215 __asm__ volatile( "mfc0 %0, $9; nop" : "=r" (_y) : ); \ 219 #define mips_set_bdarm( _x, _y ) \ 221 unsigned int __x = (_x); \ 222 unsigned int __y = (_y); \ 223 __asm__ volatile( "mtc0 %0, $9; nop" : : "r" (__y) ); \ 224 __asm__ volatile( "mtc0 %0, $5; nop" : : "r" (__x) ); \ 237 #if ( MIPS_HAS_FPU == 1 ) 239 #define mips_get_fcr31( _x ) \ 241 __asm__ volatile( "cfc1 %0, $31; nop" : "=r" (_x) : ); \ 245 #define mips_set_fcr31( _x ) \ 247 unsigned int __x = (_x); \ 248 __asm__ volatile( "ctc1 %0, $31; nop" : : "r" (__x) ); \ 253 #define mips_get_fcr31( _x ) 254 #define mips_set_fcr31( _x ) 277 #define mips_enable_in_interrupt_mask( _mask ) \ 280 mips_get_sr( _sr ); \ 282 mips_set_sr( _sr ); \ 285 #define mips_disable_in_interrupt_mask( _mask ) \ 288 mips_get_sr( _sr ); \ 290 mips_set_sr( _sr ); \