Changes in kernel/arch/ia64/src/ivt.S [293703e:2277e03] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/ivt.S
r293703e r2277e03 31 31 #include <arch/register.h> 32 32 #include <arch/mm/page.h> 33 #include <arch/istate_struct.h>34 33 #include <align.h> 35 34 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) 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 39 44 40 45 /** Partitioning of bank 0 registers. */ … … 115 120 mov r27 = ~PSR_DFH_MASK ;; 116 121 and r26 = r25, r26 117 and r24 = r24, r27 118 or r24 = r24, r26 119 mov psr.l = r24 122 and r24 = r24, r27;; 123 or r24 = r24, r26;; 124 mov psr.l = r24;; 120 125 srlz.i 121 srlz.d 126 srlz.d;; 122 127 123 128 mov r24 = cr.iip … … 156 161 (p4) mov r12 = R_KSTACK ;; 157 162 158 add r 12 = -STACK_FRAME_SIZE, r12 ;;159 add r 31 = STACK_SCRATCH_AREA_SIZE + ISTATE_OFFSET_IN6, r12163 add r31 = -STACK_FRAME_BIAS, r12 ;; 164 add r12 = -STACK_FRAME_SIZE, r12 160 165 161 166 /* 4. save registers in bank 0 into memory stack */ … … 174 179 */ 175 180 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 ;;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 ;; 184 189 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 */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 */ 194 199 195 200 /* 5. RSE switch from interrupted context */ … … 199 204 mov r26 = cr.ifs 200 205 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 */206 st8 [r31] = r24, -8 ;; /* save ar.rsc */ 207 st8 [r31] = r25, -8 ;; /* save ar.pfs */ 208 st8 [r31] = r26, -8 /* save ar.ifs */ 204 209 205 210 and r24 = ~(RSC_PL_MASK), r24 ;; … … 226 231 mov r29 = ar.bsp 227 232 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 */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 */ 232 237 233 238 mov ar.rsc = r24 /* restore RSE's setting + kernel privileges */ … … 241 246 cover /* allocate zero size frame (step 1 (from Intel Docs)) */ 242 247 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 */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 */ 248 253 sub r27 = r30 , r28 ;; /* calculate loadrs (step 2) */ 249 254 shl r27 = r27, 16 … … 256 261 loadrs /* (step 3) */ 257 262 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 */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 */ 262 267 263 268 mov ar.bspstore = r29 ;; /* (step 4) */ … … 270 275 271 276 /* 17. restore interruption state from memory stack */ 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 */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 */ 277 282 278 283 mov cr.iip = r24;; … … 287 292 and r25 = r25, r27 288 293 and r24 = r24, r26 ;; 289 or r25 = r25, r24 294 or r25 = r25, r24;; 290 295 mov cr.ipsr = r25 291 296 292 297 /* 18. restore predicate registers from memory stack */ 293 ld8 r29 = [r31], + STACK_ITEM_SIZE ;;/* load predicate registers */298 ld8 r29 = [r31], +8 ;; /* load predicate registers */ 294 299 mov pr = r29 295 300 296 301 /* 19. return from interruption */ 297 ld8 r12 = [r31] 302 ld8 r12 = [r31] /* load stack pointer */ 298 303 rfi ;; 299 304 … … 368 373 mov loc46 = r31 369 374 370 add r24 = ISTATE_OFFSET_F8+ STACK_SCRATCH_AREA_SIZE, r12371 add r25 = ISTATE_OFFSET_F9+ STACK_SCRATCH_AREA_SIZE, r12372 add r26 = ISTATE_OFFSET_F2+ STACK_SCRATCH_AREA_SIZE, r12373 add r27 = ISTATE_OFFSET_F3+ STACK_SCRATCH_AREA_SIZE, r12374 add r28 = ISTATE_OFFSET_F4+ STACK_SCRATCH_AREA_SIZE, r12375 add r29 = ISTATE_OFFSET_F5+ STACK_SCRATCH_AREA_SIZE, r12376 add r30 = ISTATE_OFFSET_F6+ STACK_SCRATCH_AREA_SIZE, r12377 add r31 = ISTATE_OFFSET_F7+ STACK_SCRATCH_AREA_SIZE, r12 ;;378 379 stf.spill [r26] = f2, 8 * FLOAT_ITEM_SIZE380 stf.spill [r27] = f3, 8 * FLOAT_ITEM_SIZE381 stf.spill [r28] = f4, 8 * FLOAT_ITEM_SIZE382 stf.spill [r29] = f5, 8 * FLOAT_ITEM_SIZE383 stf.spill [r30] = f6, 8 * FLOAT_ITEM_SIZE384 stf.spill [r31] = f7, 8 * FLOAT_ITEM_SIZE;;385 386 stf.spill [r24] = f8, 8 * FLOAT_ITEM_SIZE387 stf.spill [r25] = f9, 8 * FLOAT_ITEM_SIZE388 stf.spill [r26] = f10, 8 * FLOAT_ITEM_SIZE389 stf.spill [r27] = f11, 8 * FLOAT_ITEM_SIZE390 stf.spill [r28] = f12, 8 * FLOAT_ITEM_SIZE391 stf.spill [r29] = f13, 8 * FLOAT_ITEM_SIZE392 stf.spill [r30] = f14, 8 * FLOAT_ITEM_SIZE393 stf.spill [r31] = f15, 8 * FLOAT_ITEM_SIZE;;394 395 stf.spill [r24] = f16, 8 * FLOAT_ITEM_SIZE396 stf.spill [r25] = f17, 8 * FLOAT_ITEM_SIZE397 stf.spill [r26] = f18, 8 * FLOAT_ITEM_SIZE398 stf.spill [r27] = f19, 8 * FLOAT_ITEM_SIZE399 stf.spill [r28] = f20, 8 * FLOAT_ITEM_SIZE400 stf.spill [r29] = f21, 8 * FLOAT_ITEM_SIZE401 stf.spill [r30] = f22, 8 * FLOAT_ITEM_SIZE402 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 ;;375 add r24 = 96 + STACK_SCRATCH_AREA_SIZE, r12 376 add r25 = 112 + STACK_SCRATCH_AREA_SIZE, r12 377 add r26 = 0 + STACK_SCRATCH_AREA_SIZE, r12 378 add r27 = 16 + STACK_SCRATCH_AREA_SIZE, r12 379 add r28 = 32 + STACK_SCRATCH_AREA_SIZE, r12 380 add r29 = 48 + STACK_SCRATCH_AREA_SIZE, r12 381 add r30 = 64 + STACK_SCRATCH_AREA_SIZE, r12 382 add r31 = 80 + STACK_SCRATCH_AREA_SIZE, r12 ;; 383 384 stf.spill [r26] = f2, 0x80 385 stf.spill [r27] = f3, 0x80 386 stf.spill [r28] = f4, 0x80 387 stf.spill [r29] = f5, 0x80 388 stf.spill [r30] = f6, 0x80 389 stf.spill [r31] = f7, 0x80 ;; 390 391 stf.spill [r24] = f8, 0x80 392 stf.spill [r25] = f9, 0x80 393 stf.spill [r26] = f10, 0x80 394 stf.spill [r27] = f11, 0x80 395 stf.spill [r28] = f12, 0x80 396 stf.spill [r29] = f13, 0x80 397 stf.spill [r30] = f14, 0x80 398 stf.spill [r31] = f15, 0x80 ;; 399 400 stf.spill [r24] = f16, 0x80 401 stf.spill [r25] = f17, 0x80 402 stf.spill [r26] = f18, 0x80 403 stf.spill [r27] = f19, 0x80 404 stf.spill [r28] = f20, 0x80 405 stf.spill [r29] = f21, 0x80 406 stf.spill [r30] = f22, 0x80 407 stf.spill [r31] = f23, 0x80 ;; 408 409 stf.spill [r24] = f24, 0x80 410 stf.spill [r25] = f25, 0x80 411 stf.spill [r26] = f26, 0x80 412 stf.spill [r27] = f27, 0x80 413 stf.spill [r28] = f28, 0x80 414 stf.spill [r29] = f29, 0x80 415 stf.spill [r30] = f30, 0x80 416 stf.spill [r31] = f31, 0x80 ;; 412 417 413 418 mov loc47 = ar.fpsr /* preserve floating point status register */ … … 437 442 438 443 /* 13. restore general and floating-point registers */ 439 add r24 = ISTATE_OFFSET_F8+ STACK_SCRATCH_AREA_SIZE, r12440 add r25 = ISTATE_OFFSET_F9+ STACK_SCRATCH_AREA_SIZE, r12441 add r26 = ISTATE_OFFSET_F2+ STACK_SCRATCH_AREA_SIZE, r12442 add r27 = ISTATE_OFFSET_F3+ STACK_SCRATCH_AREA_SIZE, r12443 add r28 = ISTATE_OFFSET_F4+ STACK_SCRATCH_AREA_SIZE, r12444 add r29 = ISTATE_OFFSET_F5+ STACK_SCRATCH_AREA_SIZE, r12445 add r30 = ISTATE_OFFSET_F6+ STACK_SCRATCH_AREA_SIZE, r12446 add r31 = ISTATE_OFFSET_F7+ STACK_SCRATCH_AREA_SIZE, r12 ;;447 448 ldf.fill f2 = [r26], 8 * FLOAT_ITEM_SIZE449 ldf.fill f3 = [r27], 8 * FLOAT_ITEM_SIZE450 ldf.fill f4 = [r28], 8 * FLOAT_ITEM_SIZE451 ldf.fill f5 = [r29], 8 * FLOAT_ITEM_SIZE452 ldf.fill f6 = [r30], 8 * FLOAT_ITEM_SIZE453 ldf.fill f7 = [r31], 8 * FLOAT_ITEM_SIZE;;454 455 ldf.fill f8 = [r24], 8 * FLOAT_ITEM_SIZE456 ldf.fill f9 = [r25], 8 * FLOAT_ITEM_SIZE457 ldf.fill f10 = [r26], 8 * FLOAT_ITEM_SIZE458 ldf.fill f11 = [r27], 8 * FLOAT_ITEM_SIZE459 ldf.fill f12 = [r28], 8 * FLOAT_ITEM_SIZE460 ldf.fill f13 = [r29], 8 * FLOAT_ITEM_SIZE461 ldf.fill f14 = [r30], 8 * FLOAT_ITEM_SIZE462 ldf.fill f15 = [r31], 8 * FLOAT_ITEM_SIZE;;463 464 ldf.fill f16 = [r24], 8 * FLOAT_ITEM_SIZE465 ldf.fill f17 = [r25], 8 * FLOAT_ITEM_SIZE466 ldf.fill f18 = [r26], 8 * FLOAT_ITEM_SIZE467 ldf.fill f19 = [r27], 8 * FLOAT_ITEM_SIZE468 ldf.fill f20 = [r28], 8 * FLOAT_ITEM_SIZE469 ldf.fill f21 = [r29], 8 * FLOAT_ITEM_SIZE470 ldf.fill f22 = [r30], 8 * FLOAT_ITEM_SIZE471 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] ;;444 add r24 = 96 + STACK_SCRATCH_AREA_SIZE, r12 445 add r25 = 112 + STACK_SCRATCH_AREA_SIZE, r12 446 add r26 = 0 + STACK_SCRATCH_AREA_SIZE, r12 447 add r27 = 16 + STACK_SCRATCH_AREA_SIZE, r12 448 add r28 = 32 + STACK_SCRATCH_AREA_SIZE, r12 449 add r29 = 48 + STACK_SCRATCH_AREA_SIZE, r12 450 add r30 = 64 + STACK_SCRATCH_AREA_SIZE, r12 451 add r31 = 80 + STACK_SCRATCH_AREA_SIZE, r12 ;; 452 453 ldf.fill f2 = [r26], 0x80 454 ldf.fill f3 = [r27], 0x80 455 ldf.fill f4 = [r28], 0x80 456 ldf.fill f5 = [r29], 0x80 457 ldf.fill f6 = [r30], 0x80 458 ldf.fill f7 = [r31], 0x80 ;; 459 460 ldf.fill f8 = [r24], 0x80 461 ldf.fill f9 = [r25], 0x80 462 ldf.fill f10 = [r26], 0x80 463 ldf.fill f11 = [r27], 0x80 464 ldf.fill f12 = [r28], 0x80 465 ldf.fill f13 = [r29], 0x80 466 ldf.fill f14 = [r30], 0x80 467 ldf.fill f15 = [r31], 0x80 ;; 468 469 ldf.fill f16 = [r24], 0x80 470 ldf.fill f17 = [r25], 0x80 471 ldf.fill f18 = [r26], 0x80 472 ldf.fill f19 = [r27], 0x80 473 ldf.fill f20 = [r28], 0x80 474 ldf.fill f21 = [r29], 0x80 475 ldf.fill f22 = [r30], 0x80 476 ldf.fill f23 = [r31], 0x80 ;; 477 478 ldf.fill f24 = [r24], 0x80 479 ldf.fill f25 = [r25], 0x80 480 ldf.fill f26 = [r26], 0x80 481 ldf.fill f27 = [r27], 0x80 482 ldf.fill f28 = [r28], 0x80 483 ldf.fill f29 = [r29], 0x80 484 ldf.fill f30 = [r30], 0x80 485 ldf.fill f31 = [r31], 0x80 ;; 481 486 482 487 mov r1 = loc17
Note:
See TracChangeset
for help on using the changeset viewer.