Changes in uspace/lib/c/arch/sparc64/src/fibril.S [9d58539:a52e2f4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/sparc64/src/fibril.S
r9d58539 ra52e2f4 27 27 # 28 28 29 #include <libarch/context_offset.h> 29 #include <abi/asmtool.h> 30 #include <libarch/fibril_context.h> 30 31 31 32 .text 32 33 33 .global context_save 34 .global context_restore 35 36 context_save: 34 FUNCTION_BEGIN(context_save) 37 35 # 38 36 # We rely on the kernel to flush our active register windows to memory 39 37 # should a thread switch occur. 40 38 # 41 CONTEXT_SAVE_ARCH_CORE %o0 39 stx %sp, [%o0 + CONTEXT_OFFSET_SP] 40 stx %o7, [%o0 + CONTEXT_OFFSET_PC] 41 stx %i0, [%o0 + CONTEXT_OFFSET_I0] 42 stx %i1, [%o0 + CONTEXT_OFFSET_I1] 43 stx %i2, [%o0 + CONTEXT_OFFSET_I2] 44 stx %i3, [%o0 + CONTEXT_OFFSET_I3] 45 stx %i4, [%o0 + CONTEXT_OFFSET_I4] 46 stx %i5, [%o0 + CONTEXT_OFFSET_I5] 47 stx %fp, [%o0 + CONTEXT_OFFSET_FP] 48 stx %i7, [%o0 + CONTEXT_OFFSET_I7] 49 stx %l0, [%o0 + CONTEXT_OFFSET_L0] 50 stx %l1, [%o0 + CONTEXT_OFFSET_L1] 51 stx %l2, [%o0 + CONTEXT_OFFSET_L2] 52 stx %l3, [%o0 + CONTEXT_OFFSET_L3] 53 stx %l4, [%o0 + CONTEXT_OFFSET_L4] 54 stx %l5, [%o0 + CONTEXT_OFFSET_L5] 55 stx %l6, [%o0 + CONTEXT_OFFSET_L6] 56 stx %l7, [%o0 + CONTEXT_OFFSET_L7] 57 stx %g7, [%o0 + CONTEXT_OFFSET_TP] 42 58 retl 43 59 mov 1, %o0 ! context_save_arch returns 1 60 FUNCTION_END(context_save) 44 61 45 context_restore: 62 FUNCTION_BEGIN(context_restore) 46 63 # 47 64 # Flush all active windows. … … 52 69 flushw 53 70 54 CONTEXT_RESTORE_ARCH_CORE %o0 71 ldx [%o0 + CONTEXT_OFFSET_SP], %sp 72 ldx [%o0 + CONTEXT_OFFSET_PC], %o7 73 ldx [%o0 + CONTEXT_OFFSET_I0], %i0 74 ldx [%o0 + CONTEXT_OFFSET_I1], %i1 75 ldx [%o0 + CONTEXT_OFFSET_I2], %i2 76 ldx [%o0 + CONTEXT_OFFSET_I3], %i3 77 ldx [%o0 + CONTEXT_OFFSET_I4], %i4 78 ldx [%o0 + CONTEXT_OFFSET_I5], %i5 79 ldx [%o0 + CONTEXT_OFFSET_FP], %fp 80 ldx [%o0 + CONTEXT_OFFSET_I7], %i7 81 ldx [%o0 + CONTEXT_OFFSET_L0], %l0 82 ldx [%o0 + CONTEXT_OFFSET_L1], %l1 83 ldx [%o0 + CONTEXT_OFFSET_L2], %l2 84 ldx [%o0 + CONTEXT_OFFSET_L3], %l3 85 ldx [%o0 + CONTEXT_OFFSET_L4], %l4 86 ldx [%o0 + CONTEXT_OFFSET_L5], %l5 87 ldx [%o0 + CONTEXT_OFFSET_L6], %l6 88 ldx [%o0 + CONTEXT_OFFSET_L7], %l7 89 ldx [%o0 + CONTEXT_OFFSET_TP], %g7 55 90 retl 56 91 xor %o0, %o0, %o0 ! context_restore_arch returns 0 92 FUNCTION_END(context_restore)
Note:
See TracChangeset
for help on using the changeset viewer.