Changeset beb3926a in mainline
- Timestamp:
- 2006-08-31T11:05:30Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e0b241f
- Parents:
- ee454eb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/trap/trap_table.S
ree454eb rbeb3926a 492 492 bnz 1f ! ...skip restoring userspace windows 493 493 nop 494 495 /* 496 * Spills and fills will be processed by the {spill,fill}_1_normal 497 * handlers. 498 */ 499 wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(1), %wstate 494 500 495 501 rdpr %cwp, %g1 … … 546 552 wrpr %g1, 0, %cwp 547 553 add %g4, %g2, %g2 548 mov NWINDOW - 2, %g1 554 cmp %g2, NWINDOW - 2 555 bg 2f ! fix the CANRESTORE=NWINDOW-1 anomaly 556 mov NWINDOW - 2, %g1 ! use dealy slot for both cases 549 557 sub %g1, %g2, %g1 550 558 … … 554 562 wrpr %g2, 0, %cleanwin ! avoid information leak 555 563 556 /*557 * Spills and fills will be processed by the {spill,fill}_1_normal558 * handlers.559 */560 wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(1), %wstate561 562 564 1: 563 565 restore 564 566 retry 567 568 /* 569 * We got here in order to avoid inconsistency of the window state registers. 570 * If the: 571 * 572 * save %g6, -PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE, %sp 573 * 574 * instruction trapped and spilled a register window into the userspace 575 * window buffer, we have just restored NWINDOW - 1 register windows. 576 * However, CANRESTORE can be only NWINDOW - 2 at most. 577 * 578 * The solution is to manually switch to (CWP - 1) mod NWINDOW 579 * and set the window state registers so that: 580 * 581 * CANRESTORE = NWINDOW - 2 582 * CLEANWIN = NWINDOW - 2 583 * CANSAVE = 0 584 * OTHERWIN = 0 585 * 586 * The RESTORE isntruction is therfore to be skipped. 587 */ 588 2: 589 wrpr %g0, 0, %otherwin 590 wrpr %g0, 0, %cansave 591 wrpr %g1, 0, %canrestore 592 wrpr %g1, 0, %cleanwin 593 594 rdpr %cwp, %g1 595 dec %g1 596 and %g1, NWINDOW - 1, %g1 597 wrpr %g1, 0, %cwp ! CWP-- 598 599 retry
Note:
See TracChangeset
for help on using the changeset viewer.