Changeset d2fa31f7 in mainline for uspace/lib/libc/arch/ia32/src/setjmp.S
- Timestamp:
- 2008-03-15T08:48:18Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7397c73
- Parents:
- cbd6545f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/arch/ia32/src/setjmp.S
rcbd6545f rd2fa31f7 27 27 # 28 28 29 #include <kernel/arch/context_offset.h> 30 29 31 .text 30 32 .global setjmp … … 33 35 .type setjmp,@function 34 36 setjmp: 35 movl 0(%esp), %ecx # save current pc 36 leal 4(%esp), %edx # save stack pointer 37 movl (%edx), %eax # get jmp_buf pointer 37 movl 0(%esp),%eax # save pc value into eax 38 movl 4(%esp),%edx # address of the context variable to save context to 38 39 39 # Save registers 40 movl %ebx, 0(%eax) 41 movl %esi, 4(%eax) 42 movl %edi, 8(%eax) 43 movl %ebp, 12(%eax) 44 movl %edx, 16(%eax) 40 # save registers to given structure 41 CONTEXT_SAVE_ARCH_CORE %edx %eax 45 42 46 movl %ecx, 20(%eax) # save pc43 xorl %eax,%eax # set_jmp returns 0 47 44 ret 48 45 … … 53 50 movl 8(%esp), %eax # put return value into eax 54 51 55 # restore all registers 56 movl 0(%ecx), %ebx 57 movl 4(%ecx), %esi 58 movl 8(%ecx), %edi 59 movl 12(%ecx), %ebp 60 movl 16(%ecx), %esp 61 62 movl 20(%ecx), %edx # saved return address 63 jmp *%edx 52 # restore registers from jmp_buf 53 CONTEXT_RESTORE_ARCH_CORE %ecx %edx 54 55 movl %edx,0(%esp) # put saved pc on stack 56 ret 57
Note:
See TracChangeset
for help on using the changeset viewer.