Changeset 741ade3f in mainline
- Timestamp:
- 2006-03-21T22:45:32Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 45fb65c
- Parents:
- 018d957e
- Location:
- arch
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/userspace.c
r018d957e r741ade3f 46 46 ipl = interrupts_disable(); 47 47 48 /* Clear CF,PF,AF,ZF,SF,DF,OF */ 49 ipl &= ~ (0xbc4); 50 48 51 __asm__ volatile ("" 49 52 "pushq %0\n" -
arch/mips32/include/context_offset.h
r018d957e r741ade3f 49 49 #define EOFFSET_STATUS 0x7c 50 50 #define EOFFSET_EPC 0x80 51 #define EOFFSET_K1 0x84 51 52 #define REGISTER_SPACE 136 -
arch/mips32/include/exception.h
r018d957e r741ade3f 91 91 __u32 status; /* cp0_status */ 92 92 __u32 epc; /* cp0_epc */ 93 __u32 padding; /* padding to align stack on 8 bytes boundary*/93 __u32 k1; /* We use it as thread-local pointer */ 94 94 }; 95 95 -
arch/mips32/src/start.S
r018d957e r741ade3f 50 50 # We will change status: Disable ERL,EXL,UM,IE 51 51 # These changes will be automatically reversed in REGISTER_LOAD 52 # SP is NOT saved as part of these registers 52 53 .macro REGISTERS_STORE_AND_EXC_RESET r 53 54 sw $at,EOFFSET_AT(\r) … … 88 89 sw $gp,EOFFSET_GP(\r) 89 90 sw $ra,EOFFSET_RA(\r) 90 sw $ sp,EOFFSET_SP(\r)91 sw $k1,EOFFSET_K1(\r) 91 92 92 93 mfc0 $t0, $status … … 144 145 lw $gp,EOFFSET_GP(\r) 145 146 lw $ra,EOFFSET_RA(\r) 147 lw $k1,EOFFSET_K1(\r) 146 148 147 149 lw $at,EOFFSET_LO(\r) … … 208 210 exception_handler: 209 211 KERNEL_STACK_TO_K0 210 211 mfc0 $k1, $cause212 212 sub $k0, REGISTER_SPACE 213 214 sra $k1, $k1, 0x2 # cp0_exc_cause() part 1 215 andi $k1, $k1, 0x1f # cp0_exc_cause() part 2 216 sub $k1, 8 # 8=SYSCALL 217 218 beqz $k1, syscall_shortcut 219 add $k1, 8 # Revert $k1 back to correct exc number 220 221 REGISTERS_STORE_AND_EXC_RESET $k0 213 sw $sp,EOFFSET_SP($k0) 222 214 move $sp, $k0 215 216 mfc0 $k0, $cause 217 218 sra $k0, $k0, 0x2 # cp0_exc_cause() part 1 219 andi $k0, $k0, 0x1f # cp0_exc_cause() part 2 220 sub $k0, 8 # 8=SYSCALL 221 222 beqz $k0, syscall_shortcut 223 add $k0, 8 # Revert $k1 back to correct exc number 224 225 REGISTERS_STORE_AND_EXC_RESET $sp 223 226 224 227 move $a1, $sp 225 228 jal exc_dispatch # exc_dispatch(excno, register_space) 226 move $a0, $k 1229 move $a0, $k0 227 230 228 231 REGISTERS_LOAD $sp … … 232 235 # it seems that mips reserves some space on stack for varfuncs??? 233 236 #define SS_ARG4 16 234 #define SS_SP 20235 #define SS_STATUS 24236 #define SS_EPC 28237 #define SS_SP EOFFSET_SP 238 #define SS_STATUS EOFFSET_STATUS 239 #define SS_EPC EOFFSET_EPC 237 240 syscall_shortcut: 238 241 # We have a lot of space on the stack, with free use 239 sw $sp, SS_SP($k0)240 move $sp, $k0241 242 242 mfc0 $t1, $epc 243 243 mfc0 $t0, $status … … 277 277 sub $k0, REGISTER_SPACE 278 278 REGISTERS_STORE_AND_EXC_RESET $k0 279 sw $sp,EOFFSET_SP($k0) 279 280 add $sp, $k0, 0 280 281 … … 289 290 cache_error_handler: 290 291 KERNEL_STACK_TO_K0 291 sub $sp, REGISTER_SPACE 292 REGISTERS_STORE_AND_EXC_RESET $sp 292 sub $k0, REGISTER_SPACE 293 REGISTERS_STORE_AND_EXC_RESET $k0 294 sw $sp,EOFFSET_SP($k0) 293 295 add $sp, $k0, 0 294 296
Note:
See TracChangeset
for help on using the changeset viewer.