Changeset 15d0046 in mainline for uspace/lib/c/arch/ia32/src/fibril.S
- Timestamp:
- 2014-09-12T13:22:33Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9b20126
- Parents:
- 8db09e4 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ia32/src/fibril.S
r8db09e4 r15d0046 27 27 # 28 28 29 #include <libarch/ context_offset.h>29 #include <libarch/fibril_context.h> 30 30 31 31 .text … … 44 44 45 45 # save registers to the context structure 46 CONTEXT_SAVE_ARCH_CORE %edx %eax 46 movl %esp, CONTEXT_OFFSET_SP(%edx) # %esp -> ctx->sp 47 movl %eax, CONTEXT_OFFSET_PC(%edx) # %eip -> ctx->pc 48 movl %ebx, CONTEXT_OFFSET_EBX(%edx) # %ebx -> ctx->ebx 49 movl %esi, CONTEXT_OFFSET_ESI(%edx) # %esi -> ctx->esi 50 movl %edi, CONTEXT_OFFSET_EDI(%edx) # %edi -> ctx->edi 51 movl %ebp, CONTEXT_OFFSET_EBP(%edx) # %ebp -> ctx->ebp 47 52 48 53 # save TLS 49 54 movl %gs:0, %eax 50 movl %eax, OFFSET_TLS(%edx)# tls -> ctx->tls55 movl %eax, CONTEXT_OFFSET_TLS(%edx) # tls -> ctx->tls 51 56 52 xorl %eax, %eax 57 xorl %eax, %eax # context_save returns 1 53 58 incl %eax 54 59 ret … … 63 68 64 69 # restore registers from the context structure 65 CONTEXT_RESTORE_ARCH_CORE %eax %edx 70 movl CONTEXT_OFFSET_SP(%eax),%esp # ctx->sp -> %esp 71 movl CONTEXT_OFFSET_PC(%eax),%edx # ctx->pc -> \pc 72 movl CONTEXT_OFFSET_EBX(%eax),%ebx # ctx->ebx -> %ebx 73 movl CONTEXT_OFFSET_ESI(%eax),%esi # ctx->esi -> %esi 74 movl CONTEXT_OFFSET_EDI(%eax),%edi # ctx->edi -> %edi 75 movl CONTEXT_OFFSET_EBP(%eax),%ebp # ctx->ebp -> %ebp 66 76 67 77 movl %edx, 0(%esp) # ctx->pc -> saver's return %eip … … 69 79 # set thread local storage 70 80 pushl %edx 71 movl OFFSET_TLS(%eax), %edx# Set arg1 to TLS addr72 movl $1, %eax 81 movl CONTEXT_OFFSET_TLS(%eax), %edx # Set arg1 to TLS addr 82 movl $1, %eax # Syscall SYS_TLS_SET 73 83 int $0x30 74 84 popl %edx 75 85 76 xorl %eax, %eax 86 xorl %eax, %eax # context_restore returns 0 77 87 ret 88
Note:
See TracChangeset
for help on using the changeset viewer.