Changes in uspace/lib/c/arch/ia32/src/fibril.S [e74b24f:d6f9fff] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ia32/src/fibril.S
re74b24f rd6f9fff 27 27 # 28 28 29 #include <abi/asmtool.h> 29 30 #include <libarch/fibril_context.h> 30 31 31 32 .text 32 33 .global context_save34 .global context_restore35 33 36 34 ## Save current CPU context … … 39 37 # pointed by the 1st argument. Returns 1 in EAX. 40 38 # 41 context_save: 39 FUNCTION_BEGIN(context_save) 42 40 movl 0(%esp), %eax # the caller's return %eip 43 41 movl 4(%esp), %edx # address of the context variable to save context to … … 58 56 incl %eax 59 57 ret 58 FUNCTION_END(context_save) 60 59 61 60 ## Restore saved CPU context … … 64 63 # pointed by the 1st argument. Returns 0 in EAX. 65 64 # 66 context_restore: 65 FUNCTION_BEGIN(context_restore) 67 66 movl 4(%esp), %eax # address of the context variable to restore context from 68 67 … … 78 77 79 78 # set thread local storage 80 pushl %edx81 79 movl CONTEXT_OFFSET_TLS(%eax), %edx # Set arg1 to TLS addr 82 movl $1, %eax # Syscall SYS_TLS_SET 83 int $0x30 84 popl %edx 80 movl %edx, %gs:0 85 81 86 82 xorl %eax, %eax # context_restore returns 0 87 83 ret 84 FUNCTION_END(context_restore) 88 85
Note:
See TracChangeset
for help on using the changeset viewer.