Changes in kernel/arch/ia64/src/ivt.S [2277e03:293703e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/ivt.S
r2277e03 r293703e 31 31 #include <arch/register.h> 32 32 #include <arch/mm/page.h> 33 #include <arch/istate_struct.h> 33 34 #include <align.h> 34 35 35 #define FRS_TO_SAVE 30 36 #define STACK_ITEMS (21 + FRS_TO_SAVE * 2) 37 #define STACK_FRAME_SIZE ALIGN_UP((STACK_ITEMS * STACK_ITEM_SIZE) + STACK_SCRATCH_AREA_SIZE, STACK_ALIGNMENT) 38 39 #if (STACK_ITEMS % 2 == 0) 40 # define STACK_FRAME_BIAS 8 41 #else 42 # define STACK_FRAME_BIAS 16 43 #endif 36 #define STACK_FRAME_SIZE ALIGN_UP(ISTATE_SIZE + STACK_SCRATCH_AREA_SIZE, STACK_ALIGNMENT) 37 38 #define FLOAT_ITEM_SIZE (STACK_ITEM_SIZE * 2) 44 39 45 40 /** Partitioning of bank 0 registers. */ … … 120 115 mov r27 = ~PSR_DFH_MASK ;; 121 116 and r26 = r25, r26 122 and r24 = r24, r27 ;;123 or r24 = r24, r26 ;;124 mov psr.l = r24 ;;117 and r24 = r24, r27 ;; 118 or r24 = r24, r26 ;; 119 mov psr.l = r24 ;; 125 120 srlz.i 126 srlz.d ;;121 srlz.d ;; 127 122 128 123 mov r24 = cr.iip … … 161 156 (p4) mov r12 = R_KSTACK ;; 162 157 163 add r 31 = -STACK_FRAME_BIAS, r12 ;;164 add r 12 = -STACK_FRAME_SIZE, r12158 add r12 = -STACK_FRAME_SIZE, r12 ;; 159 add r31 = STACK_SCRATCH_AREA_SIZE + ISTATE_OFFSET_IN6, r12 165 160 166 161 /* 4. save registers in bank 0 into memory stack */ … … 179 174 */ 180 175 181 (p6) st8 [r31] = r38, - 8 ;;/* save in6 */182 (p6) st8 [r31] = r37, - 8 ;;/* save in5 */183 (p6) st8 [r31] = r36, - 8 ;;/* save in4 */184 (p6) st8 [r31] = r35, - 8 ;;/* save in3 */185 (p6) st8 [r31] = r34, - 8 ;;/* save in2 */186 (p6) st8 [r31] = r33, - 8 ;;/* save in1 */187 (p6) st8 [r31] = r32, - 8 ;;/* save in0 */188 (p5) add r31 = - 56, r31 ;;176 (p6) st8 [r31] = r38, -STACK_ITEM_SIZE ;; /* save in6 */ 177 (p6) st8 [r31] = r37, -STACK_ITEM_SIZE ;; /* save in5 */ 178 (p6) st8 [r31] = r36, -STACK_ITEM_SIZE ;; /* save in4 */ 179 (p6) st8 [r31] = r35, -STACK_ITEM_SIZE ;; /* save in3 */ 180 (p6) st8 [r31] = r34, -STACK_ITEM_SIZE ;; /* save in2 */ 181 (p6) st8 [r31] = r33, -STACK_ITEM_SIZE ;; /* save in1 */ 182 (p6) st8 [r31] = r32, -STACK_ITEM_SIZE ;; /* save in0 */ 183 (p5) add r31 = -(7 * STACK_ITEM_SIZE), r31 ;; 189 184 190 st8 [r31] = r30, - 8 ;;/* save old stack pointer */191 192 st8 [r31] = r29, - 8 ;;/* save predicate registers */193 194 st8 [r31] = r24, - 8 ;;/* save cr.iip */195 st8 [r31] = r25, - 8 ;;/* save cr.ipsr */196 st8 [r31] = r26, - 8 ;;/* save cr.iipa */197 st8 [r31] = r27, - 8 ;;/* save cr.isr */198 st8 [r31] = r28, - 8 ;;/* save cr.ifa */185 st8 [r31] = r30, -STACK_ITEM_SIZE ;; /* save old stack pointer */ 186 187 st8 [r31] = r29, -STACK_ITEM_SIZE ;; /* save predicate registers */ 188 189 st8 [r31] = r24, -STACK_ITEM_SIZE ;; /* save cr.iip */ 190 st8 [r31] = r25, -STACK_ITEM_SIZE ;; /* save cr.ipsr */ 191 st8 [r31] = r26, -STACK_ITEM_SIZE ;; /* save cr.iipa */ 192 st8 [r31] = r27, -STACK_ITEM_SIZE ;; /* save cr.isr */ 193 st8 [r31] = r28, -STACK_ITEM_SIZE ;; /* save cr.ifa */ 199 194 200 195 /* 5. RSE switch from interrupted context */ … … 204 199 mov r26 = cr.ifs 205 200 206 st8 [r31] = r24, - 8 ;;/* save ar.rsc */207 st8 [r31] = r25, - 8 ;;/* save ar.pfs */208 st8 [r31] = r26, - 8/* save ar.ifs */201 st8 [r31] = r24, -STACK_ITEM_SIZE ;; /* save ar.rsc */ 202 st8 [r31] = r25, -STACK_ITEM_SIZE ;; /* save ar.pfs */ 203 st8 [r31] = r26, -STACK_ITEM_SIZE /* save ar.ifs */ 209 204 210 205 and r24 = ~(RSC_PL_MASK), r24 ;; … … 231 226 mov r29 = ar.bsp 232 227 233 st8 [r31] = r27, - 8 ;;/* save ar.rnat */234 st8 [r31] = r30, - 8 ;;/* save new value written to ar.bspstore */235 st8 [r31] = r28, - 8 ;;/* save ar.bspstore */236 st8 [r31] = r29, - 8/* save ar.bsp */228 st8 [r31] = r27, -STACK_ITEM_SIZE ;; /* save ar.rnat */ 229 st8 [r31] = r30, -STACK_ITEM_SIZE ;; /* save new value written to ar.bspstore */ 230 st8 [r31] = r28, -STACK_ITEM_SIZE ;; /* save ar.bspstore */ 231 st8 [r31] = r29, -STACK_ITEM_SIZE /* save ar.bsp */ 237 232 238 233 mov ar.rsc = r24 /* restore RSE's setting + kernel privileges */ … … 246 241 cover /* allocate zero size frame (step 1 (from Intel Docs)) */ 247 242 248 add r31 = (STACK_SCRATCH_AREA_SIZE + (FRS_TO_SAVE * 2 * 8)), r12 ;;249 250 ld8 r30 = [r31], + 8 ;;/* load ar.bsp */251 ld8 r29 = [r31], + 8 ;;/* load ar.bspstore */252 ld8 r28 = [r31], + 8 ;;/* load ar.bspstore_new */243 add r31 = STACK_SCRATCH_AREA_SIZE + ISTATE_OFFSET_AR_BSP, r12 ;; 244 245 ld8 r30 = [r31], +STACK_ITEM_SIZE ;; /* load ar.bsp */ 246 ld8 r29 = [r31], +STACK_ITEM_SIZE ;; /* load ar.bspstore */ 247 ld8 r28 = [r31], +STACK_ITEM_SIZE ;; /* load ar.bspstore_new */ 253 248 sub r27 = r30 , r28 ;; /* calculate loadrs (step 2) */ 254 249 shl r27 = r27, 16 … … 261 256 loadrs /* (step 3) */ 262 257 263 ld8 r27 = [r31], + 8 ;;/* load ar.rnat */264 ld8 r26 = [r31], + 8 ;;/* load cr.ifs */265 ld8 r25 = [r31], + 8 ;;/* load ar.pfs */266 ld8 r24 = [r31], + 8 ;;/* load ar.rsc */258 ld8 r27 = [r31], +STACK_ITEM_SIZE ;; /* load ar.rnat */ 259 ld8 r26 = [r31], +STACK_ITEM_SIZE ;; /* load cr.ifs */ 260 ld8 r25 = [r31], +STACK_ITEM_SIZE ;; /* load ar.pfs */ 261 ld8 r24 = [r31], +STACK_ITEM_SIZE ;; /* load ar.rsc */ 267 262 268 263 mov ar.bspstore = r29 ;; /* (step 4) */ … … 275 270 276 271 /* 17. restore interruption state from memory stack */ 277 ld8 r28 = [r31], + 8 ;;/* load cr.ifa */278 ld8 r27 = [r31], + 8 ;;/* load cr.isr */279 ld8 r26 = [r31], + 8 ;;/* load cr.iipa */280 ld8 r25 = [r31], + 8 ;;/* load cr.ipsr */281 ld8 r24 = [r31], + 8 ;;/* load cr.iip */272 ld8 r28 = [r31], +STACK_ITEM_SIZE ;; /* load cr.ifa */ 273 ld8 r27 = [r31], +STACK_ITEM_SIZE ;; /* load cr.isr */ 274 ld8 r26 = [r31], +STACK_ITEM_SIZE ;; /* load cr.iipa */ 275 ld8 r25 = [r31], +STACK_ITEM_SIZE ;; /* load cr.ipsr */ 276 ld8 r24 = [r31], +STACK_ITEM_SIZE ;; /* load cr.iip */ 282 277 283 278 mov cr.iip = r24;; … … 292 287 and r25 = r25, r27 293 288 and r24 = r24, r26 ;; 294 or r25 = r25, r24 ;;289 or r25 = r25, r24 ;; 295 290 mov cr.ipsr = r25 296 291 297 292 /* 18. restore predicate registers from memory stack */ 298 ld8 r29 = [r31], + 8 ;;/* load predicate registers */293 ld8 r29 = [r31], +STACK_ITEM_SIZE ;; /* load predicate registers */ 299 294 mov pr = r29 300 295 301 296 /* 19. return from interruption */ 302 ld8 r12 = [r31] /* load stack pointer */297 ld8 r12 = [r31] /* load stack pointer */ 303 298 rfi ;; 304 299 … … 373 368 mov loc46 = r31 374 369 375 add r24 = 96+ STACK_SCRATCH_AREA_SIZE, r12376 add r25 = 112+ STACK_SCRATCH_AREA_SIZE, r12377 add r26 = 0+ STACK_SCRATCH_AREA_SIZE, r12378 add r27 = 16+ STACK_SCRATCH_AREA_SIZE, r12379 add r28 = 32+ STACK_SCRATCH_AREA_SIZE, r12380 add r29 = 48+ STACK_SCRATCH_AREA_SIZE, r12381 add r30 = 64+ STACK_SCRATCH_AREA_SIZE, r12382 add r31 = 80+ STACK_SCRATCH_AREA_SIZE, r12 ;;383 384 stf.spill [r26] = f2, 0x80385 stf.spill [r27] = f3, 0x80386 stf.spill [r28] = f4, 0x80387 stf.spill [r29] = f5, 0x80388 stf.spill [r30] = f6, 0x80389 stf.spill [r31] = f7, 0x80;;390 391 stf.spill [r24] = f8, 0x80392 stf.spill [r25] = f9, 0x80393 stf.spill [r26] = f10, 0x80394 stf.spill [r27] = f11, 0x80395 stf.spill [r28] = f12, 0x80396 stf.spill [r29] = f13, 0x80397 stf.spill [r30] = f14, 0x80398 stf.spill [r31] = f15, 0x80;;399 400 stf.spill [r24] = f16, 0x80401 stf.spill [r25] = f17, 0x80402 stf.spill [r26] = f18, 0x80403 stf.spill [r27] = f19, 0x80404 stf.spill [r28] = f20, 0x80405 stf.spill [r29] = f21, 0x80406 stf.spill [r30] = f22, 0x80407 stf.spill [r31] = f23, 0x80;;408 409 stf.spill [r24] = f24 , 0x80410 stf.spill [r25] = f25 , 0x80411 stf.spill [r26] = f26 , 0x80412 stf.spill [r27] = f27 , 0x80413 stf.spill [r28] = f28 , 0x80414 stf.spill [r29] = f29 , 0x80415 stf.spill [r30] = f30 , 0x80416 stf.spill [r31] = f31 , 0x80;;370 add r24 = ISTATE_OFFSET_F8 + STACK_SCRATCH_AREA_SIZE, r12 371 add r25 = ISTATE_OFFSET_F9 + STACK_SCRATCH_AREA_SIZE, r12 372 add r26 = ISTATE_OFFSET_F2 + STACK_SCRATCH_AREA_SIZE, r12 373 add r27 = ISTATE_OFFSET_F3 + STACK_SCRATCH_AREA_SIZE, r12 374 add r28 = ISTATE_OFFSET_F4 + STACK_SCRATCH_AREA_SIZE, r12 375 add r29 = ISTATE_OFFSET_F5 + STACK_SCRATCH_AREA_SIZE, r12 376 add r30 = ISTATE_OFFSET_F6 + STACK_SCRATCH_AREA_SIZE, r12 377 add r31 = ISTATE_OFFSET_F7 + STACK_SCRATCH_AREA_SIZE, r12 ;; 378 379 stf.spill [r26] = f2, 8 * FLOAT_ITEM_SIZE 380 stf.spill [r27] = f3, 8 * FLOAT_ITEM_SIZE 381 stf.spill [r28] = f4, 8 * FLOAT_ITEM_SIZE 382 stf.spill [r29] = f5, 8 * FLOAT_ITEM_SIZE 383 stf.spill [r30] = f6, 8 * FLOAT_ITEM_SIZE 384 stf.spill [r31] = f7, 8 * FLOAT_ITEM_SIZE ;; 385 386 stf.spill [r24] = f8, 8 * FLOAT_ITEM_SIZE 387 stf.spill [r25] = f9, 8 * FLOAT_ITEM_SIZE 388 stf.spill [r26] = f10, 8 * FLOAT_ITEM_SIZE 389 stf.spill [r27] = f11, 8 * FLOAT_ITEM_SIZE 390 stf.spill [r28] = f12, 8 * FLOAT_ITEM_SIZE 391 stf.spill [r29] = f13, 8 * FLOAT_ITEM_SIZE 392 stf.spill [r30] = f14, 8 * FLOAT_ITEM_SIZE 393 stf.spill [r31] = f15, 8 * FLOAT_ITEM_SIZE ;; 394 395 stf.spill [r24] = f16, 8 * FLOAT_ITEM_SIZE 396 stf.spill [r25] = f17, 8 * FLOAT_ITEM_SIZE 397 stf.spill [r26] = f18, 8 * FLOAT_ITEM_SIZE 398 stf.spill [r27] = f19, 8 * FLOAT_ITEM_SIZE 399 stf.spill [r28] = f20, 8 * FLOAT_ITEM_SIZE 400 stf.spill [r29] = f21, 8 * FLOAT_ITEM_SIZE 401 stf.spill [r30] = f22, 8 * FLOAT_ITEM_SIZE 402 stf.spill [r31] = f23, 8 * FLOAT_ITEM_SIZE ;; 403 404 stf.spill [r24] = f24 405 stf.spill [r25] = f25 406 stf.spill [r26] = f26 407 stf.spill [r27] = f27 408 stf.spill [r28] = f28 409 stf.spill [r29] = f29 410 stf.spill [r30] = f30 411 stf.spill [r31] = f31 ;; 417 412 418 413 mov loc47 = ar.fpsr /* preserve floating point status register */ … … 442 437 443 438 /* 13. restore general and floating-point registers */ 444 add r24 = 96+ STACK_SCRATCH_AREA_SIZE, r12445 add r25 = 112+ STACK_SCRATCH_AREA_SIZE, r12446 add r26 = 0+ STACK_SCRATCH_AREA_SIZE, r12447 add r27 = 16+ STACK_SCRATCH_AREA_SIZE, r12448 add r28 = 32+ STACK_SCRATCH_AREA_SIZE, r12449 add r29 = 48+ STACK_SCRATCH_AREA_SIZE, r12450 add r30 = 64+ STACK_SCRATCH_AREA_SIZE, r12451 add r31 = 80+ STACK_SCRATCH_AREA_SIZE, r12 ;;452 453 ldf.fill f2 = [r26], 0x80454 ldf.fill f3 = [r27], 0x80455 ldf.fill f4 = [r28], 0x80456 ldf.fill f5 = [r29], 0x80457 ldf.fill f6 = [r30], 0x80458 ldf.fill f7 = [r31], 0x80;;459 460 ldf.fill f8 = [r24], 0x80461 ldf.fill f9 = [r25], 0x80462 ldf.fill f10 = [r26], 0x80463 ldf.fill f11 = [r27], 0x80464 ldf.fill f12 = [r28], 0x80465 ldf.fill f13 = [r29], 0x80466 ldf.fill f14 = [r30], 0x80467 ldf.fill f15 = [r31], 0x80;;468 469 ldf.fill f16 = [r24], 0x80470 ldf.fill f17 = [r25], 0x80471 ldf.fill f18 = [r26], 0x80472 ldf.fill f19 = [r27], 0x80473 ldf.fill f20 = [r28], 0x80474 ldf.fill f21 = [r29], 0x80475 ldf.fill f22 = [r30], 0x80476 ldf.fill f23 = [r31], 0x80;;477 478 ldf.fill f24 = [r24] , 0x80479 ldf.fill f25 = [r25] , 0x80480 ldf.fill f26 = [r26] , 0x80481 ldf.fill f27 = [r27] , 0x80482 ldf.fill f28 = [r28] , 0x80483 ldf.fill f29 = [r29] , 0x80484 ldf.fill f30 = [r30] , 0x80485 ldf.fill f31 = [r31] , 0x80;;439 add r24 = ISTATE_OFFSET_F8 + STACK_SCRATCH_AREA_SIZE, r12 440 add r25 = ISTATE_OFFSET_F9 + STACK_SCRATCH_AREA_SIZE, r12 441 add r26 = ISTATE_OFFSET_F2 + STACK_SCRATCH_AREA_SIZE, r12 442 add r27 = ISTATE_OFFSET_F3 + STACK_SCRATCH_AREA_SIZE, r12 443 add r28 = ISTATE_OFFSET_F4 + STACK_SCRATCH_AREA_SIZE, r12 444 add r29 = ISTATE_OFFSET_F5 + STACK_SCRATCH_AREA_SIZE, r12 445 add r30 = ISTATE_OFFSET_F6 + STACK_SCRATCH_AREA_SIZE, r12 446 add r31 = ISTATE_OFFSET_F7 + STACK_SCRATCH_AREA_SIZE, r12 ;; 447 448 ldf.fill f2 = [r26], 8 * FLOAT_ITEM_SIZE 449 ldf.fill f3 = [r27], 8 * FLOAT_ITEM_SIZE 450 ldf.fill f4 = [r28], 8 * FLOAT_ITEM_SIZE 451 ldf.fill f5 = [r29], 8 * FLOAT_ITEM_SIZE 452 ldf.fill f6 = [r30], 8 * FLOAT_ITEM_SIZE 453 ldf.fill f7 = [r31], 8 * FLOAT_ITEM_SIZE ;; 454 455 ldf.fill f8 = [r24], 8 * FLOAT_ITEM_SIZE 456 ldf.fill f9 = [r25], 8 * FLOAT_ITEM_SIZE 457 ldf.fill f10 = [r26],8 * FLOAT_ITEM_SIZE 458 ldf.fill f11 = [r27], 8 * FLOAT_ITEM_SIZE 459 ldf.fill f12 = [r28], 8 * FLOAT_ITEM_SIZE 460 ldf.fill f13 = [r29], 8 * FLOAT_ITEM_SIZE 461 ldf.fill f14 = [r30], 8 * FLOAT_ITEM_SIZE 462 ldf.fill f15 = [r31], 8 * FLOAT_ITEM_SIZE ;; 463 464 ldf.fill f16 = [r24], 8 * FLOAT_ITEM_SIZE 465 ldf.fill f17 = [r25], 8 * FLOAT_ITEM_SIZE 466 ldf.fill f18 = [r26], 8 * FLOAT_ITEM_SIZE 467 ldf.fill f19 = [r27], 8 * FLOAT_ITEM_SIZE 468 ldf.fill f20 = [r28], 8 * FLOAT_ITEM_SIZE 469 ldf.fill f21 = [r29], 8 * FLOAT_ITEM_SIZE 470 ldf.fill f22 = [r30], 8 * FLOAT_ITEM_SIZE 471 ldf.fill f23 = [r31], 8 * FLOAT_ITEM_SIZE ;; 472 473 ldf.fill f24 = [r24] 474 ldf.fill f25 = [r25] 475 ldf.fill f26 = [r26] 476 ldf.fill f27 = [r27] 477 ldf.fill f28 = [r28] 478 ldf.fill f29 = [r29] 479 ldf.fill f30 = [r30] 480 ldf.fill f31 = [r31] ;; 486 481 487 482 mov r1 = loc17
Note:
See TracChangeset
for help on using the changeset viewer.