Changeset 99de22b in mainline for kernel/arch/sparc64
- Timestamp:
- 2010-01-15T18:30:25Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eeb643d
- Parents:
- 387416b (diff), 563d6077 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- kernel/arch/sparc64
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/Makefile.inc
r387416b r99de22b 65 65 ARCH_SOURCES = \ 66 66 arch/$(KARCH)/src/cpu/$(USARCH)/cpu.c \ 67 arch/$(KARCH)/src/debug/stacktrace.c \ 68 arch/$(KARCH)/src/debug/stacktrace_asm.S \ 67 69 arch/$(KARCH)/src/asm.S \ 68 70 arch/$(KARCH)/src/$(USARCH)/asm.S \ -
kernel/arch/sparc64/_link.ld.in
r387416b r99de22b 36 36 *(COMMON); /* global variables */ 37 37 38 . = ALIGN(8); 38 39 symbol_table = .; 39 40 *(symtab.*); /* Symbol table, must be LAST symbol!*/ -
kernel/arch/sparc64/include/interrupt.h
r387416b r99de22b 50 50 }; 51 51 52 typedef struct {52 typedef struct istate { 53 53 uint64_t tnpc; 54 54 uint64_t tpc; … … 71 71 } 72 72 73 static inline unative_t istate_get_fp(istate_t *istate) 74 { 75 return 0; /* TODO */ 76 } 77 73 78 #endif 74 79 -
kernel/arch/sparc64/src/context.S
r387416b r99de22b 28 28 29 29 #include <arch/context_offset.h> 30 31 /** 32 * Both context_save_arch() and context_restore_arch() are 33 * leaf-optimized procedures. This kind of optimization 34 * is very important and prevents any implicit window 35 * spill/fill/clean traps in these very core kernel 36 * functions. 37 */ 38 39 #include <arch/context_offset.h> 30 #include <arch/arch.h> 31 #include <arch/regdef.h> 40 32 41 33 .text … … 44 36 .global context_restore_arch 45 37 38 /* 39 * context_save_arch() is required not to create its own stack frame. See the 40 * generic context.h for explanation. 41 */ 46 42 context_save_arch: 43 # 44 # Force all our active register windows to memory so that we can find 45 # them there even if e.g. the thread is migrated to another processor. 46 # 47 flushw 48 47 49 CONTEXT_SAVE_ARCH_CORE %o0 48 50 retl … … 51 53 context_restore_arch: 52 54 # 53 # Flush all active windows. 54 # This is essential, because CONTEXT_LOAD overwrites 55 # %sp of CWP - 1 with the value written to %fp of CWP. 56 # Flushing all active windows mitigates this problem 57 # as CWP - 1 becomes the overlap window. 55 # Forget all previous windows, they are not going to be needed again. 56 # Enforce a window fill on the next RESTORE instruction by setting 57 # CANRESTORE to zero and other window configuration registers 58 # accordingly. Note that the same can be achieved by executing the 59 # FLUSHW instruction, but since we don't need to remember the previous 60 # windows, we do the former and save thus some unnecessary window 61 # spills. 58 62 # 59 flushw 60 63 rdpr %pstate, %l0 64 andn %l0, PSTATE_IE_BIT, %l1 65 wrpr %l1, %pstate 66 wrpr %g0, 0, %canrestore 67 wrpr %g0, 0, %otherwin 68 wrpr %g0, NWINDOWS - 2, %cansave 69 wrpr %l0, %pstate 70 61 71 CONTEXT_RESTORE_ARCH_CORE %o0 62 72 retl -
kernel/arch/sparc64/src/trap/sun4u/trap_table.S
r387416b r99de22b 652 652 * spilled to kernel memory (i.e. register window buffer). Moreover, 653 653 * if the scheduler was called in the meantime, all valid windows 654 * belonging to other threads were spilled by context_ restore().654 * belonging to other threads were spilled by context_save(). 655 655 * If OTHERWIN is non-zero, then some userspace windows are still 656 656 * valid. Others might have been spilled. However, the CWP pointer
Note:
See TracChangeset
for help on using the changeset viewer.