Changeset 268 for soft/giet_vm
- Timestamp:
- Jan 13, 2014, 3:21:42 PM (11 years ago)
- Location:
- soft/giet_vm/giet_common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_common/mips32_registers.h
r258 r268 53 53 #define CP0_EPC $14 54 54 #define CP0_PROCID $15,1 55 #define CP0_SCHED $22,0 56 #define CP0_SCHED_EXT $22,1 55 #define CP0_SCHED $4,2 57 56 58 57 /* CP2 registers */ -
soft/giet_vm/giet_common/utils.c
r263 r268 103 103 { 104 104 unsigned int ret; 105 asm volatile( "mfc0 %0, $22\n" : "=r"(ret) );105 asm volatile("mfc0 %0, $4, 2\n" : "=r"(ret) ); 106 106 return ret; 107 107 } … … 112 112 { 113 113 unsigned int ret; 114 asm volatile( "mfc2 %0,$0" : "=r"(ret));114 asm volatile("mfc2 %0, $0" : "=r"(ret)); 115 115 return ret; 116 116 } … … 121 121 { 122 122 unsigned int ret; 123 asm volatile("mfc0 %0,$14" : "=r"(ret));123 asm volatile("mfc0 %0, $14" : "=r"(ret)); 124 124 return ret; 125 125 } … … 130 130 { 131 131 unsigned int ret; 132 asm volatile( "mfc0 %0,$8" : "=r"(ret));132 asm volatile("mfc0 %0, $8" : "=r"(ret)); 133 133 return ret; 134 134 } … … 139 139 { 140 140 unsigned int ret; 141 asm volatile("mfc0 %0,$13" : "=r"(ret));141 asm volatile("mfc0 %0, $13" : "=r"(ret)); 142 142 return ret; 143 143 } … … 148 148 { 149 149 unsigned int ret; 150 asm volatile( "mfc0 %0,$12" : "=r"(ret));150 asm volatile("mfc0 %0, $12" : "=r"(ret)); 151 151 return ret; 152 152 } … … 156 156 inline void _set_sr(unsigned int val) 157 157 { 158 asm volatile( "mtc0 %0,$12" ::"r" (val));158 asm volatile("mtc0 %0, $12" ::"r" (val)); 159 159 } 160 160 ////////////////////////////////////////////////////////////////////////////////// … … 164 164 { 165 165 unsigned int ret; 166 asm volatile ("mfc0 %0,$15, 1":"=r" (ret));166 asm volatile ("mfc0 %0, $15, 1":"=r" (ret)); 167 167 return (ret & 0x3FF); 168 168 } … … 174 174 { 175 175 unsigned int ret; 176 asm volatile ("mfc0 %0,$9":"=r" (ret));176 asm volatile ("mfc0 %0, $9":"=r" (ret)); 177 177 return ret; 178 178 } … … 216 216 inline void _set_mmu_ptpr(unsigned int val) 217 217 { 218 asm volatile ("mtc2 %0,$0"::"r" (val));218 asm volatile ("mtc2 %0, $0"::"r" (val)); 219 219 } 220 220 ////////////////////////////////////////////////////////////////////////////// … … 223 223 inline void _set_mmu_mode(unsigned int val) 224 224 { 225 asm volatile ("mtc2 %0,$1"::"r" (val));225 asm volatile ("mtc2 %0, $1"::"r" (val)); 226 226 } 227 227 ////////////////////////////////////////////////////////////////////////////// … … 231 231 inline void _set_sched(unsigned int val) 232 232 { 233 asm volatile ("mtc0 %0, $22"::"r" (val));233 asm volatile ("mtc0 %0, $4, 2"::"r" (val)); 234 234 } 235 235 … … 300 300 { 301 301 register unsigned int delay = ( _get_proctime() ^ _get_procid() << 4) & 0xFF; 302 303 if (delay == 0) delay++; 302 304 303 305 asm volatile ( … … 312 314 "_lock_loop: \n" 313 315 "addi $4, $4, -1 \n" /* $4 <= $4 - 1 */ 314 "beqz $4, _lock_loop \n" /* test end delay */ 316 "bnez $4, _lock_loop \n" /* test end delay */ 317 "nop \n" 315 318 "j _lock_llsc \n" /* retry */ 319 "nop \n" 316 320 "_lock_ok: \n" 317 321 : -
soft/giet_vm/giet_common/utils.h
r258 r268 116 116 extern void _set_mmu_mode(unsigned int value); 117 117 extern void _set_sched(unsigned int value); 118 extern void _set_sr(unsigned int value); 118 119 119 120 ///////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.