Ignore:
Timestamp:
2008-03-15T08:48:18Z (17 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7397c73
Parents:
cbd6545f
Message:

United headers using context_t in uspace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/arch/ia32/src/setjmp.S

    rcbd6545f rd2fa31f7  
    2727#
    2828
     29#include <kernel/arch/context_offset.h>
     30
    2931.text
    3032.global setjmp
     
    3335.type setjmp,@function
    3436setjmp:
    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
    3839
    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
    4542
    46         movl %ecx, 20(%eax) # save pc
     43        xorl %eax,%eax          # set_jmp returns 0
    4744        ret
    4845
     
    5350        movl 8(%esp), %eax      # put return value into eax     
    5451
    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.