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


Ignore:
Timestamp:
2019-02-11T22:31:04Z (7 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/arm32
Files:
4 added
17 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/arm32/Makefile.common

    re3272101 rd5a89a3  
    2929
    3030COMMON_CFLAGS += -ffixed-r9 -mtp=soft -fno-omit-frame-pointer -mapcs-frame \
    31         -mcpu=$(subst _,-,$(PROCESSOR))
     31        -mcpu=$(subst _,-,$(PROCESSOR)) -Wl,-z,max-page-size=0x1000
    3232
    3333LDFLAGS += -Wl,--gc-sections
  • uspace/lib/c/arch/arm32/Makefile.inc

    re3272101 rd5a89a3  
    3737        arch/$(UARCH)/src/eabi.S \
    3838        arch/$(UARCH)/src/stacktrace.c \
    39         arch/$(UARCH)/src/stacktrace_asm.S
     39        arch/$(UARCH)/src/stacktrace_asm.S \
     40        arch/$(UARCH)/src/rtld/dynamic.c \
     41        arch/$(UARCH)/src/rtld/reloc.c
  • uspace/lib/c/arch/arm32/include/libarch/config.h

    re3272101 rd5a89a3  
    3434 */
    3535
    36 #ifndef LIBC_arm32_CONFIG_H_
    37 #define LIBC_arm32_CONFIG_H_
     36#ifndef _LIBC_arm32_CONFIG_H_
     37#define _LIBC_arm32_CONFIG_H_
    3838
    3939#define PAGE_WIDTH      12
  • uspace/lib/c/arch/arm32/include/libarch/ddi.h

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

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

    re3272101 rd5a89a3  
    3434 */
    3535
    36 #ifndef LIBC_arm32_FADDR_H_
    37 #define LIBC_arm32_FADDR_H_
     36#ifndef _LIBC_arm32_FADDR_H_
     37#define _LIBC_arm32_FADDR_H_
    3838
    3939#include <types/common.h>
  • uspace/lib/c/arch/arm32/include/libarch/fibril.h

    re3272101 rd5a89a3  
    3434 */
    3535
    36 #ifndef LIBC_arm32_FIBRIL_H_
    37 #define LIBC_arm32_FIBRIL_H_
     36#ifndef _LIBC_arm32_FIBRIL_H_
     37#define _LIBC_arm32_FIBRIL_H_
    3838
    3939#include <types/common.h>
  • uspace/lib/c/arch/arm32/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
    3232#include <stdint.h>
     
    4141// XXX: This struct must match the assembly code in src/fibril.S
    4242
    43 typedef struct context {
     43typedef struct __context {
    4444        uintptr_t sp;
    4545        uintptr_t pc;
     
    5454        /* r11 */
    5555        uint32_t fp;
    56 } context_t;
     56} __context_t;
    5757
    5858#endif
  • uspace/lib/c/arch/arm32/include/libarch/rtld/dynamic.h

    re3272101 rd5a89a3  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 #ifndef LIBCPP_BITS_COMMON
    30 #define LIBCPP_BITS_COMMON
     29/** @addtogroup libc
     30 * @{
     31 */
     32/** @file
     33 */
    3134
    32 /**
    33  * According to section 17.2 of the standard,
    34  * the restrict qualifier shall be omitted.
    35  */
    36 #define restrict
     35#ifndef _LIBC_arm32_RTLD_DYNAMIC_H_
     36#define _LIBC_arm32_RTLD_DYNAMIC_H_
    3737
    38 #undef NULL
    39 #define NULL nullptr
     38typedef struct {
     39        /* Empty. */
     40} dyn_info_arch_t;
    4041
    4142#endif
     43
     44/** @}
     45 */
  • uspace/lib/c/arch/arm32/include/libarch/stackarg.h

    re3272101 rd5a89a3  
    3434 */
    3535
    36 #ifndef LIBC_arm32_STACKARG_H_
    37 #define LIBC_arm32_STACKARG_H_
     36#ifndef _LIBC_arm32_STACKARG_H_
     37#define _LIBC_arm32_STACKARG_H_
    3838
    3939#endif
  • uspace/lib/c/arch/arm32/include/libarch/syscall.h

    re3272101 rd5a89a3  
    3434 */
    3535
    36 #ifndef LIBC_arm32_SYSCALL_H_
    37 #define LIBC_arm32_SYSCALL_H_
     36#ifndef _LIBC_arm32_SYSCALL_H_
     37#define _LIBC_arm32_SYSCALL_H_
    3838
    3939#define LIBARCH_SYSCALL_GENERIC
  • uspace/lib/c/arch/arm32/include/libarch/thread.h

    re3272101 rd5a89a3  
    3434 */
    3535
    36 #ifndef LIBC_arm32_THREAD_H_
    37 #define LIBC_arm32_THREAD_H_
     36#ifndef _LIBC_arm32_THREAD_H_
     37#define _LIBC_arm32_THREAD_H_
    3838
    3939#endif
  • uspace/lib/c/arch/arm32/include/libarch/tls.h

    re3272101 rd5a89a3  
    3434 */
    3535
    36 #ifndef LIBC_arm32_TLS_H_
    37 #define LIBC_arm32_TLS_H_
     36#ifndef _LIBC_arm32_TLS_H_
     37#define _LIBC_arm32_TLS_H_
    3838
    3939#include <stdint.h>
     
    4949 */
    5050typedef struct {
     51        void **dtv;
     52        void *pad;
    5153        /** Fibril data. */
    5254        void *fibril_data;
  • uspace/lib/c/arch/arm32/src/atomic.c

    re3272101 rd5a89a3  
    3535#include <stdbool.h>
    3636
    37 extern volatile unsigned *ras_page;
     37volatile unsigned *ras_page;
    3838
    3939bool __atomic_compare_exchange_4(volatile unsigned *mem, unsigned *expected, unsigned desired, bool weak, int success, int failure)
  • uspace/lib/c/arch/arm32/src/entry.S

    re3272101 rd5a89a3  
    5656
    5757.data
    58 
    59 SYMBOL(ras_page)
    60         .long 0
  • uspace/lib/c/arch/arm32/src/fibril.S

    re3272101 rd5a89a3  
    3131.text
    3232
    33 FUNCTION_BEGIN(__setjmp)
     33FUNCTION_BEGIN(__context_save)
    3434        stmia r0!, {sp, lr}
    3535        stmia r0!, {r4-r11}
     
    3838        mov r0, #0
    3939        mov pc, lr
    40 FUNCTION_END(__setjmp)
     40FUNCTION_END(__context_save)
    4141
    42 FUNCTION_BEGIN(__longjmp)
     42FUNCTION_BEGIN(__context_restore)
    4343        ldmia r0!, {sp, lr}
    4444        ldmia r0!, {r4-r11}
     
    4747        mov r0, r1
    4848        mov pc, lr
    49 FUNCTION_END(__longjmp)
     49FUNCTION_END(__context_restore)
    5050
  • uspace/lib/c/arch/arm32/src/syscall.c

    re3272101 rd5a89a3  
    7070              "r" (__arm_reg_r5),
    7171              "r" (__arm_reg_r6)
     72            :
     73              /*
     74               * Clobber memory too as some arguments might be
     75               * actually pointers.
     76               */
     77              "memory"
    7278        );
    7379
  • uspace/lib/c/arch/arm32/src/tls.c

    re3272101 rd5a89a3  
    11/*
     2 * Copyright (c) 2019 Jiri Svoboda
    23 * Copyright (c) 2007 Pavel Jancik
    34 * All rights reserved.
     
    3839#include <stddef.h>
    3940
     41#ifdef CONFIG_RTLD
     42#include <rtld/rtld.h>
     43#endif
     44
    4045tcb_t *tls_alloc_arch(size_t size, size_t align)
    4146{
     
    4853}
    4954
     55/*
     56 * Rtld TLS support
     57 */
     58
     59typedef struct {
     60        unsigned long int ti_module;
     61        unsigned long int ti_offset;
     62} tls_index;
     63
     64int __tls_debug = 0;
     65
     66void *__tls_get_addr(tls_index *ti);
     67
     68void *__tls_get_addr(tls_index *ti)
     69{
     70        uint8_t *tls;
     71
     72#ifdef CONFIG_RTLD
     73        if (runtime_env != NULL) {
     74                return rtld_tls_get_addr(runtime_env, __tcb_get(),
     75                    ti->ti_module, ti->ti_offset);
     76        }
     77#endif
     78        /* Get address of static TLS block */
     79        tls = tls_get();
     80        return tls + ti->ti_offset;
     81}
     82
    5083/** @}
    5184 */
Note: See TracChangeset for help on using the changeset viewer.