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