Changeset 6eabb6e6 in mainline for kernel/arch/sparc64/src
- Timestamp:
- 2006-09-13T13:16:30Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 34d9469e
- Parents:
- 9a5b556
- Location:
- kernel/arch/sparc64/src
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/asm.S
r9a5b556 r6eabb6e6 228 228 229 229 .macro WRITE_ALTERNATE_REGISTER reg, bit 230 rdpr %pstate, %g1 ! save PSTATE.PEF 230 231 wrpr %g0, (\bit | PSTATE_PRIV_BIT), %pstate 231 232 mov %o0, \reg 233 wrpr %g0, PSTATE_PRIV_BIT, %pstate 232 234 retl 233 wrpr %g 0, PSTATE_PRIV_BIT, %pstate235 wrpr %g1, 0, %pstate ! restore PSTATE.PEF 234 236 .endm 235 237 236 238 .macro READ_ALTERNATE_REGISTER reg, bit 239 rdpr %pstate, %g1 ! save PSTATE.PEF 237 240 wrpr %g0, (\bit | PSTATE_PRIV_BIT), %pstate 238 241 mov \reg, %o0 242 wrpr %g0, PSTATE_PRIV_BIT, %pstate 239 243 retl 240 wrpr %g 0, PSTATE_PRIV_BIT, %pstate244 wrpr %g1, 0, %pstate ! restore PSTATE.PEF 241 245 .endm 242 246 -
kernel/arch/sparc64/src/dummy.s
r9a5b556 r6eabb6e6 30 30 31 31 .global cpu_sleep 32 .global fpu_context_restore33 .global fpu_context_save34 .global fpu_enable35 .global fpu_init36 32 .global sys_tls_set 37 33 … … 39 35 40 36 cpu_sleep: 41 fpu_context_restore:42 fpu_context_save:43 fpu_enable:44 fpu_init:45 37 sys_tls_set: 46 38 -
kernel/arch/sparc64/src/trap/exception.c
r9a5b556 r6eabb6e6 38 38 #include <interrupt.h> 39 39 #include <arch/asm.h> 40 #include <arch/register.h> 40 41 #include <debug.h> 41 42 #include <typedefs.h> … … 82 83 } 83 84 85 /** Handle fp_disabled. (0x20) */ 86 void fp_disabled(int n, istate_t *istate) 87 { 88 fprs_reg_t fprs; 89 90 fprs.value = fprs_read(); 91 if (!fprs.fef) { 92 fprs.fef = true; 93 fprs_write(fprs.value); 94 return; 95 } 96 97 #ifdef CONFIG_FPU_LAZY 98 scheduler_fpu_lazy_request(); 99 #else 100 fault_if_from_uspace(istate, "%s\n", __FUNCTION__); 101 dump_istate(istate); 102 panic("%s\n", __FUNCTION__); 103 #endif 104 } 105 84 106 /** Handle division_by_zero. (0x28) */ 85 107 void division_by_zero(int n, istate_t *istate) -
kernel/arch/sparc64/src/trap/trap_table.S
r9a5b556 r6eabb6e6 83 83 PREEMPTIBLE_HANDLER privileged_opcode 84 84 85 /* TT = 0x20, TL = 0, fb_disabled handler */ 86 .org trap_table + TT_FP_DISABLED*ENTRY_SIZE 87 .global fb_disabled_tl0 88 fp_disabled_tl0: 89 PREEMPTIBLE_HANDLER fp_disabled 90 85 91 /* TT = 0x24, TL = 0, clean_window handler */ 86 92 .org trap_table + TT_CLEAN_WINDOW*ENTRY_SIZE 87 .global clean_window_ handler_tl088 clean_window_ handler_tl0:93 .global clean_window_tl0 94 clean_window_tl0: 89 95 CLEAN_WINDOW_HANDLER 90 96 … … 490 496 /* TT = 0x24, TL > 0, clean_window handler */ 491 497 .org trap_table + (TT_CLEAN_WINDOW+512)*ENTRY_SIZE 492 .global clean_window_ handler_tl1493 clean_window_ handler_tl1:498 .global clean_window_tl1 499 clean_window_tl1: 494 500 CLEAN_WINDOW_HANDLER 495 501 … … 689 695 690 696 wrpr %g0, 0, %tl 691 wrpr %g0, PSTATE_PRIV_BIT , %pstate697 wrpr %g0, PSTATE_PRIV_BIT | PSTATE_PEF_BIT, %pstate 692 698 SAVE_GLOBALS 693 699 … … 706 712 707 713 RESTORE_GLOBALS 714 rdpr %pstate, %l1 ! we must preserve the PEF bit 708 715 wrpr %g0, PSTATE_AG_BIT | PSTATE_PRIV_BIT, %pstate 709 716 wrpr %g0, 1, %tl … … 717 724 718 725 /* 726 * Copy PSTATE.PEF to the in-register copy of TSTATE. 727 */ 728 and %l1, PSTATE_PEF_BIT, %l1 729 sllx %l1, TSTATE_PSTATE_SHIFT, %l1 730 sethi %hi(TSTATE_PEF_BIT), %g4 731 andn %g1, %g4, %g1 732 or %g1, %l1, %g1 733 734 /* 719 735 * Restore TSTATE, TPC and TNPC from saved copies. 720 736 */ … … 722 738 wrpr %g2, 0, %tpc 723 739 wrpr %g3, 0, %tnpc 740 724 741 725 742 /*
Note:
See TracChangeset
for help on using the changeset viewer.