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