Changeset a35b458 in mainline for kernel/arch/ia64/src/ivt.S
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/ivt.S
r3061bc1 ra35b458 57 57 mov r19 = cr.ipsr 58 58 mov r20 = cr.isr ;; 59 59 60 60 /* 2. Move IIP to IIPA. */ 61 61 mov cr.iipa = r18 62 62 63 63 /* 3. Sign extend IIM[20:0], shift left by 4 and add to IIP. */ 64 64 shl r17 = r17, 43 ;; /* shift bit 20 to bit 63 */ … … 66 66 add r18 = r18, r17 ;; 67 67 mov cr.iip = r18 68 68 69 69 /* 4. Set IPSR.ri to 0. */ 70 70 dep r19 = 0, r19, PSR_RI_SHIFT, PSR_RI_LEN ;; 71 71 mov cr.ipsr = r19 72 72 73 73 /* 5. Check whether IPSR.tb or IPSR.ss is set. */ 74 74 … … 76 76 * Implement this when Taken Branch and Single Step traps can occur. 77 77 */ 78 78 79 79 /* 6. Restore predicates and return from interruption. */ 80 80 mov pr = r16 ;; … … 104 104 SYMBOL(heavyweight_handler) 105 105 /* 1. copy interrupt registers into bank 0 */ 106 106 107 107 /* 108 108 * Note that r24-r31 from bank 0 can be used only as long as PSR.ic = 0. 109 109 */ 110 110 111 111 /* Set up FPU as in interrupted context. */ 112 112 mov r24 = psr … … 126 126 mov r27 = cr.isr 127 127 mov r28 = cr.ifa 128 128 129 129 /* 2. preserve predicate register into bank 0 */ 130 130 mov r29 = pr ;; 131 131 132 132 /* 3. switch to kernel memory stack */ 133 133 mov r30 = cr.ipsr … … 149 149 */ 150 150 (p3) cmp.eq p3, p4 = VRN_KERNEL, r31 ;; 151 151 152 152 /* 153 153 * Now, p4 is true iff the stack needs to be switched to kernel stack. … … 155 155 mov r30 = r12 156 156 (p4) mov r12 = R_KSTACK ;; 157 157 158 158 add r12 = -STACK_FRAME_SIZE, r12 ;; 159 159 add r31 = STACK_SCRATCH_AREA_SIZE + ISTATE_OFFSET_IN6, r12 … … 166 166 */ 167 167 cmp.eq p6, p5 = EXC_BREAK_INSTRUCTION, R_VECTOR ;; 168 168 169 169 /* 170 170 * From now on, if this is break_instruction handler, p6 is true and p5 … … 181 181 (p6) st8 [r31] = r32, -STACK_ITEM_SIZE ;; /* save in0 */ 182 182 (p5) add r31 = -(7 * STACK_ITEM_SIZE), r31 ;; 183 183 184 184 st8 [r31] = r30, -STACK_ITEM_SIZE ;; /* save old stack pointer */ 185 185 186 186 st8 [r31] = r29, -STACK_ITEM_SIZE ;; /* save predicate registers */ 187 187 … … 197 197 cover 198 198 mov r26 = cr.ifs 199 199 200 200 st8 [r31] = r24, -STACK_ITEM_SIZE ;; /* save ar.rsc */ 201 201 st8 [r31] = r25, -STACK_ITEM_SIZE ;; /* save ar.pfs */ 202 202 st8 [r31] = r26, -STACK_ITEM_SIZE /* save ar.ifs */ 203 203 204 204 and r24 = ~(RSC_PL_MASK), r24 ;; 205 205 and r30 = ~(RSC_MODE_MASK), r24 ;; 206 206 mov ar.rsc = r30 ;; /* update RSE state */ 207 207 208 208 mov r27 = ar.rnat 209 209 mov r28 = ar.bspstore ;; 210 210 211 211 /* 212 212 * Inspect BSPSTORE to figure out whether it is necessary to switch to … … 215 215 (p1) shr.u r30 = r28, VRN_SHIFT ;; 216 216 (p1) cmp.eq p1, p2 = VRN_KERNEL, r30 ;; 217 217 218 218 /* 219 219 * If BSPSTORE needs to be switched, p1 is false and p2 is true. … … 222 222 (p2) mov r30 = R_KSTACK_BSP ;; 223 223 (p2) mov ar.bspstore = r30 ;; 224 224 225 225 mov r29 = ar.bsp 226 226 227 227 st8 [r31] = r27, -STACK_ITEM_SIZE ;; /* save ar.rnat */ 228 228 st8 [r31] = r30, -STACK_ITEM_SIZE ;; /* save new value written to ar.bspstore */ 229 229 st8 [r31] = r28, -STACK_ITEM_SIZE ;; /* save ar.bspstore */ 230 230 st8 [r31] = r29, -STACK_ITEM_SIZE /* save ar.bsp */ 231 231 232 232 mov ar.rsc = r24 /* restore RSE's setting + kernel privileges */ 233 233 234 234 /* steps 6 - 15 are done by heavyweight_handler_inner() */ 235 235 mov R_RET = b0 /* save b0 belonging to interrupted context */ … … 292 292 ld8 r29 = [r31], +STACK_ITEM_SIZE ;; /* load predicate registers */ 293 293 mov pr = r29 294 294 295 295 /* 19. return from interruption */ 296 296 ld8 r12 = [r31] /* load stack pointer */ … … 303 303 */ 304 304 alloc loc0 = ar.pfs, 0, 48, 2, 0 ;; 305 305 306 306 /* bank 0 is going to be shadowed, copy essential data from there */ 307 307 mov loc1 = R_RET /* b0 belonging to interrupted context */ 308 308 mov loc2 = R_HANDLER 309 309 mov out0 = R_VECTOR 310 310 311 311 add out1 = STACK_SCRATCH_AREA_SIZE, r12 312 312 … … 315 315 bsw.1 ;; 316 316 srlz.d 317 317 318 318 /* 7. preserve branch and application registers */ 319 319 mov loc3 = ar.unat … … 323 323 mov loc7 = ar.csd 324 324 mov loc8 = ar.ssd 325 325 326 326 mov loc9 = b0 327 327 mov loc10 = b1 … … 332 332 mov loc15 = b6 333 333 mov loc16 = b7 334 334 335 335 /* 8. preserve general and floating-point registers */ 336 336 mov loc17 = r1 … … 374 374 add r30 = ISTATE_OFFSET_F6 + STACK_SCRATCH_AREA_SIZE, r12 375 375 add r31 = ISTATE_OFFSET_F7 + STACK_SCRATCH_AREA_SIZE, r12 ;; 376 376 377 377 stf.spill [r26] = f2, 8 * FLOAT_ITEM_SIZE 378 378 stf.spill [r27] = f3, 8 * FLOAT_ITEM_SIZE … … 410 410 411 411 mov loc47 = ar.fpsr /* preserve floating point status register */ 412 412 413 413 /* 9. skipped (will not enable interrupts) */ 414 414 /* … … 420 420 /* 10. call handler */ 421 421 movl r1 = __gp 422 422 423 423 mov b1 = loc2 424 424 br.call.sptk.many b0 = b1 … … 426 426 /* 11. return from handler */ 427 427 0: 428 428 429 429 /* 12. skipped (will not disable interrupts) */ 430 430 /* … … 477 477 ldf.fill f30 = [r30] 478 478 ldf.fill f31 = [r31] ;; 479 479 480 480 mov r1 = loc17 481 481 mov r2 = loc18 … … 511 511 512 512 mov ar.fpsr = loc47 /* restore floating point status register */ 513 513 514 514 /* 14. restore branch and application registers */ 515 515 mov ar.unat = loc3 … … 519 519 mov ar.csd = loc7 520 520 mov ar.ssd = loc8 521 521 522 522 mov b0 = loc9 523 523 mov b1 = loc10 … … 528 528 mov b6 = loc15 529 529 mov b7 = loc16 530 530 531 531 /* 15. disable PSR.ic and switch to bank 0 */ 532 532 rsm PSR_IC_MASK … … 578 578 HEAVYWEIGHT_HANDLER 0x5e 579 579 HEAVYWEIGHT_HANDLER 0x5f 580 580 581 581 HEAVYWEIGHT_HANDLER 0x60 582 582 HEAVYWEIGHT_HANDLER 0x61
Note:
See TracChangeset
for help on using the changeset viewer.