Changeset d5a89a3 in mainline for uspace/lib/c/arch/ia32


Ignore:
Timestamp:
2019-02-11T22:31:04Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
aaf9789c
Parents:
e3272101 (diff), 4805495 (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.
Message:

merging with upstream/master

Location:
uspace/lib/c/arch/ia32
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/ia32/include/libarch/config.h

    re3272101 rd5a89a3  
    3333 */
    3434
    35 #ifndef LIBC_ia32_CONFIG_H_
    36 #define LIBC_ia32_CONFIG_H_
     35#ifndef _LIBC_ia32_CONFIG_H_
     36#define _LIBC_ia32_CONFIG_H_
    3737
    3838#define PAGE_WIDTH  12
  • uspace/lib/c/arch/ia32/include/libarch/ddi.h

    re3272101 rd5a89a3  
    3131 */
    3232
    33 #ifndef LIBC_ia32_DDI_H_
    34 #define LIBC_ia32_DDI_H_
     33#ifndef _LIBC_ia32_DDI_H_
     34#define _LIBC_ia32_DDI_H_
    3535
    3636#include <ddi.h>
  • uspace/lib/c/arch/ia32/include/libarch/elf_linux.h

    re3272101 rd5a89a3  
    3333 */
    3434
    35 #ifndef LIBC_ia32_ELF_LINUX_H_
    36 #define LIBC_ia32_ELF_LINUX_H_
     35#ifndef _LIBC_ia32_ELF_LINUX_H_
     36#define _LIBC_ia32_ELF_LINUX_H_
    3737
    3838#include <libarch/istate.h>
  • uspace/lib/c/arch/ia32/include/libarch/faddr.h

    re3272101 rd5a89a3  
    3333 */
    3434
    35 #ifndef LIBC_ia32_FADDR_H_
    36 #define LIBC_ia32_FADDR_H_
     35#ifndef _LIBC_ia32_FADDR_H_
     36#define _LIBC_ia32_FADDR_H_
    3737
    3838#include <types/common.h>
  • uspace/lib/c/arch/ia32/include/libarch/fibril.h

    re3272101 rd5a89a3  
    3333 */
    3434
    35 #ifndef LIBC_ia32_FIBRIL_H_
    36 #define LIBC_ia32_FIBRIL_H_
     35#ifndef _LIBC_ia32_FIBRIL_H_
     36#define _LIBC_ia32_FIBRIL_H_
    3737
    3838#include <types/common.h>
  • uspace/lib/c/arch/ia32/include/libarch/fibril_context.h

    re3272101 rd5a89a3  
    2727 */
    2828
    29 #ifndef LIBC_ARCH_FIBRIL_CONTEXT_H_
    30 #define LIBC_ARCH_FIBRIL_CONTEXT_H_
     29#ifndef _LIBC_ARCH_FIBRIL_CONTEXT_H_
     30#define _LIBC_ARCH_FIBRIL_CONTEXT_H_
    3131
    32 #define CONTEXT_OFFSET_SP   0x00
    33 #define CONTEXT_OFFSET_PC   0x04
    34 #define CONTEXT_OFFSET_EBX  0x08
    35 #define CONTEXT_OFFSET_ESI  0x0c
    36 #define CONTEXT_OFFSET_EDI  0x10
    37 #define CONTEXT_OFFSET_EBP  0x14
    38 #define CONTEXT_OFFSET_TLS  0x18
    39 #define CONTEXT_SIZE        0x1c
     32#define __CONTEXT_OFFSET_SP   0x00
     33#define __CONTEXT_OFFSET_PC   0x04
     34#define __CONTEXT_OFFSET_EBX  0x08
     35#define __CONTEXT_OFFSET_ESI  0x0c
     36#define __CONTEXT_OFFSET_EDI  0x10
     37#define __CONTEXT_OFFSET_EBP  0x14
     38#define __CONTEXT_OFFSET_TLS  0x18
     39#define __CONTEXT_SIZE        0x1c
    4040
    4141#ifndef __ASSEMBLER__
     
    4444
    4545/* We include only registers that must be preserved during function call. */
    46 typedef struct context {
     46typedef struct __context {
    4747        uint32_t sp;
    4848        uint32_t pc;
     
    5252        uint32_t ebp;
    5353        uint32_t tls;
    54 } context_t;
     54} __context_t;
    5555
    5656#endif
  • uspace/lib/c/arch/ia32/include/libarch/rtld/dynamic.h

    re3272101 rd5a89a3  
    3333 */
    3434
    35 #ifndef LIBC_ia32_RTLD_DYNAMIC_H_
    36 #define LIBC_ia32_RTLD_DYNAMIC_H_
     35#ifndef _LIBC_ia32_RTLD_DYNAMIC_H_
     36#define _LIBC_ia32_RTLD_DYNAMIC_H_
    3737
    3838typedef struct {
  • uspace/lib/c/arch/ia32/include/libarch/rtld/elf_dyn.h

    re3272101 rd5a89a3  
    3333 */
    3434
    35 #ifndef LIBC_ia32_RTLD_ELF_DYN_H_
    36 #define LIBC_ia32_RTLD_ELF_DYN_H_
     35#ifndef _LIBC_ia32_RTLD_ELF_DYN_H_
     36#define _LIBC_ia32_RTLD_ELF_DYN_H_
    3737
    3838/*
  • uspace/lib/c/arch/ia32/include/libarch/syscall.h

    re3272101 rd5a89a3  
    3434 */
    3535
    36 #ifndef LIBC_ia32_SYSCALL_H_
    37 #define LIBC_ia32_SYSCALL_H_
     36#ifndef _LIBC_ia32_SYSCALL_H_
     37#define _LIBC_ia32_SYSCALL_H_
    3838
    3939#include <abi/syscall.h>
  • uspace/lib/c/arch/ia32/include/libarch/thread.h

    re3272101 rd5a89a3  
    3333 */
    3434
    35 #ifndef LIBC_ia32_THREAD_H_
    36 #define LIBC_ia32_THREAD_H_
     35#ifndef _LIBC_ia32_THREAD_H_
     36#define _LIBC_ia32_THREAD_H_
    3737
    3838#endif
  • uspace/lib/c/arch/ia32/include/libarch/tls.h

    re3272101 rd5a89a3  
    3333 */
    3434
    35 #ifndef LIBC_ia32_TLS_H_
    36 #define LIBC_ia32_TLS_H_
     35#ifndef _LIBC_ia32_TLS_H_
     36#define _LIBC_ia32_TLS_H_
    3737
    3838#define CONFIG_TLS_VARIANT_2
  • uspace/lib/c/arch/ia32/src/fibril.S

    re3272101 rd5a89a3  
    3737# pointed by the 1st argument. Returns 0 in EAX.
    3838#
    39 FUNCTION_BEGIN(__setjmp)
     39FUNCTION_BEGIN(__context_save)
    4040        movl 0(%esp), %eax  # the caller's return %eip
    4141        movl 4(%esp), %edx  # address of the context variable to save context to
    4242
    4343        # save registers to the context structure
    44         movl %esp, CONTEXT_OFFSET_SP(%edx)      # %esp -> ctx->sp
    45         movl %eax, CONTEXT_OFFSET_PC(%edx)      # %eip -> ctx->pc
    46         movl %ebx, CONTEXT_OFFSET_EBX(%edx)     # %ebx -> ctx->ebx
    47         movl %esi, CONTEXT_OFFSET_ESI(%edx)     # %esi -> ctx->esi
    48         movl %edi, CONTEXT_OFFSET_EDI(%edx)     # %edi -> ctx->edi
    49         movl %ebp, CONTEXT_OFFSET_EBP(%edx)     # %ebp -> ctx->ebp
     44        movl %esp, __CONTEXT_OFFSET_SP(%edx)    # %esp -> ctx->sp
     45        movl %eax, __CONTEXT_OFFSET_PC(%edx)    # %eip -> ctx->pc
     46        movl %ebx, __CONTEXT_OFFSET_EBX(%edx)   # %ebx -> ctx->ebx
     47        movl %esi, __CONTEXT_OFFSET_ESI(%edx)   # %esi -> ctx->esi
     48        movl %edi, __CONTEXT_OFFSET_EDI(%edx)   # %edi -> ctx->edi
     49        movl %ebp, __CONTEXT_OFFSET_EBP(%edx)   # %ebp -> ctx->ebp
    5050
    5151        # save TLS
    5252        movl %gs:0, %eax
    53         movl %eax, CONTEXT_OFFSET_TLS(%edx)     # tls -> ctx->tls
     53        movl %eax, __CONTEXT_OFFSET_TLS(%edx)   # tls -> ctx->tls
    5454
    55         xorl %eax, %eax         # __setjmp returns 0
     55        xorl %eax, %eax         # __context_save returns 0
    5656        ret
    57 FUNCTION_END(__setjmp)
     57FUNCTION_END(__context_save)
    5858
    5959## Restore saved CPU context
     
    6262# pointed by the 1st argument. Returns second argument in EAX.
    6363#
    64 FUNCTION_BEGIN(__longjmp)
     64FUNCTION_BEGIN(__context_restore)
    6565        movl 4(%esp), %eax  # address of the context variable to restore context from
    6666        movl 8(%esp), %ecx  # return value
    6767
    6868        # restore registers from the context structure
    69         movl CONTEXT_OFFSET_SP(%eax),%esp       # ctx->sp -> %esp
    70         movl CONTEXT_OFFSET_PC(%eax),%edx       # ctx->pc -> \pc
    71         movl CONTEXT_OFFSET_EBX(%eax),%ebx      # ctx->ebx -> %ebx
    72         movl CONTEXT_OFFSET_ESI(%eax),%esi      # ctx->esi -> %esi
    73         movl CONTEXT_OFFSET_EDI(%eax),%edi      # ctx->edi -> %edi
    74         movl CONTEXT_OFFSET_EBP(%eax),%ebp      # ctx->ebp -> %ebp
     69        movl __CONTEXT_OFFSET_SP(%eax),%esp     # ctx->sp -> %esp
     70        movl __CONTEXT_OFFSET_PC(%eax),%edx     # ctx->pc -> \pc
     71        movl __CONTEXT_OFFSET_EBX(%eax),%ebx    # ctx->ebx -> %ebx
     72        movl __CONTEXT_OFFSET_ESI(%eax),%esi    # ctx->esi -> %esi
     73        movl __CONTEXT_OFFSET_EDI(%eax),%edi    # ctx->edi -> %edi
     74        movl __CONTEXT_OFFSET_EBP(%eax),%ebp    # ctx->ebp -> %ebp
    7575
    7676        movl %edx, 0(%esp)  # ctx->pc -> saver's return %eip
    7777
    7878        # set thread local storage
    79         movl CONTEXT_OFFSET_TLS(%eax), %edx     # Set arg1 to TLS addr
     79        movl __CONTEXT_OFFSET_TLS(%eax), %edx   # Set arg1 to TLS addr
    8080        movl %edx, %gs:0
    8181
    8282        movl %ecx, %eax
    8383        ret
    84 FUNCTION_END(__longjmp)
     84FUNCTION_END(__context_restore)
    8585
Note: See TracChangeset for help on using the changeset viewer.