Changeset d2fa31f7 in mainline


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.

Location:
uspace/lib/libc
Files:
2 edited
1 moved

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
  • uspace/lib/libc/include/setjmp.h

    rcbd6545f rd2fa31f7  
    2727 */
    2828
    29 /** @addtogroup libcia32
     29/** @addtogroup libc
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef LIBC_ia32_SETJMP_H_
    36 #define LIBC_ia32_SETJMP_H_
     35#ifndef LIBC_SETJMP_H_
     36#define LIBC_SETJMP_H_
    3737
    38 #include <libarch/types.h>
     38#include <libarch/fibril.h>
    3939
    40 typedef struct {
    41         uint32_t ebx;
    42         uint32_t esi;
    43         uint32_t edi;
    44         uint32_t ebp;
    45         uint32_t esp;
    46         uint32_t pc;
    47 } jmp_buf;
     40typedef context_t jmp_buf;
    4841
    49 int setjmp(jmp_buf env);
    50 void longjmp(jmp_buf env,int val) __attribute__((__noreturn__));
     42extern int setjmp(jmp_buf env);
     43extern void longjmp(jmp_buf env,int val) __attribute__((__noreturn__));
    5144
    5245#endif
  • uspace/lib/libc/include/unistd.h

    rcbd6545f rd2fa31f7  
    3939#include <libarch/config.h>
    4040
     41#ifndef NULL
    4142#define NULL 0
     43#endif
     44
    4245#define getpagesize()     (PAGE_SIZE)
    4346
Note: See TracChangeset for help on using the changeset viewer.