Changes in uspace/lib/c/arch/ia32/src/fibril.S [9d58539:2b903ca] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ia32/src/fibril.S
r9d58539 r2b903ca 34 34 .global context_restore 35 35 36 37 36 ## Save current CPU context 38 37 # … … 41 40 # 42 41 context_save: 43 movl 0(%esp), %eax# the caller's return %eip44 movl 4(%esp), %edx# address of the context variable to save context to45 46 42 movl 0(%esp), %eax # the caller's return %eip 43 movl 4(%esp), %edx # address of the context variable to save context to 44 45 # save registers to the context structure 47 46 CONTEXT_SAVE_ARCH_CORE %edx %eax 48 49 # Save TLS47 48 # save TLS 50 49 movl %gs:0, %eax 51 50 movl %eax, OFFSET_TLS(%edx) # tls -> ctx->tls 52 51 53 xorl %eax, %eax# context_save returns 152 xorl %eax, %eax # context_save returns 1 54 53 incl %eax 55 54 ret 56 57 55 58 56 ## Restore saved CPU context … … 62 60 # 63 61 context_restore: 64 movl 4(%esp), %eax# address of the context variable to restore context from65 66 62 movl 4(%esp), %eax # address of the context variable to restore context from 63 64 # restore registers from the context structure 67 65 CONTEXT_RESTORE_ARCH_CORE %eax %edx 68 69 movl %edx, 0(%esp)# ctx->pc -> saver's return %eip70 71 # Set thread local storage66 67 movl %edx, 0(%esp) # ctx->pc -> saver's return %eip 68 69 # set thread local storage 72 70 pushl %edx 73 movl OFFSET_TLS(%eax), %edx 74 movl $1, %eax # Syscall SYS_TLS_SET71 movl OFFSET_TLS(%eax), %edx # Set arg1 to TLS addr 72 movl $1, %eax # Syscall SYS_TLS_SET 75 73 int $0x30 76 74 popl %edx 77 75 78 xorl %eax, %eax# context_restore returns 076 xorl %eax, %eax # context_restore returns 0 79 77 ret
Note:
See TracChangeset
for help on using the changeset viewer.