Changeset baac911 in mainline
- Timestamp:
- 2008-03-15T09:43:06Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1dbfe98
- Parents:
- 1aede82
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/arch/ia32/src/fibril.S
r1aede82 rbaac911 27 27 # 28 28 29 #include <kernel/arch/context_offset.h> 30 29 31 .text 30 32 … … 42 44 movl 4(%esp),%edx # address of the context variable to save context to 43 45 44 movl %esp,0(%edx) # %esp -> ctx->sp 45 movl %eax,4(%edx) # %eip -> ctx->pc 46 movl %ebx,8(%edx) # %ebx -> ctx->ebx 47 movl %esi,12(%edx) # %esi -> ctx->esi 48 movl %edi,16(%edx) # %edi -> ctx->edi 49 movl %ebp,20(%edx) # %ebp -> ctx->ebp 46 # save registers to given structure 47 CONTEXT_SAVE_ARCH_CORE %edx %eax 50 48 51 49 # Save TLS 52 50 movl %gs:0, %eax 53 movl %eax, 24(%edx) # tls -> ctx->tls51 movl %eax, OFFSET_TLS(%edx) # tls -> ctx->tls 54 52 55 53 xorl %eax,%eax # context_save returns 1 … … 65 63 context_restore: 66 64 movl 4(%esp),%eax # address of the context variable to restore context from 67 movl 0(%eax),%esp # ctx->sp -> %esp 68 movl 4(%eax),%edx # ctx->pc -> %edx 69 movl 8(%eax),%ebx # ctx->ebx -> %ebx 70 movl 12(%eax),%esi # ctx->esi -> %esi 71 movl 16(%eax),%edi # ctx->edi -> %edi 72 movl 20(%eax),%ebp # ctx->ebp -> %ebp 65 66 # restore registers from jmp_buf 67 CONTEXT_RESTORE_ARCH_CORE %eax %edx 73 68 74 69 movl %edx,0(%esp) # ctx->pc -> saver's return %eip … … 76 71 # Set thread local storage 77 72 pushl %edx 78 movl 24(%eax), %edx # Set arg1 to TLS addr73 movl OFFSET_TLS(%eax), %edx # Set arg1 to TLS addr 79 74 movl $1, %eax # Syscall SYS_TLS_SET 80 75 int $0x30
Note:
See TracChangeset
for help on using the changeset viewer.