Changeset d5a89a3 in mainline for uspace/lib/c/arch
- Timestamp:
- 2019-02-11T22:31:04Z (7 years ago)
- 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. - Location:
- uspace/lib/c/arch
- Files:
-
- 16 added
- 118 edited
- 1 moved
-
abs32le/include/libarch/config.h (modified) (1 diff)
-
abs32le/include/libarch/ddi.h (modified) (1 diff)
-
abs32le/include/libarch/elf_linux.h (modified) (1 diff)
-
abs32le/include/libarch/faddr.h (modified) (1 diff)
-
abs32le/include/libarch/fibril.h (modified) (1 diff)
-
abs32le/include/libarch/fibril_context.h (modified) (2 diffs)
-
abs32le/include/libarch/syscall.h (modified) (1 diff)
-
abs32le/include/libarch/thread.h (modified) (1 diff)
-
abs32le/include/libarch/tls.h (modified) (1 diff)
-
abs32le/src/fibril.c (modified) (1 diff)
-
amd64/Makefile.common (modified) (1 diff)
-
amd64/include/libarch/config.h (modified) (1 diff)
-
amd64/include/libarch/elf_linux.h (modified) (1 diff)
-
amd64/include/libarch/faddr.h (modified) (1 diff)
-
amd64/include/libarch/fibril.h (modified) (1 diff)
-
amd64/include/libarch/fibril_context.h (modified) (3 diffs)
-
amd64/include/libarch/rtld/dynamic.h (modified) (1 diff)
-
amd64/include/libarch/rtld/elf_dyn.h (modified) (1 diff)
-
amd64/include/libarch/rtld/module.h (added)
-
amd64/include/libarch/stackarg.h (modified) (1 diff)
-
amd64/include/libarch/syscall.h (modified) (1 diff)
-
amd64/include/libarch/thread.h (modified) (1 diff)
-
amd64/include/libarch/tls.h (modified) (1 diff)
-
amd64/src/fibril.S (modified) (2 diffs)
-
amd64/src/rtld/dynamic.c (modified) (1 diff)
-
arm32/Makefile.common (modified) (1 diff)
-
arm32/Makefile.inc (modified) (1 diff)
-
arm32/include/libarch/config.h (modified) (1 diff)
-
arm32/include/libarch/ddi.h (modified) (1 diff)
-
arm32/include/libarch/elf_linux.h (modified) (1 diff)
-
arm32/include/libarch/faddr.h (modified) (1 diff)
-
arm32/include/libarch/fibril.h (modified) (1 diff)
-
arm32/include/libarch/fibril_context.h (modified) (3 diffs)
-
arm32/include/libarch/rtld/dynamic.h (moved) (moved from uspace/lib/cpp/include/__bits/common.hpp ) (2 diffs)
-
arm32/include/libarch/rtld/elf_dyn.h (added)
-
arm32/include/libarch/rtld/module.h (added)
-
arm32/include/libarch/stackarg.h (modified) (1 diff)
-
arm32/include/libarch/syscall.h (modified) (1 diff)
-
arm32/include/libarch/thread.h (modified) (1 diff)
-
arm32/include/libarch/tls.h (modified) (2 diffs)
-
arm32/src/atomic.c (modified) (1 diff)
-
arm32/src/entry.S (modified) (1 diff)
-
arm32/src/fibril.S (modified) (3 diffs)
-
arm32/src/rtld/dynamic.c (added)
-
arm32/src/rtld/reloc.c (added)
-
arm32/src/syscall.c (modified) (1 diff)
-
arm32/src/tls.c (modified) (3 diffs)
-
ia32/include/libarch/config.h (modified) (1 diff)
-
ia32/include/libarch/ddi.h (modified) (1 diff)
-
ia32/include/libarch/elf_linux.h (modified) (1 diff)
-
ia32/include/libarch/faddr.h (modified) (1 diff)
-
ia32/include/libarch/fibril.h (modified) (1 diff)
-
ia32/include/libarch/fibril_context.h (modified) (3 diffs)
-
ia32/include/libarch/rtld/dynamic.h (modified) (1 diff)
-
ia32/include/libarch/rtld/elf_dyn.h (modified) (1 diff)
-
ia32/include/libarch/rtld/module.h (added)
-
ia32/include/libarch/syscall.h (modified) (1 diff)
-
ia32/include/libarch/thread.h (modified) (1 diff)
-
ia32/include/libarch/tls.h (modified) (1 diff)
-
ia32/src/fibril.S (modified) (2 diffs)
-
ia64/include/libarch/config.h (modified) (1 diff)
-
ia64/include/libarch/ddi.h (modified) (1 diff)
-
ia64/include/libarch/elf_linux.h (modified) (1 diff)
-
ia64/include/libarch/faddr.h (modified) (1 diff)
-
ia64/include/libarch/fibril.h (modified) (2 diffs)
-
ia64/include/libarch/fibril_context.h (modified) (3 diffs)
-
ia64/include/libarch/stack.h (modified) (1 diff)
-
ia64/include/libarch/stackarg.h (modified) (1 diff)
-
ia64/include/libarch/syscall.h (modified) (1 diff)
-
ia64/include/libarch/thread.h (modified) (1 diff)
-
ia64/include/libarch/tls.h (modified) (1 diff)
-
ia64/src/fibril.S (modified) (4 diffs)
-
mips32/include/libarch/config.h (modified) (1 diff)
-
mips32/include/libarch/ddi.h (modified) (1 diff)
-
mips32/include/libarch/elf_linux.h (modified) (1 diff)
-
mips32/include/libarch/faddr.h (modified) (1 diff)
-
mips32/include/libarch/fibril.h (modified) (1 diff)
-
mips32/include/libarch/fibril_context.h (modified) (3 diffs)
-
mips32/include/libarch/stack.h (modified) (1 diff)
-
mips32/include/libarch/syscall.h (modified) (1 diff)
-
mips32/include/libarch/thread.h (modified) (1 diff)
-
mips32/include/libarch/tls.h (modified) (1 diff)
-
mips32/src/fibril.S (modified) (2 diffs)
-
mips32/src/syscall.c (modified) (1 diff)
-
ppc32/Makefile.common (modified) (1 diff)
-
ppc32/Makefile.inc (modified) (1 diff)
-
ppc32/include/libarch/config.h (modified) (1 diff)
-
ppc32/include/libarch/ddi.h (modified) (1 diff)
-
ppc32/include/libarch/elf_linux.h (modified) (1 diff)
-
ppc32/include/libarch/faddr.h (modified) (1 diff)
-
ppc32/include/libarch/fibril.h (modified) (1 diff)
-
ppc32/include/libarch/fibril_context.h (modified) (3 diffs)
-
ppc32/include/libarch/regname.h (modified) (1 diff)
-
ppc32/include/libarch/rtld/dynamic.h (added)
-
ppc32/include/libarch/rtld/elf_dyn.h (added)
-
ppc32/include/libarch/rtld/module.h (added)
-
ppc32/include/libarch/stackarg.h (modified) (1 diff)
-
ppc32/include/libarch/syscall.h (modified) (1 diff)
-
ppc32/include/libarch/thread.h (modified) (1 diff)
-
ppc32/include/libarch/tls.h (modified) (2 diffs)
-
ppc32/src/fibril.S (modified) (1 diff)
-
ppc32/src/rtld/dynamic.c (added)
-
ppc32/src/rtld/reloc.c (added)
-
ppc32/src/syscall.c (modified) (1 diff)
-
ppc32/src/tls.c (modified) (3 diffs)
-
riscv64/include/libarch/config.h (modified) (1 diff)
-
riscv64/include/libarch/ddi.h (modified) (1 diff)
-
riscv64/include/libarch/elf_linux.h (modified) (1 diff)
-
riscv64/include/libarch/faddr.h (modified) (1 diff)
-
riscv64/include/libarch/fibril.h (modified) (1 diff)
-
riscv64/include/libarch/fibril_context.h (modified) (3 diffs)
-
riscv64/include/libarch/syscall.h (modified) (1 diff)
-
riscv64/include/libarch/thread.h (modified) (1 diff)
-
riscv64/include/libarch/tls.h (modified) (1 diff)
-
riscv64/src/fibril.c (modified) (1 diff)
-
sparc64/Makefile.common (modified) (1 diff)
-
sparc64/Makefile.inc (modified) (1 diff)
-
sparc64/include/libarch/config.h (modified) (1 diff)
-
sparc64/include/libarch/ddi.h (modified) (1 diff)
-
sparc64/include/libarch/elf_linux.h (modified) (1 diff)
-
sparc64/include/libarch/faddr.h (modified) (1 diff)
-
sparc64/include/libarch/fibril.h (modified) (1 diff)
-
sparc64/include/libarch/fibril_context.h (modified) (3 diffs)
-
sparc64/include/libarch/rtld/dynamic.h (added)
-
sparc64/include/libarch/rtld/elf_dyn.h (added)
-
sparc64/include/libarch/rtld/module.h (added)
-
sparc64/include/libarch/stack.h (modified) (1 diff)
-
sparc64/include/libarch/stackarg.h (modified) (1 diff)
-
sparc64/include/libarch/syscall.h (modified) (1 diff)
-
sparc64/include/libarch/thread.h (modified) (1 diff)
-
sparc64/include/libarch/tls.h (modified) (2 diffs)
-
sparc64/src/fibril.S (modified) (2 diffs)
-
sparc64/src/rtld/dynamic.c (added)
-
sparc64/src/rtld/reloc.c (added)
-
sparc64/src/tls.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/abs32le/include/libarch/config.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_abs32le_CONFIG_H_36 #define LIBC_abs32le_CONFIG_H_35 #ifndef _LIBC_abs32le_CONFIG_H_ 36 #define _LIBC_abs32le_CONFIG_H_ 37 37 38 38 #define PAGE_WIDTH 12 -
uspace/lib/c/arch/abs32le/include/libarch/ddi.h
re3272101 rd5a89a3 30 30 */ 31 31 32 #ifndef LIBC_abs32le_DDI_H_33 #define LIBC_abs32le_DDI_H_32 #ifndef _LIBC_abs32le_DDI_H_ 33 #define _LIBC_abs32le_DDI_H_ 34 34 35 35 #include <ddi.h> -
uspace/lib/c/arch/abs32le/include/libarch/elf_linux.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_abs32le_ELF_LINUX_H_36 #define LIBC_abs32le_ELF_LINUX_H_35 #ifndef _LIBC_abs32le_ELF_LINUX_H_ 36 #define _LIBC_abs32le_ELF_LINUX_H_ 37 37 38 38 #include <libarch/istate.h> -
uspace/lib/c/arch/abs32le/include/libarch/faddr.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_abs32le_FADDR_H_36 #define LIBC_abs32le_FADDR_H_35 #ifndef _LIBC_abs32le_FADDR_H_ 36 #define _LIBC_abs32le_FADDR_H_ 37 37 38 38 #include <types/common.h> -
uspace/lib/c/arch/abs32le/include/libarch/fibril.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_abs32le_FIBRIL_H_36 #define LIBC_abs32le_FIBRIL_H_35 #ifndef _LIBC_abs32le_FIBRIL_H_ 36 #define _LIBC_abs32le_FIBRIL_H_ 37 37 38 38 #include <stdint.h> -
uspace/lib/c/arch/abs32le/include/libarch/fibril_context.h
re3272101 rd5a89a3 27 27 */ 28 28 29 #ifndef LIBC_abs32le_FIBRIL_CONTEXT_H_30 #define LIBC_abs32le_FIBRIL_CONTEXT_H_29 #ifndef _LIBC_abs32le_FIBRIL_CONTEXT_H_ 30 #define _LIBC_abs32le_FIBRIL_CONTEXT_H_ 31 31 32 32 #include <stdint.h> … … 36 36 * need to be preserved across function calls. 37 37 */ 38 typedef struct context {38 typedef struct __context { 39 39 uintptr_t sp; 40 40 uintptr_t fp; 41 41 uintptr_t pc; 42 42 uintptr_t tls; 43 } context_t;43 } __context_t; 44 44 45 45 #endif -
uspace/lib/c/arch/abs32le/include/libarch/syscall.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_abs32le_SYSCALL_H_37 #define LIBC_abs32le_SYSCALL_H_36 #ifndef _LIBC_abs32le_SYSCALL_H_ 37 #define _LIBC_abs32le_SYSCALL_H_ 38 38 39 39 #include <abi/syscall.h> -
uspace/lib/c/arch/abs32le/include/libarch/thread.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_abs32le_THREAD_H_36 #define LIBC_abs32le_THREAD_H_35 #ifndef _LIBC_abs32le_THREAD_H_ 36 #define _LIBC_abs32le_THREAD_H_ 37 37 38 38 #endif -
uspace/lib/c/arch/abs32le/include/libarch/tls.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_abs32le_TLS_H_36 #define LIBC_abs32le_TLS_H_35 #ifndef _LIBC_abs32le_TLS_H_ 36 #define _LIBC_abs32le_TLS_H_ 37 37 38 38 #define CONFIG_TLS_VARIANT_2 -
uspace/lib/c/arch/abs32le/src/fibril.c
re3272101 rd5a89a3 33 33 #include <stdbool.h> 34 34 35 int __ setjmp(context_t *ctx)35 int __context_save(__context_t *ctx) 36 36 { 37 37 return 0; 38 38 } 39 39 40 void __ longjmp(context_t *ctx, int val)40 void __context_restore(__context_t *ctx, int val) 41 41 { 42 42 while (true) -
uspace/lib/c/arch/amd64/Makefile.common
re3272101 rd5a89a3 28 28 29 29 # TODO: We need to implement DWARF unwinding and get rid of this flag. 30 COMMON_CFLAGS += -fno-omit-frame-pointer 30 COMMON_CFLAGS += -fno-omit-frame-pointer -Wl,-z,max-page-size=0x1000 31 31 32 32 # XXX: This architecture requires unoptimized TLS pointer access, -
uspace/lib/c/arch/amd64/include/libarch/config.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_amd64_CONFIG_H_36 #define LIBC_amd64_CONFIG_H_35 #ifndef _LIBC_amd64_CONFIG_H_ 36 #define _LIBC_amd64_CONFIG_H_ 37 37 38 38 #define PAGE_WIDTH 12 -
uspace/lib/c/arch/amd64/include/libarch/elf_linux.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_amd64_ELF_LINUX_H_36 #define LIBC_amd64_ELF_LINUX_H_35 #ifndef _LIBC_amd64_ELF_LINUX_H_ 36 #define _LIBC_amd64_ELF_LINUX_H_ 37 37 38 38 #include <libarch/istate.h> -
uspace/lib/c/arch/amd64/include/libarch/faddr.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_amd64_FADDR_H_36 #define LIBC_amd64_FADDR_H_35 #ifndef _LIBC_amd64_FADDR_H_ 36 #define _LIBC_amd64_FADDR_H_ 37 37 38 38 #include <types/common.h> -
uspace/lib/c/arch/amd64/include/libarch/fibril.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_amd64_FIBRIL_H_36 #define LIBC_amd64_FIBRIL_H_35 #ifndef _LIBC_amd64_FIBRIL_H_ 36 #define _LIBC_amd64_FIBRIL_H_ 37 37 38 38 #include <libarch/fibril_context.h> -
uspace/lib/c/arch/amd64/include/libarch/fibril_context.h
re3272101 rd5a89a3 27 27 */ 28 28 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_ 31 31 32 #define CONTEXT_OFFSET_SP 0x0033 #define CONTEXT_OFFSET_PC 0x0834 #define CONTEXT_OFFSET_RBX 0x1035 #define CONTEXT_OFFSET_RBP 0x1836 #define CONTEXT_OFFSET_R12 0x2037 #define CONTEXT_OFFSET_R13 0x2838 #define CONTEXT_OFFSET_R14 0x3039 #define CONTEXT_OFFSET_R15 0x3840 #define CONTEXT_OFFSET_TLS 0x4041 #define CONTEXT_SIZE 0x4832 #define __CONTEXT_OFFSET_SP 0x00 33 #define __CONTEXT_OFFSET_PC 0x08 34 #define __CONTEXT_OFFSET_RBX 0x10 35 #define __CONTEXT_OFFSET_RBP 0x18 36 #define __CONTEXT_OFFSET_R12 0x20 37 #define __CONTEXT_OFFSET_R13 0x28 38 #define __CONTEXT_OFFSET_R14 0x30 39 #define __CONTEXT_OFFSET_R15 0x38 40 #define __CONTEXT_OFFSET_TLS 0x40 41 #define __CONTEXT_SIZE 0x48 42 42 43 43 #ifndef __ASSEMBLER__ … … 45 45 #include <stdint.h> 46 46 47 typedef struct context {47 typedef struct __context { 48 48 /* 49 49 * We include only registers that must be preserved … … 59 59 uint64_t r15; 60 60 uint64_t tls; 61 } context_t;61 } __context_t; 62 62 63 63 #endif -
uspace/lib/c/arch/amd64/include/libarch/rtld/dynamic.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_amd64_RTLD_DYNAMIC_H_36 #define LIBC_amd64_RTLD_DYNAMIC_H_35 #ifndef _LIBC_amd64_RTLD_DYNAMIC_H_ 36 #define _LIBC_amd64_RTLD_DYNAMIC_H_ 37 37 38 38 typedef struct { -
uspace/lib/c/arch/amd64/include/libarch/rtld/elf_dyn.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_amd64_RTLD_ELF_DYN_H_36 #define LIBC_amd64_RTLD_ELF_DYN_H_35 #ifndef _LIBC_amd64_RTLD_ELF_DYN_H_ 36 #define _LIBC_amd64_RTLD_ELF_DYN_H_ 37 37 38 38 #define R_X86_64_64 1 -
uspace/lib/c/arch/amd64/include/libarch/stackarg.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_STACKARG_H_36 #define LIBC_STACKARG_H_35 #ifndef _LIBC_STACKARG_H_ 36 #define _LIBC_STACKARG_H_ 37 37 38 38 #endif -
uspace/lib/c/arch/amd64/include/libarch/syscall.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_amd64_SYSCALL_H_37 #define LIBC_amd64_SYSCALL_H_36 #ifndef _LIBC_amd64_SYSCALL_H_ 37 #define _LIBC_amd64_SYSCALL_H_ 38 38 39 39 #define LIBARCH_SYSCALL_GENERIC -
uspace/lib/c/arch/amd64/include/libarch/thread.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_amd64_THREAD_H_36 #define LIBC_amd64_THREAD_H_35 #ifndef _LIBC_amd64_THREAD_H_ 36 #define _LIBC_amd64_THREAD_H_ 37 37 38 38 #endif -
uspace/lib/c/arch/amd64/include/libarch/tls.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_amd64_TLS_H_36 #define LIBC_amd64_TLS_H_35 #ifndef _LIBC_amd64_TLS_H_ 36 #define _LIBC_amd64_TLS_H_ 37 37 38 38 #define CONFIG_TLS_VARIANT_2 -
uspace/lib/c/arch/amd64/src/fibril.S
re3272101 rd5a89a3 37 37 # pointed by the 1st argument. Returns 0 in RAX. 38 38 # 39 FUNCTION_BEGIN(__ setjmp)39 FUNCTION_BEGIN(__context_save) 40 40 movq (%rsp), %rdx # the caller's return %eip 41 41 42 42 # in %rdi is passed 1st argument 43 movq %rdx, CONTEXT_OFFSET_PC(%rdi)44 movq %rsp, CONTEXT_OFFSET_SP(%rdi)43 movq %rdx, __CONTEXT_OFFSET_PC(%rdi) 44 movq %rsp, __CONTEXT_OFFSET_SP(%rdi) 45 45 46 movq %rbx, CONTEXT_OFFSET_RBX(%rdi)47 movq %rbp, CONTEXT_OFFSET_RBP(%rdi)48 movq %r12, CONTEXT_OFFSET_R12(%rdi)49 movq %r13, CONTEXT_OFFSET_R13(%rdi)50 movq %r14, CONTEXT_OFFSET_R14(%rdi)51 movq %r15, CONTEXT_OFFSET_R15(%rdi)46 movq %rbx, __CONTEXT_OFFSET_RBX(%rdi) 47 movq %rbp, __CONTEXT_OFFSET_RBP(%rdi) 48 movq %r12, __CONTEXT_OFFSET_R12(%rdi) 49 movq %r13, __CONTEXT_OFFSET_R13(%rdi) 50 movq %r14, __CONTEXT_OFFSET_R14(%rdi) 51 movq %r15, __CONTEXT_OFFSET_R15(%rdi) 52 52 53 53 movq %fs:0, %rax 54 movq %rax, CONTEXT_OFFSET_TLS(%rdi)54 movq %rax, __CONTEXT_OFFSET_TLS(%rdi) 55 55 56 xorq %rax, %rax # __ setjmpreturns 056 xorq %rax, %rax # __context_save returns 0 57 57 ret 58 FUNCTION_END(__ setjmp)58 FUNCTION_END(__context_save) 59 59 60 60 ## Restore current CPU context … … 63 63 # pointed by the 1st argument. Returns second argument in RAX. 64 64 # 65 FUNCTION_BEGIN(__ longjmp)66 movq CONTEXT_OFFSET_R15(%rdi), %r1567 movq CONTEXT_OFFSET_R14(%rdi), %r1468 movq CONTEXT_OFFSET_R13(%rdi), %r1369 movq CONTEXT_OFFSET_R12(%rdi), %r1270 movq CONTEXT_OFFSET_RBP(%rdi), %rbp71 movq CONTEXT_OFFSET_RBX(%rdi), %rbx65 FUNCTION_BEGIN(__context_restore) 66 movq __CONTEXT_OFFSET_R15(%rdi), %r15 67 movq __CONTEXT_OFFSET_R14(%rdi), %r14 68 movq __CONTEXT_OFFSET_R13(%rdi), %r13 69 movq __CONTEXT_OFFSET_R12(%rdi), %r12 70 movq __CONTEXT_OFFSET_RBP(%rdi), %rbp 71 movq __CONTEXT_OFFSET_RBX(%rdi), %rbx 72 72 73 movq CONTEXT_OFFSET_SP(%rdi), %rsp # ctx->sp -> %rsp73 movq __CONTEXT_OFFSET_SP(%rdi), %rsp # ctx->sp -> %rsp 74 74 75 movq CONTEXT_OFFSET_PC(%rdi), %rdx75 movq __CONTEXT_OFFSET_PC(%rdi), %rdx 76 76 77 77 movq %rdx,(%rsp) 78 78 79 movq CONTEXT_OFFSET_TLS(%rdi), %rdi79 movq __CONTEXT_OFFSET_TLS(%rdi), %rdi 80 80 movq %rdi, %fs:0 81 81 82 movq %rsi, %rax # __ longjmpreturns second argument82 movq %rsi, %rax # __context_restore returns second argument 83 83 ret 84 FUNCTION_END(__ longjmp)84 FUNCTION_END(__context_restore) 85 85 -
uspace/lib/c/arch/amd64/src/rtld/dynamic.c
re3272101 rd5a89a3 27 27 */ 28 28 29 /** @addtogroup libc ia3229 /** @addtogroup libcamd64 30 30 * @brief 31 31 * @{ -
uspace/lib/c/arch/arm32/Makefile.common
re3272101 rd5a89a3 29 29 30 30 COMMON_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 32 32 33 33 LDFLAGS += -Wl,--gc-sections -
uspace/lib/c/arch/arm32/Makefile.inc
re3272101 rd5a89a3 37 37 arch/$(UARCH)/src/eabi.S \ 38 38 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 34 34 */ 35 35 36 #ifndef LIBC_arm32_CONFIG_H_37 #define LIBC_arm32_CONFIG_H_36 #ifndef _LIBC_arm32_CONFIG_H_ 37 #define _LIBC_arm32_CONFIG_H_ 38 38 39 39 #define PAGE_WIDTH 12 -
uspace/lib/c/arch/arm32/include/libarch/ddi.h
re3272101 rd5a89a3 31 31 */ 32 32 33 #ifndef LIBC_arm32_DDI_H_34 #define LIBC_arm32_DDI_H_33 #ifndef _LIBC_arm32_DDI_H_ 34 #define _LIBC_arm32_DDI_H_ 35 35 36 36 #include <ddi.h> -
uspace/lib/c/arch/arm32/include/libarch/elf_linux.h
re3272101 rd5a89a3 33 33 */ 34 34 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_ 37 37 38 38 #include <libarch/istate.h> -
uspace/lib/c/arch/arm32/include/libarch/faddr.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_arm32_FADDR_H_37 #define LIBC_arm32_FADDR_H_36 #ifndef _LIBC_arm32_FADDR_H_ 37 #define _LIBC_arm32_FADDR_H_ 38 38 39 39 #include <types/common.h> -
uspace/lib/c/arch/arm32/include/libarch/fibril.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_arm32_FIBRIL_H_37 #define LIBC_arm32_FIBRIL_H_36 #ifndef _LIBC_arm32_FIBRIL_H_ 37 #define _LIBC_arm32_FIBRIL_H_ 38 38 39 39 #include <types/common.h> -
uspace/lib/c/arch/arm32/include/libarch/fibril_context.h
re3272101 rd5a89a3 27 27 */ 28 28 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_ 31 31 32 32 #include <stdint.h> … … 41 41 // XXX: This struct must match the assembly code in src/fibril.S 42 42 43 typedef struct context {43 typedef struct __context { 44 44 uintptr_t sp; 45 45 uintptr_t pc; … … 54 54 /* r11 */ 55 55 uint32_t fp; 56 } context_t;56 } __context_t; 57 57 58 58 #endif -
uspace/lib/c/arch/arm32/include/libarch/rtld/dynamic.h
re3272101 rd5a89a3 1 1 /* 2 * Copyright (c) 201 8 Jaroslav Jindrak2 * Copyright (c) 2019 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 #ifndef LIBCPP_BITS_COMMON 30 #define LIBCPP_BITS_COMMON 29 /** @addtogroup libc 30 * @{ 31 */ 32 /** @file 33 */ 31 34 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_ 37 37 38 #undef NULL 39 #define NULL nullptr 38 typedef struct { 39 /* Empty. */ 40 } dyn_info_arch_t; 40 41 41 42 #endif 43 44 /** @} 45 */ -
uspace/lib/c/arch/arm32/include/libarch/stackarg.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_arm32_STACKARG_H_37 #define LIBC_arm32_STACKARG_H_36 #ifndef _LIBC_arm32_STACKARG_H_ 37 #define _LIBC_arm32_STACKARG_H_ 38 38 39 39 #endif -
uspace/lib/c/arch/arm32/include/libarch/syscall.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_arm32_SYSCALL_H_37 #define LIBC_arm32_SYSCALL_H_36 #ifndef _LIBC_arm32_SYSCALL_H_ 37 #define _LIBC_arm32_SYSCALL_H_ 38 38 39 39 #define LIBARCH_SYSCALL_GENERIC -
uspace/lib/c/arch/arm32/include/libarch/thread.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_arm32_THREAD_H_37 #define LIBC_arm32_THREAD_H_36 #ifndef _LIBC_arm32_THREAD_H_ 37 #define _LIBC_arm32_THREAD_H_ 38 38 39 39 #endif -
uspace/lib/c/arch/arm32/include/libarch/tls.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_arm32_TLS_H_37 #define LIBC_arm32_TLS_H_36 #ifndef _LIBC_arm32_TLS_H_ 37 #define _LIBC_arm32_TLS_H_ 38 38 39 39 #include <stdint.h> … … 49 49 */ 50 50 typedef struct { 51 void **dtv; 52 void *pad; 51 53 /** Fibril data. */ 52 54 void *fibril_data; -
uspace/lib/c/arch/arm32/src/atomic.c
re3272101 rd5a89a3 35 35 #include <stdbool.h> 36 36 37 externvolatile unsigned *ras_page;37 volatile unsigned *ras_page; 38 38 39 39 bool __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 56 56 57 57 .data 58 59 SYMBOL(ras_page)60 .long 0 -
uspace/lib/c/arch/arm32/src/fibril.S
re3272101 rd5a89a3 31 31 .text 32 32 33 FUNCTION_BEGIN(__ setjmp)33 FUNCTION_BEGIN(__context_save) 34 34 stmia r0!, {sp, lr} 35 35 stmia r0!, {r4-r11} … … 38 38 mov r0, #0 39 39 mov pc, lr 40 FUNCTION_END(__ setjmp)40 FUNCTION_END(__context_save) 41 41 42 FUNCTION_BEGIN(__ longjmp)42 FUNCTION_BEGIN(__context_restore) 43 43 ldmia r0!, {sp, lr} 44 44 ldmia r0!, {r4-r11} … … 47 47 mov r0, r1 48 48 mov pc, lr 49 FUNCTION_END(__ longjmp)49 FUNCTION_END(__context_restore) 50 50 -
uspace/lib/c/arch/arm32/src/syscall.c
re3272101 rd5a89a3 70 70 "r" (__arm_reg_r5), 71 71 "r" (__arm_reg_r6) 72 : 73 /* 74 * Clobber memory too as some arguments might be 75 * actually pointers. 76 */ 77 "memory" 72 78 ); 73 79 -
uspace/lib/c/arch/arm32/src/tls.c
re3272101 rd5a89a3 1 1 /* 2 * Copyright (c) 2019 Jiri Svoboda 2 3 * Copyright (c) 2007 Pavel Jancik 3 4 * All rights reserved. … … 38 39 #include <stddef.h> 39 40 41 #ifdef CONFIG_RTLD 42 #include <rtld/rtld.h> 43 #endif 44 40 45 tcb_t *tls_alloc_arch(size_t size, size_t align) 41 46 { … … 48 53 } 49 54 55 /* 56 * Rtld TLS support 57 */ 58 59 typedef struct { 60 unsigned long int ti_module; 61 unsigned long int ti_offset; 62 } tls_index; 63 64 int __tls_debug = 0; 65 66 void *__tls_get_addr(tls_index *ti); 67 68 void *__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 50 83 /** @} 51 84 */ -
uspace/lib/c/arch/ia32/include/libarch/config.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia32_CONFIG_H_36 #define LIBC_ia32_CONFIG_H_35 #ifndef _LIBC_ia32_CONFIG_H_ 36 #define _LIBC_ia32_CONFIG_H_ 37 37 38 38 #define PAGE_WIDTH 12 -
uspace/lib/c/arch/ia32/include/libarch/ddi.h
re3272101 rd5a89a3 31 31 */ 32 32 33 #ifndef LIBC_ia32_DDI_H_34 #define LIBC_ia32_DDI_H_33 #ifndef _LIBC_ia32_DDI_H_ 34 #define _LIBC_ia32_DDI_H_ 35 35 36 36 #include <ddi.h> -
uspace/lib/c/arch/ia32/include/libarch/elf_linux.h
re3272101 rd5a89a3 33 33 */ 34 34 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_ 37 37 38 38 #include <libarch/istate.h> -
uspace/lib/c/arch/ia32/include/libarch/faddr.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia32_FADDR_H_36 #define LIBC_ia32_FADDR_H_35 #ifndef _LIBC_ia32_FADDR_H_ 36 #define _LIBC_ia32_FADDR_H_ 37 37 38 38 #include <types/common.h> -
uspace/lib/c/arch/ia32/include/libarch/fibril.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia32_FIBRIL_H_36 #define LIBC_ia32_FIBRIL_H_35 #ifndef _LIBC_ia32_FIBRIL_H_ 36 #define _LIBC_ia32_FIBRIL_H_ 37 37 38 38 #include <types/common.h> -
uspace/lib/c/arch/ia32/include/libarch/fibril_context.h
re3272101 rd5a89a3 27 27 */ 28 28 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_ 31 31 32 #define CONTEXT_OFFSET_SP 0x0033 #define CONTEXT_OFFSET_PC 0x0434 #define CONTEXT_OFFSET_EBX 0x0835 #define CONTEXT_OFFSET_ESI 0x0c36 #define CONTEXT_OFFSET_EDI 0x1037 #define CONTEXT_OFFSET_EBP 0x1438 #define CONTEXT_OFFSET_TLS 0x1839 #define CONTEXT_SIZE 0x1c32 #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 40 40 41 41 #ifndef __ASSEMBLER__ … … 44 44 45 45 /* We include only registers that must be preserved during function call. */ 46 typedef struct context {46 typedef struct __context { 47 47 uint32_t sp; 48 48 uint32_t pc; … … 52 52 uint32_t ebp; 53 53 uint32_t tls; 54 } context_t;54 } __context_t; 55 55 56 56 #endif -
uspace/lib/c/arch/ia32/include/libarch/rtld/dynamic.h
re3272101 rd5a89a3 33 33 */ 34 34 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_ 37 37 38 38 typedef struct { -
uspace/lib/c/arch/ia32/include/libarch/rtld/elf_dyn.h
re3272101 rd5a89a3 33 33 */ 34 34 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_ 37 37 38 38 /* -
uspace/lib/c/arch/ia32/include/libarch/syscall.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_ia32_SYSCALL_H_37 #define LIBC_ia32_SYSCALL_H_36 #ifndef _LIBC_ia32_SYSCALL_H_ 37 #define _LIBC_ia32_SYSCALL_H_ 38 38 39 39 #include <abi/syscall.h> -
uspace/lib/c/arch/ia32/include/libarch/thread.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia32_THREAD_H_36 #define LIBC_ia32_THREAD_H_35 #ifndef _LIBC_ia32_THREAD_H_ 36 #define _LIBC_ia32_THREAD_H_ 37 37 38 38 #endif -
uspace/lib/c/arch/ia32/include/libarch/tls.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia32_TLS_H_36 #define LIBC_ia32_TLS_H_35 #ifndef _LIBC_ia32_TLS_H_ 36 #define _LIBC_ia32_TLS_H_ 37 37 38 38 #define CONFIG_TLS_VARIANT_2 -
uspace/lib/c/arch/ia32/src/fibril.S
re3272101 rd5a89a3 37 37 # pointed by the 1st argument. Returns 0 in EAX. 38 38 # 39 FUNCTION_BEGIN(__ setjmp)39 FUNCTION_BEGIN(__context_save) 40 40 movl 0(%esp), %eax # the caller's return %eip 41 41 movl 4(%esp), %edx # address of the context variable to save context to 42 42 43 43 # save registers to the context structure 44 movl %esp, CONTEXT_OFFSET_SP(%edx) # %esp -> ctx->sp45 movl %eax, CONTEXT_OFFSET_PC(%edx) # %eip -> ctx->pc46 movl %ebx, CONTEXT_OFFSET_EBX(%edx) # %ebx -> ctx->ebx47 movl %esi, CONTEXT_OFFSET_ESI(%edx) # %esi -> ctx->esi48 movl %edi, CONTEXT_OFFSET_EDI(%edx) # %edi -> ctx->edi49 movl %ebp, CONTEXT_OFFSET_EBP(%edx) # %ebp -> ctx->ebp44 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 50 50 51 51 # save TLS 52 52 movl %gs:0, %eax 53 movl %eax, CONTEXT_OFFSET_TLS(%edx) # tls -> ctx->tls53 movl %eax, __CONTEXT_OFFSET_TLS(%edx) # tls -> ctx->tls 54 54 55 xorl %eax, %eax # __ setjmpreturns 055 xorl %eax, %eax # __context_save returns 0 56 56 ret 57 FUNCTION_END(__ setjmp)57 FUNCTION_END(__context_save) 58 58 59 59 ## Restore saved CPU context … … 62 62 # pointed by the 1st argument. Returns second argument in EAX. 63 63 # 64 FUNCTION_BEGIN(__ longjmp)64 FUNCTION_BEGIN(__context_restore) 65 65 movl 4(%esp), %eax # address of the context variable to restore context from 66 66 movl 8(%esp), %ecx # return value 67 67 68 68 # restore registers from the context structure 69 movl CONTEXT_OFFSET_SP(%eax),%esp # ctx->sp -> %esp70 movl CONTEXT_OFFSET_PC(%eax),%edx # ctx->pc -> \pc71 movl CONTEXT_OFFSET_EBX(%eax),%ebx # ctx->ebx -> %ebx72 movl CONTEXT_OFFSET_ESI(%eax),%esi # ctx->esi -> %esi73 movl CONTEXT_OFFSET_EDI(%eax),%edi # ctx->edi -> %edi74 movl CONTEXT_OFFSET_EBP(%eax),%ebp # ctx->ebp -> %ebp69 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 75 75 76 76 movl %edx, 0(%esp) # ctx->pc -> saver's return %eip 77 77 78 78 # set thread local storage 79 movl CONTEXT_OFFSET_TLS(%eax), %edx # Set arg1 to TLS addr79 movl __CONTEXT_OFFSET_TLS(%eax), %edx # Set arg1 to TLS addr 80 80 movl %edx, %gs:0 81 81 82 82 movl %ecx, %eax 83 83 ret 84 FUNCTION_END(__ longjmp)84 FUNCTION_END(__context_restore) 85 85 -
uspace/lib/c/arch/ia64/include/libarch/config.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia64_CONFIG_H_36 #define LIBC_ia64_CONFIG_H_35 #ifndef _LIBC_ia64_CONFIG_H_ 36 #define _LIBC_ia64_CONFIG_H_ 37 37 38 38 #define PAGE_WIDTH 14 -
uspace/lib/c/arch/ia64/include/libarch/ddi.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia64_DDI_H_36 #define LIBC_ia64_DDI_H_35 #ifndef _LIBC_ia64_DDI_H_ 36 #define _LIBC_ia64_DDI_H_ 37 37 38 38 #include <ddi.h> -
uspace/lib/c/arch/ia64/include/libarch/elf_linux.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia64_ELF_LINUX_H_36 #define LIBC_ia64_ELF_LINUX_H_35 #ifndef _LIBC_ia64_ELF_LINUX_H_ 36 #define _LIBC_ia64_ELF_LINUX_H_ 37 37 38 38 #include <libarch/istate.h> -
uspace/lib/c/arch/ia64/include/libarch/faddr.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia64_FADDR_H_36 #define LIBC_ia64_FADDR_H_35 #ifndef _LIBC_ia64_FADDR_H_ 36 #define _LIBC_ia64_FADDR_H_ 37 37 38 38 #include <types/common.h> -
uspace/lib/c/arch/ia64/include/libarch/fibril.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia64_FIBRIL_H_36 #define LIBC_ia64_FIBRIL_H_35 #ifndef _LIBC_ia64_FIBRIL_H_ 36 #define _LIBC_ia64_FIBRIL_H_ 37 37 38 38 #include <stdint.h> … … 43 43 44 44 /* 45 * __ setjmp() and __longjmp() are both leaf procedures.45 * __context_save() and __context_restore() are both leaf procedures. 46 46 * No need to allocate scratch area. 47 47 */ -
uspace/lib/c/arch/ia64/include/libarch/fibril_context.h
re3272101 rd5a89a3 27 27 */ 28 28 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_ 31 31 32 #define CONTEXT_OFFSET_AR_PFS 0x00033 #define CONTEXT_OFFSET_AR_UNAT_CALLER 0x00834 #define CONTEXT_OFFSET_AR_UNAT_CALLEE 0x01035 #define CONTEXT_OFFSET_AR_RSC 0x01836 #define CONTEXT_OFFSET_BSP 0x02037 #define CONTEXT_OFFSET_AR_RNAT 0x02838 #define CONTEXT_OFFSET_AR_LC 0x03039 #define CONTEXT_OFFSET_R1 0x03840 #define CONTEXT_OFFSET_R4 0x04041 #define CONTEXT_OFFSET_R5 0x04842 #define CONTEXT_OFFSET_R6 0x05043 #define CONTEXT_OFFSET_R7 0x05844 #define CONTEXT_OFFSET_SP 0x06045 #define CONTEXT_OFFSET_TP 0x06846 #define CONTEXT_OFFSET_PC 0x07047 #define CONTEXT_OFFSET_B1 0x07848 #define CONTEXT_OFFSET_B2 0x08049 #define CONTEXT_OFFSET_B3 0x08850 #define CONTEXT_OFFSET_B4 0x09051 #define CONTEXT_OFFSET_B5 0x09852 #define CONTEXT_OFFSET_PR 0x0a053 #define CONTEXT_OFFSET_F2 0x0b054 #define CONTEXT_OFFSET_F3 0x0c055 #define CONTEXT_OFFSET_F4 0x0d056 #define CONTEXT_OFFSET_F5 0x0e057 #define CONTEXT_OFFSET_F16 0x0f058 #define CONTEXT_OFFSET_F17 0x10059 #define CONTEXT_OFFSET_F18 0x11060 #define CONTEXT_OFFSET_F19 0x12061 #define CONTEXT_OFFSET_F20 0x13062 #define CONTEXT_OFFSET_F21 0x14063 #define CONTEXT_OFFSET_F22 0x15064 #define CONTEXT_OFFSET_F23 0x16065 #define CONTEXT_OFFSET_F24 0x17066 #define CONTEXT_OFFSET_F25 0x18067 #define CONTEXT_OFFSET_F26 0x19068 #define CONTEXT_OFFSET_F27 0x1a069 #define CONTEXT_OFFSET_F28 0x1b070 #define CONTEXT_OFFSET_F29 0x1c071 #define CONTEXT_OFFSET_F30 0x1d072 #define CONTEXT_OFFSET_F31 0x1e073 #define CONTEXT_SIZE 0x1f032 #define __CONTEXT_OFFSET_AR_PFS 0x000 33 #define __CONTEXT_OFFSET_AR_UNAT_CALLER 0x008 34 #define __CONTEXT_OFFSET_AR_UNAT_CALLEE 0x010 35 #define __CONTEXT_OFFSET_AR_RSC 0x018 36 #define __CONTEXT_OFFSET_BSP 0x020 37 #define __CONTEXT_OFFSET_AR_RNAT 0x028 38 #define __CONTEXT_OFFSET_AR_LC 0x030 39 #define __CONTEXT_OFFSET_R1 0x038 40 #define __CONTEXT_OFFSET_R4 0x040 41 #define __CONTEXT_OFFSET_R5 0x048 42 #define __CONTEXT_OFFSET_R6 0x050 43 #define __CONTEXT_OFFSET_R7 0x058 44 #define __CONTEXT_OFFSET_SP 0x060 45 #define __CONTEXT_OFFSET_TP 0x068 46 #define __CONTEXT_OFFSET_PC 0x070 47 #define __CONTEXT_OFFSET_B1 0x078 48 #define __CONTEXT_OFFSET_B2 0x080 49 #define __CONTEXT_OFFSET_B3 0x088 50 #define __CONTEXT_OFFSET_B4 0x090 51 #define __CONTEXT_OFFSET_B5 0x098 52 #define __CONTEXT_OFFSET_PR 0x0a0 53 #define __CONTEXT_OFFSET_F2 0x0b0 54 #define __CONTEXT_OFFSET_F3 0x0c0 55 #define __CONTEXT_OFFSET_F4 0x0d0 56 #define __CONTEXT_OFFSET_F5 0x0e0 57 #define __CONTEXT_OFFSET_F16 0x0f0 58 #define __CONTEXT_OFFSET_F17 0x100 59 #define __CONTEXT_OFFSET_F18 0x110 60 #define __CONTEXT_OFFSET_F19 0x120 61 #define __CONTEXT_OFFSET_F20 0x130 62 #define __CONTEXT_OFFSET_F21 0x140 63 #define __CONTEXT_OFFSET_F22 0x150 64 #define __CONTEXT_OFFSET_F23 0x160 65 #define __CONTEXT_OFFSET_F24 0x170 66 #define __CONTEXT_OFFSET_F25 0x180 67 #define __CONTEXT_OFFSET_F26 0x190 68 #define __CONTEXT_OFFSET_F27 0x1a0 69 #define __CONTEXT_OFFSET_F28 0x1b0 70 #define __CONTEXT_OFFSET_F29 0x1c0 71 #define __CONTEXT_OFFSET_F30 0x1d0 72 #define __CONTEXT_OFFSET_F31 0x1e0 73 #define __CONTEXT_SIZE 0x1f0 74 74 75 75 #ifndef __ASSEMBLER__ … … 79 79 80 80 // Only save registers that must be preserved across function calls. 81 typedef struct context {81 typedef struct __context { 82 82 // Application registers. 83 83 uint64_t ar_pfs; … … 132 132 uint128_t f30; 133 133 uint128_t f31; 134 } context_t;134 } __context_t; 135 135 136 136 #endif /* __ASSEMBLER__ */ -
uspace/lib/c/arch/ia64/include/libarch/stack.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia64_STACK_H_36 #define LIBC_ia64_STACK_H_35 #ifndef _LIBC_ia64_STACK_H_ 36 #define _LIBC_ia64_STACK_H_ 37 37 38 38 #define STACK_ITEM_SIZE 8 -
uspace/lib/c/arch/ia64/include/libarch/stackarg.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_STACKARG_H_36 #define LIBC_STACKARG_H_35 #ifndef _LIBC_STACKARG_H_ 36 #define _LIBC_STACKARG_H_ 37 37 38 38 #endif -
uspace/lib/c/arch/ia64/include/libarch/syscall.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_ia64_SYSCALL_H_37 #define LIBC_ia64_SYSCALL_H_36 #ifndef _LIBC_ia64_SYSCALL_H_ 37 #define _LIBC_ia64_SYSCALL_H_ 38 38 39 39 #define LIBARCH_SYSCALL_GENERIC -
uspace/lib/c/arch/ia64/include/libarch/thread.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia64_THREAD_H_36 #define LIBC_ia64_THREAD_H_35 #ifndef _LIBC_ia64_THREAD_H_ 36 #define _LIBC_ia64_THREAD_H_ 37 37 38 38 #endif -
uspace/lib/c/arch/ia64/include/libarch/tls.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ia64_TLS_H_36 #define LIBC_ia64_TLS_H_35 #ifndef _LIBC_ia64_TLS_H_ 36 #define _LIBC_ia64_TLS_H_ 37 37 38 38 #define CONFIG_TLS_VARIANT_1 -
uspace/lib/c/arch/ia64/src/fibril.S
re3272101 rd5a89a3 32 32 .text 33 33 34 FUNCTION_BEGIN(__ setjmp)34 FUNCTION_BEGIN(__context_save) 35 35 alloc loc0 = ar.pfs, 1, 49, 0, 0 36 36 mov loc1 = ar.unat ;; … … 58 58 mov loc6 = ar.lc 59 59 60 add loc8 = CONTEXT_OFFSET_AR_PFS, in061 add loc9 = CONTEXT_OFFSET_AR_UNAT_CALLER, in062 add loc10 = CONTEXT_OFFSET_AR_UNAT_CALLEE, in063 add loc11 = CONTEXT_OFFSET_AR_RSC, in064 add loc12 = CONTEXT_OFFSET_BSP, in065 add loc13 = CONTEXT_OFFSET_AR_RNAT, in066 add loc14 = CONTEXT_OFFSET_AR_LC, in067 68 add loc15 = CONTEXT_OFFSET_R1, in069 add loc16 = CONTEXT_OFFSET_R4, in070 add loc17 = CONTEXT_OFFSET_R5, in071 add loc18 = CONTEXT_OFFSET_R6, in072 add loc19 = CONTEXT_OFFSET_R7, in073 add loc20 = CONTEXT_OFFSET_SP, in074 add loc21 = CONTEXT_OFFSET_TP, in075 76 add loc22 = CONTEXT_OFFSET_PC, in077 add loc23 = CONTEXT_OFFSET_B1, in078 add loc24 = CONTEXT_OFFSET_B2, in079 add loc25 = CONTEXT_OFFSET_B3, in080 add loc26 = CONTEXT_OFFSET_B4, in081 add loc27 = CONTEXT_OFFSET_B5, in082 83 add loc28 = CONTEXT_OFFSET_PR, in084 85 add loc29 = CONTEXT_OFFSET_F2, in086 add loc30 = CONTEXT_OFFSET_F3, in087 add loc31 = CONTEXT_OFFSET_F4, in088 add loc32 = CONTEXT_OFFSET_F5, in089 90 add loc33 = CONTEXT_OFFSET_F16, in091 add loc34 = CONTEXT_OFFSET_F17, in092 add loc35 = CONTEXT_OFFSET_F18, in093 add loc36 = CONTEXT_OFFSET_F19, in094 add loc37 = CONTEXT_OFFSET_F20, in095 add loc38 = CONTEXT_OFFSET_F21, in096 add loc39 = CONTEXT_OFFSET_F22, in097 add loc40 = CONTEXT_OFFSET_F23, in098 add loc41 = CONTEXT_OFFSET_F24, in099 add loc42 = CONTEXT_OFFSET_F25, in0100 add loc43 = CONTEXT_OFFSET_F26, in0101 add loc44 = CONTEXT_OFFSET_F27, in0102 add loc45 = CONTEXT_OFFSET_F28, in0103 add loc46 = CONTEXT_OFFSET_F29, in0104 add loc47 = CONTEXT_OFFSET_F30, in0105 add loc48 = CONTEXT_OFFSET_F31, in0 ;;60 add loc8 = __CONTEXT_OFFSET_AR_PFS, in0 61 add loc9 = __CONTEXT_OFFSET_AR_UNAT_CALLER, in0 62 add loc10 = __CONTEXT_OFFSET_AR_UNAT_CALLEE, in0 63 add loc11 = __CONTEXT_OFFSET_AR_RSC, in0 64 add loc12 = __CONTEXT_OFFSET_BSP, in0 65 add loc13 = __CONTEXT_OFFSET_AR_RNAT, in0 66 add loc14 = __CONTEXT_OFFSET_AR_LC, in0 67 68 add loc15 = __CONTEXT_OFFSET_R1, in0 69 add loc16 = __CONTEXT_OFFSET_R4, in0 70 add loc17 = __CONTEXT_OFFSET_R5, in0 71 add loc18 = __CONTEXT_OFFSET_R6, in0 72 add loc19 = __CONTEXT_OFFSET_R7, in0 73 add loc20 = __CONTEXT_OFFSET_SP, in0 74 add loc21 = __CONTEXT_OFFSET_TP, in0 75 76 add loc22 = __CONTEXT_OFFSET_PC, in0 77 add loc23 = __CONTEXT_OFFSET_B1, in0 78 add loc24 = __CONTEXT_OFFSET_B2, in0 79 add loc25 = __CONTEXT_OFFSET_B3, in0 80 add loc26 = __CONTEXT_OFFSET_B4, in0 81 add loc27 = __CONTEXT_OFFSET_B5, in0 82 83 add loc28 = __CONTEXT_OFFSET_PR, in0 84 85 add loc29 = __CONTEXT_OFFSET_F2, in0 86 add loc30 = __CONTEXT_OFFSET_F3, in0 87 add loc31 = __CONTEXT_OFFSET_F4, in0 88 add loc32 = __CONTEXT_OFFSET_F5, in0 89 90 add loc33 = __CONTEXT_OFFSET_F16, in0 91 add loc34 = __CONTEXT_OFFSET_F17, in0 92 add loc35 = __CONTEXT_OFFSET_F18, in0 93 add loc36 = __CONTEXT_OFFSET_F19, in0 94 add loc37 = __CONTEXT_OFFSET_F20, in0 95 add loc38 = __CONTEXT_OFFSET_F21, in0 96 add loc39 = __CONTEXT_OFFSET_F22, in0 97 add loc40 = __CONTEXT_OFFSET_F23, in0 98 add loc41 = __CONTEXT_OFFSET_F24, in0 99 add loc42 = __CONTEXT_OFFSET_F25, in0 100 add loc43 = __CONTEXT_OFFSET_F26, in0 101 add loc44 = __CONTEXT_OFFSET_F27, in0 102 add loc45 = __CONTEXT_OFFSET_F28, in0 103 add loc46 = __CONTEXT_OFFSET_F29, in0 104 add loc47 = __CONTEXT_OFFSET_F30, in0 105 add loc48 = __CONTEXT_OFFSET_F31, in0 ;; 106 106 107 107 /* … … 178 178 mov ar.unat = loc1 179 179 180 mov r8 = 0 /* __ setjmpreturns 0 */180 mov r8 = 0 /* __context_save returns 0 */ 181 181 br.ret.sptk.many b0 182 FUNCTION_END(__ setjmp)183 184 FUNCTION_BEGIN(__ longjmp)182 FUNCTION_END(__context_save) 183 184 FUNCTION_BEGIN(__context_restore) 185 185 alloc loc0 = ar.pfs, 2, 50, 0, 0 ;; 186 186 187 add loc9 = CONTEXT_OFFSET_AR_PFS, in0188 add loc10 = CONTEXT_OFFSET_AR_UNAT_CALLER, in0189 add loc11 = CONTEXT_OFFSET_AR_UNAT_CALLEE, in0190 add loc12 = CONTEXT_OFFSET_AR_RSC, in0191 add loc13 = CONTEXT_OFFSET_BSP, in0192 add loc14 = CONTEXT_OFFSET_AR_RNAT, in0193 add loc15 = CONTEXT_OFFSET_AR_LC, in0194 195 add loc16 = CONTEXT_OFFSET_R1, in0196 add loc17 = CONTEXT_OFFSET_R4, in0197 add loc18 = CONTEXT_OFFSET_R5, in0198 add loc19 = CONTEXT_OFFSET_R6, in0199 add loc20 = CONTEXT_OFFSET_R7, in0200 add loc21 = CONTEXT_OFFSET_SP, in0201 add loc22 = CONTEXT_OFFSET_TP, in0202 203 add loc23 = CONTEXT_OFFSET_PC, in0204 add loc24 = CONTEXT_OFFSET_B1, in0205 add loc25 = CONTEXT_OFFSET_B2, in0206 add loc26 = CONTEXT_OFFSET_B3, in0207 add loc27 = CONTEXT_OFFSET_B4, in0208 add loc28 = CONTEXT_OFFSET_B5, in0209 210 add loc29 = CONTEXT_OFFSET_PR, in0211 212 add loc30 = CONTEXT_OFFSET_F2, in0213 add loc31 = CONTEXT_OFFSET_F3, in0214 add loc32 = CONTEXT_OFFSET_F4, in0215 add loc33 = CONTEXT_OFFSET_F5, in0216 217 add loc34 = CONTEXT_OFFSET_F16, in0218 add loc35 = CONTEXT_OFFSET_F17, in0219 add loc36 = CONTEXT_OFFSET_F18, in0220 add loc37 = CONTEXT_OFFSET_F19, in0221 add loc38 = CONTEXT_OFFSET_F20, in0222 add loc39 = CONTEXT_OFFSET_F21, in0223 add loc40 = CONTEXT_OFFSET_F22, in0224 add loc41 = CONTEXT_OFFSET_F23, in0225 add loc42 = CONTEXT_OFFSET_F24, in0226 add loc43 = CONTEXT_OFFSET_F25, in0227 add loc44 = CONTEXT_OFFSET_F26, in0228 add loc45 = CONTEXT_OFFSET_F27, in0229 add loc46 = CONTEXT_OFFSET_F28, in0230 add loc47 = CONTEXT_OFFSET_F29, in0231 add loc48 = CONTEXT_OFFSET_F30, in0232 add loc49 = CONTEXT_OFFSET_F31, in0 ;;187 add loc9 = __CONTEXT_OFFSET_AR_PFS, in0 188 add loc10 = __CONTEXT_OFFSET_AR_UNAT_CALLER, in0 189 add loc11 = __CONTEXT_OFFSET_AR_UNAT_CALLEE, in0 190 add loc12 = __CONTEXT_OFFSET_AR_RSC, in0 191 add loc13 = __CONTEXT_OFFSET_BSP, in0 192 add loc14 = __CONTEXT_OFFSET_AR_RNAT, in0 193 add loc15 = __CONTEXT_OFFSET_AR_LC, in0 194 195 add loc16 = __CONTEXT_OFFSET_R1, in0 196 add loc17 = __CONTEXT_OFFSET_R4, in0 197 add loc18 = __CONTEXT_OFFSET_R5, in0 198 add loc19 = __CONTEXT_OFFSET_R6, in0 199 add loc20 = __CONTEXT_OFFSET_R7, in0 200 add loc21 = __CONTEXT_OFFSET_SP, in0 201 add loc22 = __CONTEXT_OFFSET_TP, in0 202 203 add loc23 = __CONTEXT_OFFSET_PC, in0 204 add loc24 = __CONTEXT_OFFSET_B1, in0 205 add loc25 = __CONTEXT_OFFSET_B2, in0 206 add loc26 = __CONTEXT_OFFSET_B3, in0 207 add loc27 = __CONTEXT_OFFSET_B4, in0 208 add loc28 = __CONTEXT_OFFSET_B5, in0 209 210 add loc29 = __CONTEXT_OFFSET_PR, in0 211 212 add loc30 = __CONTEXT_OFFSET_F2, in0 213 add loc31 = __CONTEXT_OFFSET_F3, in0 214 add loc32 = __CONTEXT_OFFSET_F4, in0 215 add loc33 = __CONTEXT_OFFSET_F5, in0 216 217 add loc34 = __CONTEXT_OFFSET_F16, in0 218 add loc35 = __CONTEXT_OFFSET_F17, in0 219 add loc36 = __CONTEXT_OFFSET_F18, in0 220 add loc37 = __CONTEXT_OFFSET_F19, in0 221 add loc38 = __CONTEXT_OFFSET_F20, in0 222 add loc39 = __CONTEXT_OFFSET_F21, in0 223 add loc40 = __CONTEXT_OFFSET_F22, in0 224 add loc41 = __CONTEXT_OFFSET_F23, in0 225 add loc42 = __CONTEXT_OFFSET_F24, in0 226 add loc43 = __CONTEXT_OFFSET_F25, in0 227 add loc44 = __CONTEXT_OFFSET_F26, in0 228 add loc45 = __CONTEXT_OFFSET_F27, in0 229 add loc46 = __CONTEXT_OFFSET_F28, in0 230 add loc47 = __CONTEXT_OFFSET_F29, in0 231 add loc48 = __CONTEXT_OFFSET_F30, in0 232 add loc49 = __CONTEXT_OFFSET_F31, in0 ;; 233 233 234 234 ld8 loc0 = [loc9] /* load ar.pfs */ … … 335 335 mov ar.unat = loc1 336 336 337 mov r8 = in1 /* __ longjmpreturns second argument */337 mov r8 = in1 /* __context_restore returns second argument */ 338 338 br.ret.sptk.many b0 339 FUNCTION_END(__ longjmp)339 FUNCTION_END(__context_restore) -
uspace/lib/c/arch/mips32/include/libarch/config.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_mips32_CONFIG_H_36 #define LIBC_mips32_CONFIG_H_35 #ifndef _LIBC_mips32_CONFIG_H_ 36 #define _LIBC_mips32_CONFIG_H_ 37 37 38 38 #define PAGE_WIDTH 14 -
uspace/lib/c/arch/mips32/include/libarch/ddi.h
re3272101 rd5a89a3 31 31 */ 32 32 33 #ifndef LIBC_mips32_DDI_H_34 #define LIBC_mips32_DDI_H_33 #ifndef _LIBC_mips32_DDI_H_ 34 #define _LIBC_mips32_DDI_H_ 35 35 36 36 #include <ddi.h> -
uspace/lib/c/arch/mips32/include/libarch/elf_linux.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_mips32_ELF_LINUX_H_36 #define LIBC_mips32_ELF_LINUX_H_35 #ifndef _LIBC_mips32_ELF_LINUX_H_ 36 #define _LIBC_mips32_ELF_LINUX_H_ 37 37 38 38 #include <libarch/istate.h> -
uspace/lib/c/arch/mips32/include/libarch/faddr.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_mips32_FADDR_H_36 #define LIBC_mips32_FADDR_H_35 #ifndef _LIBC_mips32_FADDR_H_ 36 #define _LIBC_mips32_FADDR_H_ 37 37 38 38 #include <types/common.h> -
uspace/lib/c/arch/mips32/include/libarch/fibril.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_mips32_FIBRIL_H_37 #define LIBC_mips32_FIBRIL_H_36 #ifndef _LIBC_mips32_FIBRIL_H_ 37 #define _LIBC_mips32_FIBRIL_H_ 38 38 39 39 #include <stdint.h> -
uspace/lib/c/arch/mips32/include/libarch/fibril_context.h
re3272101 rd5a89a3 27 27 */ 28 28 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_ 31 31 32 #define CONTEXT_OFFSET_SP 0x0033 #define CONTEXT_OFFSET_PC 0x0434 #define CONTEXT_OFFSET_S0 0x0835 #define CONTEXT_OFFSET_S1 0x0c36 #define CONTEXT_OFFSET_S2 0x1037 #define CONTEXT_OFFSET_S3 0x1438 #define CONTEXT_OFFSET_S4 0x1839 #define CONTEXT_OFFSET_S5 0x1c40 #define CONTEXT_OFFSET_S6 0x2041 #define CONTEXT_OFFSET_S7 0x2442 #define CONTEXT_OFFSET_S8 0x2843 #define CONTEXT_OFFSET_GP 0x2c44 #define CONTEXT_OFFSET_TLS 0x3045 #define CONTEXT_OFFSET_F20 0x3446 #define CONTEXT_OFFSET_F21 0x3847 #define CONTEXT_OFFSET_F22 0x3c48 #define CONTEXT_OFFSET_F23 0x4049 #define CONTEXT_OFFSET_F24 0x4450 #define CONTEXT_OFFSET_F25 0x4851 #define CONTEXT_OFFSET_F26 0x4c52 #define CONTEXT_OFFSET_F27 0x5053 #define CONTEXT_OFFSET_F28 0x5454 #define CONTEXT_OFFSET_F29 0x5855 #define CONTEXT_OFFSET_F30 0x5c56 #define CONTEXT_SIZE 0x6032 #define __CONTEXT_OFFSET_SP 0x00 33 #define __CONTEXT_OFFSET_PC 0x04 34 #define __CONTEXT_OFFSET_S0 0x08 35 #define __CONTEXT_OFFSET_S1 0x0c 36 #define __CONTEXT_OFFSET_S2 0x10 37 #define __CONTEXT_OFFSET_S3 0x14 38 #define __CONTEXT_OFFSET_S4 0x18 39 #define __CONTEXT_OFFSET_S5 0x1c 40 #define __CONTEXT_OFFSET_S6 0x20 41 #define __CONTEXT_OFFSET_S7 0x24 42 #define __CONTEXT_OFFSET_S8 0x28 43 #define __CONTEXT_OFFSET_GP 0x2c 44 #define __CONTEXT_OFFSET_TLS 0x30 45 #define __CONTEXT_OFFSET_F20 0x34 46 #define __CONTEXT_OFFSET_F21 0x38 47 #define __CONTEXT_OFFSET_F22 0x3c 48 #define __CONTEXT_OFFSET_F23 0x40 49 #define __CONTEXT_OFFSET_F24 0x44 50 #define __CONTEXT_OFFSET_F25 0x48 51 #define __CONTEXT_OFFSET_F26 0x4c 52 #define __CONTEXT_OFFSET_F27 0x50 53 #define __CONTEXT_OFFSET_F28 0x54 54 #define __CONTEXT_OFFSET_F29 0x58 55 #define __CONTEXT_OFFSET_F30 0x5c 56 #define __CONTEXT_SIZE 0x60 57 57 58 58 #ifndef __ASSEMBLER__ … … 61 61 #include <stdint.h> 62 62 63 typedef struct context {63 typedef struct __context { 64 64 uint32_t sp; 65 65 uint32_t pc; … … 87 87 uint32_t f29; 88 88 uint32_t f30; 89 } context_t;89 } __context_t; 90 90 91 91 #endif -
uspace/lib/c/arch/mips32/include/libarch/stack.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_mips32_STACK_H_36 #define LIBC_mips32_STACK_H_35 #ifndef _LIBC_mips32_STACK_H_ 36 #define _LIBC_mips32_STACK_H_ 37 37 38 38 #define STACK_ITEM_SIZE 4 -
uspace/lib/c/arch/mips32/include/libarch/syscall.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_mips32_SYSCALL_H_37 #define LIBC_mips32_SYSCALL_H_36 #ifndef _LIBC_mips32_SYSCALL_H_ 37 #define _LIBC_mips32_SYSCALL_H_ 38 38 39 39 #define LIBARCH_SYSCALL_GENERIC -
uspace/lib/c/arch/mips32/include/libarch/thread.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_mips32_THREAD_H_37 #define LIBC_mips32_THREAD_H_36 #ifndef _LIBC_mips32_THREAD_H_ 37 #define _LIBC_mips32_THREAD_H_ 38 38 39 39 #endif -
uspace/lib/c/arch/mips32/include/libarch/tls.h
re3272101 rd5a89a3 36 36 /* TLS for MIPS is described in http://www.linux-mips.org/wiki/NPTL */ 37 37 38 #ifndef LIBC_mips32_TLS_H_39 #define LIBC_mips32_TLS_H_38 #ifndef _LIBC_mips32_TLS_H_ 39 #define _LIBC_mips32_TLS_H_ 40 40 41 41 /* -
uspace/lib/c/arch/mips32/src/fibril.S
re3272101 rd5a89a3 35 35 #include <libarch/fibril_context.h> 36 36 37 FUNCTION_BEGIN(__ setjmp)38 sw $s0, CONTEXT_OFFSET_S0($a0)39 sw $s1, CONTEXT_OFFSET_S1($a0)40 sw $s2, CONTEXT_OFFSET_S2($a0)41 sw $s3, CONTEXT_OFFSET_S3($a0)42 sw $s4, CONTEXT_OFFSET_S4($a0)43 sw $s5, CONTEXT_OFFSET_S5($a0)44 sw $s6, CONTEXT_OFFSET_S6($a0)45 sw $s7, CONTEXT_OFFSET_S7($a0)46 sw $s8, CONTEXT_OFFSET_S8($a0)47 sw $gp, CONTEXT_OFFSET_GP($a0)37 FUNCTION_BEGIN(__context_save) 38 sw $s0, __CONTEXT_OFFSET_S0($a0) 39 sw $s1, __CONTEXT_OFFSET_S1($a0) 40 sw $s2, __CONTEXT_OFFSET_S2($a0) 41 sw $s3, __CONTEXT_OFFSET_S3($a0) 42 sw $s4, __CONTEXT_OFFSET_S4($a0) 43 sw $s5, __CONTEXT_OFFSET_S5($a0) 44 sw $s6, __CONTEXT_OFFSET_S6($a0) 45 sw $s7, __CONTEXT_OFFSET_S7($a0) 46 sw $s8, __CONTEXT_OFFSET_S8($a0) 47 sw $gp, __CONTEXT_OFFSET_GP($a0) 48 48 49 sw $k1, CONTEXT_OFFSET_TLS($a0)49 sw $k1, __CONTEXT_OFFSET_TLS($a0) 50 50 51 51 #ifdef CONFIG_FPU 52 52 mfc1 $t0, $20 53 sw $t0, CONTEXT_OFFSET_F20($a0)53 sw $t0, __CONTEXT_OFFSET_F20($a0) 54 54 55 55 mfc1 $t0, $21 56 sw $t0, CONTEXT_OFFSET_F21($a0)56 sw $t0, __CONTEXT_OFFSET_F21($a0) 57 57 58 58 mfc1 $t0, $22 59 sw $t0, CONTEXT_OFFSET_F22($a0)59 sw $t0, __CONTEXT_OFFSET_F22($a0) 60 60 61 61 mfc1 $t0, $23 62 sw $t0, CONTEXT_OFFSET_F23($a0)62 sw $t0, __CONTEXT_OFFSET_F23($a0) 63 63 64 64 mfc1 $t0, $24 65 sw $t0, CONTEXT_OFFSET_F24($a0)65 sw $t0, __CONTEXT_OFFSET_F24($a0) 66 66 67 67 mfc1 $t0, $25 68 sw $t0, CONTEXT_OFFSET_F25($a0)68 sw $t0, __CONTEXT_OFFSET_F25($a0) 69 69 70 70 mfc1 $t0, $26 71 sw $t0, CONTEXT_OFFSET_F26($a0)71 sw $t0, __CONTEXT_OFFSET_F26($a0) 72 72 73 73 mfc1 $t0, $27 74 sw $t0, CONTEXT_OFFSET_F27($a0)74 sw $t0, __CONTEXT_OFFSET_F27($a0) 75 75 76 76 mfc1 $t0, $28 77 sw $t0, CONTEXT_OFFSET_F28($a0)77 sw $t0, __CONTEXT_OFFSET_F28($a0) 78 78 79 79 mfc1 $t0, $29 80 sw $t0, CONTEXT_OFFSET_F29($a0)80 sw $t0, __CONTEXT_OFFSET_F29($a0) 81 81 82 82 mfc1 $t0, $30 83 sw $t0, CONTEXT_OFFSET_F30($a0)83 sw $t0, __CONTEXT_OFFSET_F30($a0) 84 84 #endif /* CONFIG_FPU */ 85 85 86 sw $ra, CONTEXT_OFFSET_PC($a0)87 sw $sp, CONTEXT_OFFSET_SP($a0)86 sw $ra, __CONTEXT_OFFSET_PC($a0) 87 sw $sp, __CONTEXT_OFFSET_SP($a0) 88 88 89 # __ setjmpreturns 089 # __context_save returns 0 90 90 j $ra 91 91 li $v0, 0 92 FUNCTION_END(__ setjmp)92 FUNCTION_END(__context_save) 93 93 94 FUNCTION_BEGIN(__ longjmp)95 lw $s0, CONTEXT_OFFSET_S0($a0)96 lw $s1, CONTEXT_OFFSET_S1($a0)97 lw $s2, CONTEXT_OFFSET_S2($a0)98 lw $s3, CONTEXT_OFFSET_S3($a0)99 lw $s4, CONTEXT_OFFSET_S4($a0)100 lw $s5, CONTEXT_OFFSET_S5($a0)101 lw $s6, CONTEXT_OFFSET_S6($a0)102 lw $s7, CONTEXT_OFFSET_S7($a0)103 lw $s8, CONTEXT_OFFSET_S8($a0)104 lw $gp, CONTEXT_OFFSET_GP($a0)105 lw $k1, CONTEXT_OFFSET_TLS($a0)94 FUNCTION_BEGIN(__context_restore) 95 lw $s0, __CONTEXT_OFFSET_S0($a0) 96 lw $s1, __CONTEXT_OFFSET_S1($a0) 97 lw $s2, __CONTEXT_OFFSET_S2($a0) 98 lw $s3, __CONTEXT_OFFSET_S3($a0) 99 lw $s4, __CONTEXT_OFFSET_S4($a0) 100 lw $s5, __CONTEXT_OFFSET_S5($a0) 101 lw $s6, __CONTEXT_OFFSET_S6($a0) 102 lw $s7, __CONTEXT_OFFSET_S7($a0) 103 lw $s8, __CONTEXT_OFFSET_S8($a0) 104 lw $gp, __CONTEXT_OFFSET_GP($a0) 105 lw $k1, __CONTEXT_OFFSET_TLS($a0) 106 106 107 107 #ifdef CONFIG_FPU 108 lw $t0, CONTEXT_OFFSET_F20($a0)108 lw $t0, __CONTEXT_OFFSET_F20($a0) 109 109 mtc1 $t0, $20 110 110 111 lw $t0, CONTEXT_OFFSET_F21($a0)111 lw $t0, __CONTEXT_OFFSET_F21($a0) 112 112 mtc1 $t0, $21 113 113 114 lw $t0, CONTEXT_OFFSET_F22($a0)114 lw $t0, __CONTEXT_OFFSET_F22($a0) 115 115 mtc1 $t0, $22 116 116 117 lw $t0, CONTEXT_OFFSET_F23($a0)117 lw $t0, __CONTEXT_OFFSET_F23($a0) 118 118 mtc1 $t0, $23 119 119 120 lw $t0, CONTEXT_OFFSET_F24($a0)120 lw $t0, __CONTEXT_OFFSET_F24($a0) 121 121 mtc1 $t0, $24 122 122 123 lw $t0, CONTEXT_OFFSET_F25($a0)123 lw $t0, __CONTEXT_OFFSET_F25($a0) 124 124 mtc1 $t0, $25 125 125 126 lw $t0, CONTEXT_OFFSET_F26($a0)126 lw $t0, __CONTEXT_OFFSET_F26($a0) 127 127 mtc1 $t0, $26 128 128 129 lw $t0, CONTEXT_OFFSET_F27($a0)129 lw $t0, __CONTEXT_OFFSET_F27($a0) 130 130 mtc1 $t0, $27 131 131 132 lw $t0, CONTEXT_OFFSET_F28($a0)132 lw $t0, __CONTEXT_OFFSET_F28($a0) 133 133 mtc1 $t0, $28 134 134 135 lw $t0, CONTEXT_OFFSET_F29($a0)135 lw $t0, __CONTEXT_OFFSET_F29($a0) 136 136 mtc1 $t0, $29 137 137 138 lw $t0, CONTEXT_OFFSET_F30($a0)138 lw $t0, __CONTEXT_OFFSET_F30($a0) 139 139 mtc1 $t0, $30 140 140 #endif /* CONFIG_FPU */ 141 141 142 lw $ra, CONTEXT_OFFSET_PC($a0)143 lw $sp, CONTEXT_OFFSET_SP($a0)142 lw $ra, __CONTEXT_OFFSET_PC($a0) 143 lw $sp, __CONTEXT_OFFSET_SP($a0) 144 144 145 145 # Just for the jump into first function, … … 147 147 move $t9, $ra 148 148 149 # __ longjmpreturns second argument149 # __context_restore returns second argument 150 150 j $ra 151 151 move $v0, $a1 152 FUNCTION_END(__ longjmp)152 FUNCTION_END(__context_restore) -
uspace/lib/c/arch/mips32/src/syscall.c
re3272101 rd5a89a3 57 57 "r" (__mips_reg_t1), 58 58 "r" (__mips_reg_v0) 59 : 59 60 /* 60 61 * We are a function call, although C 61 62 * does not know it. 62 63 */ 63 : "%ra" 64 "%ra", 65 /* 66 * Clobber memory too as some arguments might be 67 * actually pointers. 68 */ 69 "memory" 64 70 ); 65 71 -
uspace/lib/c/arch/ppc32/Makefile.common
re3272101 rd5a89a3 33 33 endif 34 34 35 COMMON_CFLAGS += -mcpu=powerpc -m$(FLOATS)-float -m32 35 COMMON_CFLAGS += -mcpu=powerpc -m$(FLOATS)-float -m32 -Wl,-z,max-page-size=0x1000 36 36 AFLAGS += -a32 37 37 LDFLAGS += -Wl,--gc-sections -
uspace/lib/c/arch/ppc32/Makefile.inc
re3272101 rd5a89a3 34 34 arch/$(UARCH)/src/tls.c \ 35 35 arch/$(UARCH)/src/stacktrace.c \ 36 arch/$(UARCH)/src/stacktrace_asm.S 36 arch/$(UARCH)/src/stacktrace_asm.S \ 37 arch/$(UARCH)/src/rtld/dynamic.c \ 38 arch/$(UARCH)/src/rtld/reloc.c 37 39 38 40 ARCH_AUTOCHECK_HEADERS = \ -
uspace/lib/c/arch/ppc32/include/libarch/config.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ppc32_CONFIG_H_36 #define LIBC_ppc32_CONFIG_H_35 #ifndef _LIBC_ppc32_CONFIG_H_ 36 #define _LIBC_ppc32_CONFIG_H_ 37 37 38 38 #define PAGE_WIDTH 12 -
uspace/lib/c/arch/ppc32/include/libarch/ddi.h
re3272101 rd5a89a3 31 31 */ 32 32 33 #ifndef LIBC_ppc32_DDI_H_34 #define LIBC_ppc32_DDI_H_33 #ifndef _LIBC_ppc32_DDI_H_ 34 #define _LIBC_ppc32_DDI_H_ 35 35 36 36 #include <ddi.h> -
uspace/lib/c/arch/ppc32/include/libarch/elf_linux.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ppc32_ELF_LINUX_H_36 #define LIBC_ppc32_ELF_LINUX_H_35 #ifndef _LIBC_ppc32_ELF_LINUX_H_ 36 #define _LIBC_ppc32_ELF_LINUX_H_ 37 37 38 38 #include <libarch/istate.h> -
uspace/lib/c/arch/ppc32/include/libarch/faddr.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ppc32_FADDR_H_36 #define LIBC_ppc32_FADDR_H_35 #ifndef _LIBC_ppc32_FADDR_H_ 36 #define _LIBC_ppc32_FADDR_H_ 37 37 38 38 #include <types/common.h> -
uspace/lib/c/arch/ppc32/include/libarch/fibril.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ppc32_FIBRIL_H_36 #define LIBC_ppc32_FIBRIL_H_35 #ifndef _LIBC_ppc32_FIBRIL_H_ 36 #define _LIBC_ppc32_FIBRIL_H_ 37 37 38 38 #include <stdint.h> -
uspace/lib/c/arch/ppc32/include/libarch/fibril_context.h
re3272101 rd5a89a3 27 27 */ 28 28 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_ 31 31 32 #define CONTEXT_OFFSET_SP 0x0033 #define CONTEXT_OFFSET_PC 0x0434 #define CONTEXT_OFFSET_TLS 0x0835 #define CONTEXT_OFFSET_R13 0x0c36 #define CONTEXT_OFFSET_R14 0x1037 #define CONTEXT_OFFSET_R15 0x1438 #define CONTEXT_OFFSET_R16 0x1839 #define CONTEXT_OFFSET_R17 0x1c40 #define CONTEXT_OFFSET_R18 0x2041 #define CONTEXT_OFFSET_R19 0x2442 #define CONTEXT_OFFSET_R20 0x2843 #define CONTEXT_OFFSET_R21 0x2c44 #define CONTEXT_OFFSET_R22 0x3045 #define CONTEXT_OFFSET_R23 0x3446 #define CONTEXT_OFFSET_R24 0x3847 #define CONTEXT_OFFSET_R25 0x3c48 #define CONTEXT_OFFSET_R26 0x4049 #define CONTEXT_OFFSET_R27 0x4450 #define CONTEXT_OFFSET_R28 0x4851 #define CONTEXT_OFFSET_R29 0x4c52 #define CONTEXT_OFFSET_R30 0x5053 #define CONTEXT_OFFSET_R31 0x5454 #define CONTEXT_OFFSET_CR 0x5855 #define CONTEXT_SIZE 0x5c32 #define __CONTEXT_OFFSET_SP 0x00 33 #define __CONTEXT_OFFSET_PC 0x04 34 #define __CONTEXT_OFFSET_TLS 0x08 35 #define __CONTEXT_OFFSET_R13 0x0c 36 #define __CONTEXT_OFFSET_R14 0x10 37 #define __CONTEXT_OFFSET_R15 0x14 38 #define __CONTEXT_OFFSET_R16 0x18 39 #define __CONTEXT_OFFSET_R17 0x1c 40 #define __CONTEXT_OFFSET_R18 0x20 41 #define __CONTEXT_OFFSET_R19 0x24 42 #define __CONTEXT_OFFSET_R20 0x28 43 #define __CONTEXT_OFFSET_R21 0x2c 44 #define __CONTEXT_OFFSET_R22 0x30 45 #define __CONTEXT_OFFSET_R23 0x34 46 #define __CONTEXT_OFFSET_R24 0x38 47 #define __CONTEXT_OFFSET_R25 0x3c 48 #define __CONTEXT_OFFSET_R26 0x40 49 #define __CONTEXT_OFFSET_R27 0x44 50 #define __CONTEXT_OFFSET_R28 0x48 51 #define __CONTEXT_OFFSET_R29 0x4c 52 #define __CONTEXT_OFFSET_R30 0x50 53 #define __CONTEXT_OFFSET_R31 0x54 54 #define __CONTEXT_OFFSET_CR 0x58 55 #define __CONTEXT_SIZE 0x5c 56 56 57 57 #ifndef __ASSEMBLER__ … … 60 60 #include <stdint.h> 61 61 62 typedef struct context {62 typedef struct __context { 63 63 uint32_t sp; 64 64 uint32_t pc; … … 84 84 uint32_t r31; 85 85 uint32_t cr; 86 } context_t;86 } __context_t; 87 87 88 88 #endif -
uspace/lib/c/arch/ppc32/include/libarch/regname.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ppc32_REGNAME_H_36 #define LIBC_ppc32_REGNAME_H_35 #ifndef _LIBC_ppc32_REGNAME_H_ 36 #define _LIBC_ppc32_REGNAME_H_ 37 37 38 38 /* Condition Register Bit Fields */ -
uspace/lib/c/arch/ppc32/include/libarch/stackarg.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_STACKARG_H_36 #define LIBC_STACKARG_H_35 #ifndef _LIBC_STACKARG_H_ 36 #define _LIBC_STACKARG_H_ 37 37 38 38 #endif -
uspace/lib/c/arch/ppc32/include/libarch/syscall.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_ppc32_SYSCALL_H_37 #define LIBC_ppc32_SYSCALL_H_36 #ifndef _LIBC_ppc32_SYSCALL_H_ 37 #define _LIBC_ppc32_SYSCALL_H_ 38 38 39 39 #define LIBARCH_SYSCALL_GENERIC -
uspace/lib/c/arch/ppc32/include/libarch/thread.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ppc32_THREAD_H_36 #define LIBC_ppc32_THREAD_H_35 #ifndef _LIBC_ppc32_THREAD_H_ 36 #define _LIBC_ppc32_THREAD_H_ 37 37 38 38 #endif -
uspace/lib/c/arch/ppc32/include/libarch/tls.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_ppc32_TLS_H_36 #define LIBC_ppc32_TLS_H_35 #ifndef _LIBC_ppc32_TLS_H_ 36 #define _LIBC_ppc32_TLS_H_ 37 37 38 38 #define CONFIG_TLS_VARIANT_1 … … 43 43 44 44 typedef struct { 45 void **dtv; 46 void *pad; 45 47 void *fibril_data; 46 48 } tcb_t; -
uspace/lib/c/arch/ppc32/src/fibril.S
re3272101 rd5a89a3 33 33 #include <libarch/fibril_context.h> 34 34 35 FUNCTION_BEGIN(__ setjmp)36 stw sp, CONTEXT_OFFSET_SP(r3)37 stw r2, CONTEXT_OFFSET_TLS(r3)38 stw r13, CONTEXT_OFFSET_R13(r3)39 stw r14, CONTEXT_OFFSET_R14(r3)40 stw r15, CONTEXT_OFFSET_R15(r3)41 stw r16, CONTEXT_OFFSET_R16(r3)42 stw r17, CONTEXT_OFFSET_R17(r3)43 stw r18, CONTEXT_OFFSET_R18(r3)44 stw r19, CONTEXT_OFFSET_R19(r3)45 stw r20, CONTEXT_OFFSET_R20(r3)46 stw r21, CONTEXT_OFFSET_R21(r3)47 stw r22, CONTEXT_OFFSET_R22(r3)48 stw r23, CONTEXT_OFFSET_R23(r3)49 stw r24, CONTEXT_OFFSET_R24(r3)50 stw r25, CONTEXT_OFFSET_R25(r3)51 stw r26, CONTEXT_OFFSET_R26(r3)52 stw r27, CONTEXT_OFFSET_R27(r3)53 stw r28, CONTEXT_OFFSET_R28(r3)54 stw r29, CONTEXT_OFFSET_R29(r3)55 stw r30, CONTEXT_OFFSET_R30(r3)56 stw r31, CONTEXT_OFFSET_R31(r3)35 FUNCTION_BEGIN(__context_save) 36 stw sp, __CONTEXT_OFFSET_SP(r3) 37 stw r2, __CONTEXT_OFFSET_TLS(r3) 38 stw r13, __CONTEXT_OFFSET_R13(r3) 39 stw r14, __CONTEXT_OFFSET_R14(r3) 40 stw r15, __CONTEXT_OFFSET_R15(r3) 41 stw r16, __CONTEXT_OFFSET_R16(r3) 42 stw r17, __CONTEXT_OFFSET_R17(r3) 43 stw r18, __CONTEXT_OFFSET_R18(r3) 44 stw r19, __CONTEXT_OFFSET_R19(r3) 45 stw r20, __CONTEXT_OFFSET_R20(r3) 46 stw r21, __CONTEXT_OFFSET_R21(r3) 47 stw r22, __CONTEXT_OFFSET_R22(r3) 48 stw r23, __CONTEXT_OFFSET_R23(r3) 49 stw r24, __CONTEXT_OFFSET_R24(r3) 50 stw r25, __CONTEXT_OFFSET_R25(r3) 51 stw r26, __CONTEXT_OFFSET_R26(r3) 52 stw r27, __CONTEXT_OFFSET_R27(r3) 53 stw r28, __CONTEXT_OFFSET_R28(r3) 54 stw r29, __CONTEXT_OFFSET_R29(r3) 55 stw r30, __CONTEXT_OFFSET_R30(r3) 56 stw r31, __CONTEXT_OFFSET_R31(r3) 57 57 58 58 mflr r4 59 stw r4, CONTEXT_OFFSET_PC(r3)59 stw r4, __CONTEXT_OFFSET_PC(r3) 60 60 61 61 mfcr r4 62 stw r4, CONTEXT_OFFSET_CR(r3)62 stw r4, __CONTEXT_OFFSET_CR(r3) 63 63 64 # __ setjmpreturns 064 # __context_save returns 0 65 65 li r3, 0 66 66 blr 67 FUNCTION_END(__ setjmp)67 FUNCTION_END(__context_save) 68 68 69 FUNCTION_BEGIN(__ longjmp)70 lwz sp, CONTEXT_OFFSET_SP(r3)71 lwz r2, CONTEXT_OFFSET_TLS(r3)72 lwz r13, CONTEXT_OFFSET_R13(r3)73 lwz r14, CONTEXT_OFFSET_R14(r3)74 lwz r15, CONTEXT_OFFSET_R15(r3)75 lwz r16, CONTEXT_OFFSET_R16(r3)76 lwz r17, CONTEXT_OFFSET_R17(r3)77 lwz r18, CONTEXT_OFFSET_R18(r3)78 lwz r19, CONTEXT_OFFSET_R19(r3)79 lwz r20, CONTEXT_OFFSET_R20(r3)80 lwz r21, CONTEXT_OFFSET_R21(r3)81 lwz r22, CONTEXT_OFFSET_R22(r3)82 lwz r23, CONTEXT_OFFSET_R23(r3)83 lwz r24, CONTEXT_OFFSET_R24(r3)84 lwz r25, CONTEXT_OFFSET_R25(r3)85 lwz r26, CONTEXT_OFFSET_R26(r3)86 lwz r27, CONTEXT_OFFSET_R27(r3)87 lwz r28, CONTEXT_OFFSET_R28(r3)88 lwz r29, CONTEXT_OFFSET_R29(r3)89 lwz r30, CONTEXT_OFFSET_R30(r3)90 lwz r31, CONTEXT_OFFSET_R31(r3)69 FUNCTION_BEGIN(__context_restore) 70 lwz sp, __CONTEXT_OFFSET_SP(r3) 71 lwz r2, __CONTEXT_OFFSET_TLS(r3) 72 lwz r13, __CONTEXT_OFFSET_R13(r3) 73 lwz r14, __CONTEXT_OFFSET_R14(r3) 74 lwz r15, __CONTEXT_OFFSET_R15(r3) 75 lwz r16, __CONTEXT_OFFSET_R16(r3) 76 lwz r17, __CONTEXT_OFFSET_R17(r3) 77 lwz r18, __CONTEXT_OFFSET_R18(r3) 78 lwz r19, __CONTEXT_OFFSET_R19(r3) 79 lwz r20, __CONTEXT_OFFSET_R20(r3) 80 lwz r21, __CONTEXT_OFFSET_R21(r3) 81 lwz r22, __CONTEXT_OFFSET_R22(r3) 82 lwz r23, __CONTEXT_OFFSET_R23(r3) 83 lwz r24, __CONTEXT_OFFSET_R24(r3) 84 lwz r25, __CONTEXT_OFFSET_R25(r3) 85 lwz r26, __CONTEXT_OFFSET_R26(r3) 86 lwz r27, __CONTEXT_OFFSET_R27(r3) 87 lwz r28, __CONTEXT_OFFSET_R28(r3) 88 lwz r29, __CONTEXT_OFFSET_R29(r3) 89 lwz r30, __CONTEXT_OFFSET_R30(r3) 90 lwz r31, __CONTEXT_OFFSET_R31(r3) 91 91 92 lwz r5, CONTEXT_OFFSET_CR(r3)92 lwz r5, __CONTEXT_OFFSET_CR(r3) 93 93 mtcr r5 94 94 95 lwz r5, CONTEXT_OFFSET_PC(r3)95 lwz r5, __CONTEXT_OFFSET_PC(r3) 96 96 mtlr r5 97 97 98 # __ longjmpreturns second argument98 # __context_restore returns second argument 99 99 mr r3, r4 100 100 blr 101 FUNCTION_END(__ longjmp)101 FUNCTION_END(__context_restore) -
uspace/lib/c/arch/ppc32/src/syscall.c
re3272101 rd5a89a3 58 58 "r" (__ppc32_reg_r8), 59 59 "r" (__ppc32_reg_r9) 60 : 61 /* 62 * Clobber memory too as some arguments might be 63 * actually pointers. 64 */ 65 "memory" 60 66 ); 61 67 -
uspace/lib/c/arch/ppc32/src/tls.c
re3272101 rd5a89a3 1 1 /* 2 * Copyright (c) 2019 Jiri Svoboda 2 3 * Copyright (c) 2006 Ondrej Palkovsky 3 4 * All rights reserved. … … 36 37 #include <stddef.h> 37 38 39 #ifdef CONFIG_RTLD 40 #include <rtld/rtld.h> 41 #endif 42 38 43 tcb_t *tls_alloc_arch(size_t size, size_t align) 39 44 { … … 46 51 } 47 52 53 /* 54 * Rtld TLS support 55 */ 56 57 typedef struct { 58 unsigned long int ti_module; 59 unsigned long int ti_offset; 60 } tls_index; 61 62 int __tls_debug = 0; 63 64 void *__tls_get_addr(tls_index *ti); 65 66 void *__tls_get_addr(tls_index *ti) 67 { 68 uint8_t *tls; 69 70 #ifdef CONFIG_RTLD 71 if (runtime_env != NULL) { 72 return rtld_tls_get_addr(runtime_env, __tcb_get(), 73 ti->ti_module, ti->ti_offset) + 0x8000; 74 } 75 #endif 76 /* Get address of static TLS block */ 77 tls = tls_get(); 78 return tls + ti->ti_offset + 0x8000; 79 } 80 48 81 /** @} 49 82 */ -
uspace/lib/c/arch/riscv64/include/libarch/config.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_riscv64_CONFIG_H_36 #define LIBC_riscv64_CONFIG_H_35 #ifndef _LIBC_riscv64_CONFIG_H_ 36 #define _LIBC_riscv64_CONFIG_H_ 37 37 38 38 #define PAGE_WIDTH 12 -
uspace/lib/c/arch/riscv64/include/libarch/ddi.h
re3272101 rd5a89a3 30 30 */ 31 31 32 #ifndef LIBC_riscv64_DDI_H_33 #define LIBC_riscv64_DDI_H_32 #ifndef _LIBC_riscv64_DDI_H_ 33 #define _LIBC_riscv64_DDI_H_ 34 34 35 35 #include <ddi.h> -
uspace/lib/c/arch/riscv64/include/libarch/elf_linux.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_riscv64_ELF_LINUX_H_36 #define LIBC_riscv64_ELF_LINUX_H_35 #ifndef _LIBC_riscv64_ELF_LINUX_H_ 36 #define _LIBC_riscv64_ELF_LINUX_H_ 37 37 38 38 #include <libarch/istate.h> -
uspace/lib/c/arch/riscv64/include/libarch/faddr.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_riscv64_FADDR_H_36 #define LIBC_riscv64_FADDR_H_35 #ifndef _LIBC_riscv64_FADDR_H_ 36 #define _LIBC_riscv64_FADDR_H_ 37 37 38 38 #include <types/common.h> -
uspace/lib/c/arch/riscv64/include/libarch/fibril.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_riscv64_FIBRIL_H_36 #define LIBC_riscv64_FIBRIL_H_35 #ifndef _LIBC_riscv64_FIBRIL_H_ 36 #define _LIBC_riscv64_FIBRIL_H_ 37 37 38 38 #include <stdint.h> -
uspace/lib/c/arch/riscv64/include/libarch/fibril_context.h
re3272101 rd5a89a3 27 27 */ 28 28 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_ 31 31 32 #define CONTEXT_OFFSET_SP 0x0033 #define CONTEXT_OFFSET_PC 0x0834 #define CONTEXT_OFFSET_ZERO 0x1035 #define CONTEXT_OFFSET_RA 0x1836 #define CONTEXT_OFFSET_X3 0x2037 #define CONTEXT_OFFSET_X4 0x2838 #define CONTEXT_OFFSET_X5 0x3039 #define CONTEXT_OFFSET_X6 0x3840 #define CONTEXT_OFFSET_X7 0x4041 #define CONTEXT_OFFSET_X8 0x4842 #define CONTEXT_OFFSET_X9 0x5043 #define CONTEXT_OFFSET_X10 0x5844 #define CONTEXT_OFFSET_X11 0x6045 #define CONTEXT_OFFSET_X12 0x6846 #define CONTEXT_OFFSET_X13 0x7047 #define CONTEXT_OFFSET_X14 0x7848 #define CONTEXT_OFFSET_X15 0x8049 #define CONTEXT_OFFSET_X16 0x8850 #define CONTEXT_OFFSET_X17 0x9051 #define CONTEXT_OFFSET_X18 0x9852 #define CONTEXT_OFFSET_X19 0xa053 #define CONTEXT_OFFSET_X20 0xa854 #define CONTEXT_OFFSET_X21 0xb055 #define CONTEXT_OFFSET_X22 0xb856 #define CONTEXT_OFFSET_X23 0xc057 #define CONTEXT_OFFSET_X24 0xc858 #define CONTEXT_OFFSET_X25 0xd059 #define CONTEXT_OFFSET_X26 0xd860 #define CONTEXT_OFFSET_X27 0xe061 #define CONTEXT_OFFSET_X28 0xe862 #define CONTEXT_OFFSET_X29 0xf063 #define CONTEXT_OFFSET_X30 0xf864 #define CONTEXT_OFFSET_X31 0x10065 #define CONTEXT_SIZE 0x10832 #define __CONTEXT_OFFSET_SP 0x00 33 #define __CONTEXT_OFFSET_PC 0x08 34 #define __CONTEXT_OFFSET_ZERO 0x10 35 #define __CONTEXT_OFFSET_RA 0x18 36 #define __CONTEXT_OFFSET_X3 0x20 37 #define __CONTEXT_OFFSET_X4 0x28 38 #define __CONTEXT_OFFSET_X5 0x30 39 #define __CONTEXT_OFFSET_X6 0x38 40 #define __CONTEXT_OFFSET_X7 0x40 41 #define __CONTEXT_OFFSET_X8 0x48 42 #define __CONTEXT_OFFSET_X9 0x50 43 #define __CONTEXT_OFFSET_X10 0x58 44 #define __CONTEXT_OFFSET_X11 0x60 45 #define __CONTEXT_OFFSET_X12 0x68 46 #define __CONTEXT_OFFSET_X13 0x70 47 #define __CONTEXT_OFFSET_X14 0x78 48 #define __CONTEXT_OFFSET_X15 0x80 49 #define __CONTEXT_OFFSET_X16 0x88 50 #define __CONTEXT_OFFSET_X17 0x90 51 #define __CONTEXT_OFFSET_X18 0x98 52 #define __CONTEXT_OFFSET_X19 0xa0 53 #define __CONTEXT_OFFSET_X20 0xa8 54 #define __CONTEXT_OFFSET_X21 0xb0 55 #define __CONTEXT_OFFSET_X22 0xb8 56 #define __CONTEXT_OFFSET_X23 0xc0 57 #define __CONTEXT_OFFSET_X24 0xc8 58 #define __CONTEXT_OFFSET_X25 0xd0 59 #define __CONTEXT_OFFSET_X26 0xd8 60 #define __CONTEXT_OFFSET_X27 0xe0 61 #define __CONTEXT_OFFSET_X28 0xe8 62 #define __CONTEXT_OFFSET_X29 0xf0 63 #define __CONTEXT_OFFSET_X30 0xf8 64 #define __CONTEXT_OFFSET_X31 0x100 65 #define __CONTEXT_SIZE 0x108 66 66 67 67 #ifndef __ASSEMBLER__ … … 75 75 */ 76 76 77 typedef struct context {77 typedef struct __context { 78 78 uint64_t sp; 79 79 uint64_t pc; … … 109 109 uint64_t x30; 110 110 uint64_t x31; 111 } context_t;111 } __context_t; 112 112 113 113 #endif -
uspace/lib/c/arch/riscv64/include/libarch/syscall.h
re3272101 rd5a89a3 34 34 */ 35 35 36 #ifndef LIBC_riscv64_SYSCALL_H_37 #define LIBC_riscv64_SYSCALL_H_36 #ifndef _LIBC_riscv64_SYSCALL_H_ 37 #define _LIBC_riscv64_SYSCALL_H_ 38 38 39 39 #include <stdint.h> -
uspace/lib/c/arch/riscv64/include/libarch/thread.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_riscv64_THREAD_H_36 #define LIBC_riscv64_THREAD_H_35 #ifndef _LIBC_riscv64_THREAD_H_ 36 #define _LIBC_riscv64_THREAD_H_ 37 37 38 38 #endif -
uspace/lib/c/arch/riscv64/include/libarch/tls.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_riscv64_TLS_H_36 #define LIBC_riscv64_TLS_H_35 #ifndef _LIBC_riscv64_TLS_H_ 36 #define _LIBC_riscv64_TLS_H_ 37 37 38 38 #define CONFIG_TLS_VARIANT_2 -
uspace/lib/c/arch/riscv64/src/fibril.c
re3272101 rd5a89a3 33 33 #include <stdbool.h> 34 34 35 int __ setjmp(context_t *ctx)35 int __context_save(__context_t *ctx) 36 36 { 37 37 return 0; 38 38 } 39 39 40 void __ longjmp(context_t *ctx, int ret)40 void __context_restore(__context_t *ctx, int ret) 41 41 { 42 42 while (true) -
uspace/lib/c/arch/sparc64/Makefile.common
re3272101 rd5a89a3 52 52 ifeq ($(PROCESSOR),sun4v) 53 53 DEFS += -DSUN4V 54 COMMON_CFLAGS += -Wl,-z,max-page-size=0x2000 55 else 56 COMMON_CFLAGS += -Wl,-z,max-page-size=0x4000 54 57 endif -
uspace/lib/c/arch/sparc64/Makefile.inc
re3272101 rd5a89a3 33 33 arch/$(UARCH)/src/tls.c \ 34 34 arch/$(UARCH)/src/stacktrace.c \ 35 arch/$(UARCH)/src/stacktrace_asm.S 35 arch/$(UARCH)/src/stacktrace_asm.S \ 36 arch/$(UARCH)/src/rtld/dynamic.c \ 37 arch/$(UARCH)/src/rtld/reloc.c 36 38 37 39 ARCH_AUTOCHECK_HEADERS = \ -
uspace/lib/c/arch/sparc64/include/libarch/config.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_sparc64_CONFIG_H_36 #define LIBC_sparc64_CONFIG_H_35 #ifndef _LIBC_sparc64_CONFIG_H_ 36 #define _LIBC_sparc64_CONFIG_H_ 37 37 38 38 #if defined (SUN4U) -
uspace/lib/c/arch/sparc64/include/libarch/ddi.h
re3272101 rd5a89a3 31 31 */ 32 32 33 #ifndef LIBC_sparc64_DDI_H_34 #define LIBC_sparc64_DDI_H_33 #ifndef _LIBC_sparc64_DDI_H_ 34 #define _LIBC_sparc64_DDI_H_ 35 35 36 36 #include <barrier.h> -
uspace/lib/c/arch/sparc64/include/libarch/elf_linux.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_sparc64_ELF_LINUX_H_36 #define LIBC_sparc64_ELF_LINUX_H_35 #ifndef _LIBC_sparc64_ELF_LINUX_H_ 36 #define _LIBC_sparc64_ELF_LINUX_H_ 37 37 38 38 #include <libarch/istate.h> -
uspace/lib/c/arch/sparc64/include/libarch/faddr.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_sparc64_FADDR_H_36 #define LIBC_sparc64_FADDR_H_35 #ifndef _LIBC_sparc64_FADDR_H_ 36 #define _LIBC_sparc64_FADDR_H_ 37 37 38 38 #include <types/common.h> -
uspace/lib/c/arch/sparc64/include/libarch/fibril.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_sparc64_FIBRIL_H_36 #define LIBC_sparc64_FIBRIL_H_35 #ifndef _LIBC_sparc64_FIBRIL_H_ 36 #define _LIBC_sparc64_FIBRIL_H_ 37 37 38 38 #include <libarch/stack.h> -
uspace/lib/c/arch/sparc64/include/libarch/fibril_context.h
re3272101 rd5a89a3 27 27 */ 28 28 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_ 31 31 32 #define CONTEXT_OFFSET_SP 0x0033 #define CONTEXT_OFFSET_PC 0x0834 #define CONTEXT_OFFSET_I0 0x1035 #define CONTEXT_OFFSET_I1 0x1836 #define CONTEXT_OFFSET_I2 0x2037 #define CONTEXT_OFFSET_I3 0x2838 #define CONTEXT_OFFSET_I4 0x3039 #define CONTEXT_OFFSET_I5 0x3840 #define CONTEXT_OFFSET_FP 0x4041 #define CONTEXT_OFFSET_I7 0x4842 #define CONTEXT_OFFSET_L0 0x5043 #define CONTEXT_OFFSET_L1 0x5844 #define CONTEXT_OFFSET_L2 0x6045 #define CONTEXT_OFFSET_L3 0x6846 #define CONTEXT_OFFSET_L4 0x7047 #define CONTEXT_OFFSET_L5 0x7848 #define CONTEXT_OFFSET_L6 0x8049 #define CONTEXT_OFFSET_L7 0x8850 #define CONTEXT_OFFSET_TP 0x9051 #define CONTEXT_SIZE 0x9832 #define __CONTEXT_OFFSET_SP 0x00 33 #define __CONTEXT_OFFSET_PC 0x08 34 #define __CONTEXT_OFFSET_I0 0x10 35 #define __CONTEXT_OFFSET_I1 0x18 36 #define __CONTEXT_OFFSET_I2 0x20 37 #define __CONTEXT_OFFSET_I3 0x28 38 #define __CONTEXT_OFFSET_I4 0x30 39 #define __CONTEXT_OFFSET_I5 0x38 40 #define __CONTEXT_OFFSET_FP 0x40 41 #define __CONTEXT_OFFSET_I7 0x48 42 #define __CONTEXT_OFFSET_L0 0x50 43 #define __CONTEXT_OFFSET_L1 0x58 44 #define __CONTEXT_OFFSET_L2 0x60 45 #define __CONTEXT_OFFSET_L3 0x68 46 #define __CONTEXT_OFFSET_L4 0x70 47 #define __CONTEXT_OFFSET_L5 0x78 48 #define __CONTEXT_OFFSET_L6 0x80 49 #define __CONTEXT_OFFSET_L7 0x88 50 #define __CONTEXT_OFFSET_TP 0x90 51 #define __CONTEXT_SIZE 0x98 52 52 53 53 #ifndef __ASSEMBLER__ … … 56 56 #include <stdint.h> 57 57 58 typedef struct context {58 typedef struct __context { 59 59 uintptr_t sp; // %o6 60 60 uintptr_t pc; // %o7 … … 76 76 uint64_t l7; 77 77 uint64_t tp; // %g7 78 } context_t;78 } __context_t; 79 79 80 80 #endif -
uspace/lib/c/arch/sparc64/include/libarch/stack.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_sparc64_STACK_H_36 #define LIBC_sparc64_STACK_H_35 #ifndef _LIBC_sparc64_STACK_H_ 36 #define _LIBC_sparc64_STACK_H_ 37 37 38 38 #define STACK_ITEM_SIZE 8 -
uspace/lib/c/arch/sparc64/include/libarch/stackarg.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_sparc64_STACKARG_H_36 #define LIBC_sparc64_STACKARG_H_35 #ifndef _LIBC_sparc64_STACKARG_H_ 36 #define _LIBC_sparc64_STACKARG_H_ 37 37 38 38 #endif -
uspace/lib/c/arch/sparc64/include/libarch/syscall.h
re3272101 rd5a89a3 33 33 */ 34 34 35 #ifndef LIBC_sparc64_SYSCALL_H_36 #define LIBC_sparc64_SYSCALL_H_35 #ifndef _LIBC_sparc64_SYSCALL_H_ 36 #define _LIBC_sparc64_SYSCALL_H_ 37 37 38 38 #include <stdint.h> -
uspace/lib/c/arch/sparc64/include/libarch/thread.h
re3272101 rd5a89a3 32 32 */ 33 33 34 #ifndef LIBC_sparc64_THREAD_H_35 #define LIBC_sparc64_THREAD_H_34 #ifndef _LIBC_sparc64_THREAD_H_ 35 #define _LIBC_sparc64_THREAD_H_ 36 36 37 37 #endif -
uspace/lib/c/arch/sparc64/include/libarch/tls.h
re3272101 rd5a89a3 36 36 */ 37 37 38 #ifndef LIBC_sparc64_TLS_H_39 #define LIBC_sparc64_TLS_H_38 #ifndef _LIBC_sparc64_TLS_H_ 39 #define _LIBC_sparc64_TLS_H_ 40 40 41 41 #define CONFIG_TLS_VARIANT_2 … … 46 46 void *self; 47 47 void *fibril_data; 48 void **dtv; 49 void *pad; 48 50 } tcb_t; 49 51 -
uspace/lib/c/arch/sparc64/src/fibril.S
re3272101 rd5a89a3 32 32 .text 33 33 34 FUNCTION_BEGIN(__ setjmp)34 FUNCTION_BEGIN(__context_save) 35 35 # 36 36 # We rely on the kernel to flush our active register windows to memory 37 37 # should a thread switch occur. 38 38 # 39 stx %sp, [%o0 + CONTEXT_OFFSET_SP]40 stx %o7, [%o0 + CONTEXT_OFFSET_PC]41 stx %i0, [%o0 + CONTEXT_OFFSET_I0]42 stx %i1, [%o0 + CONTEXT_OFFSET_I1]43 stx %i2, [%o0 + CONTEXT_OFFSET_I2]44 stx %i3, [%o0 + CONTEXT_OFFSET_I3]45 stx %i4, [%o0 + CONTEXT_OFFSET_I4]46 stx %i5, [%o0 + CONTEXT_OFFSET_I5]47 stx %fp, [%o0 + CONTEXT_OFFSET_FP]48 stx %i7, [%o0 + CONTEXT_OFFSET_I7]49 stx %l0, [%o0 + CONTEXT_OFFSET_L0]50 stx %l1, [%o0 + CONTEXT_OFFSET_L1]51 stx %l2, [%o0 + CONTEXT_OFFSET_L2]52 stx %l3, [%o0 + CONTEXT_OFFSET_L3]53 stx %l4, [%o0 + CONTEXT_OFFSET_L4]54 stx %l5, [%o0 + CONTEXT_OFFSET_L5]55 stx %l6, [%o0 + CONTEXT_OFFSET_L6]56 stx %l7, [%o0 + CONTEXT_OFFSET_L7]57 stx %g7, [%o0 + CONTEXT_OFFSET_TP]39 stx %sp, [%o0 + __CONTEXT_OFFSET_SP] 40 stx %o7, [%o0 + __CONTEXT_OFFSET_PC] 41 stx %i0, [%o0 + __CONTEXT_OFFSET_I0] 42 stx %i1, [%o0 + __CONTEXT_OFFSET_I1] 43 stx %i2, [%o0 + __CONTEXT_OFFSET_I2] 44 stx %i3, [%o0 + __CONTEXT_OFFSET_I3] 45 stx %i4, [%o0 + __CONTEXT_OFFSET_I4] 46 stx %i5, [%o0 + __CONTEXT_OFFSET_I5] 47 stx %fp, [%o0 + __CONTEXT_OFFSET_FP] 48 stx %i7, [%o0 + __CONTEXT_OFFSET_I7] 49 stx %l0, [%o0 + __CONTEXT_OFFSET_L0] 50 stx %l1, [%o0 + __CONTEXT_OFFSET_L1] 51 stx %l2, [%o0 + __CONTEXT_OFFSET_L2] 52 stx %l3, [%o0 + __CONTEXT_OFFSET_L3] 53 stx %l4, [%o0 + __CONTEXT_OFFSET_L4] 54 stx %l5, [%o0 + __CONTEXT_OFFSET_L5] 55 stx %l6, [%o0 + __CONTEXT_OFFSET_L6] 56 stx %l7, [%o0 + __CONTEXT_OFFSET_L7] 57 stx %g7, [%o0 + __CONTEXT_OFFSET_TP] 58 58 retl 59 mov 0, %o0 ! __ setjmpreturns 060 FUNCTION_END(__ setjmp)59 mov 0, %o0 ! __context_save returns 0 60 FUNCTION_END(__context_save) 61 61 62 FUNCTION_BEGIN(__ longjmp)62 FUNCTION_BEGIN(__context_restore) 63 63 # 64 64 # Flush all active windows. … … 69 69 flushw 70 70 71 ldx [%o0 + CONTEXT_OFFSET_SP], %sp72 ldx [%o0 + CONTEXT_OFFSET_PC], %o773 ldx [%o0 + CONTEXT_OFFSET_I0], %i074 ldx [%o0 + CONTEXT_OFFSET_I1], %i175 ldx [%o0 + CONTEXT_OFFSET_I2], %i276 ldx [%o0 + CONTEXT_OFFSET_I3], %i377 ldx [%o0 + CONTEXT_OFFSET_I4], %i478 ldx [%o0 + CONTEXT_OFFSET_I5], %i579 ldx [%o0 + CONTEXT_OFFSET_FP], %fp80 ldx [%o0 + CONTEXT_OFFSET_I7], %i781 ldx [%o0 + CONTEXT_OFFSET_L0], %l082 ldx [%o0 + CONTEXT_OFFSET_L1], %l183 ldx [%o0 + CONTEXT_OFFSET_L2], %l284 ldx [%o0 + CONTEXT_OFFSET_L3], %l385 ldx [%o0 + CONTEXT_OFFSET_L4], %l486 ldx [%o0 + CONTEXT_OFFSET_L5], %l587 ldx [%o0 + CONTEXT_OFFSET_L6], %l688 ldx [%o0 + CONTEXT_OFFSET_L7], %l789 ldx [%o0 + CONTEXT_OFFSET_TP], %g771 ldx [%o0 + __CONTEXT_OFFSET_SP], %sp 72 ldx [%o0 + __CONTEXT_OFFSET_PC], %o7 73 ldx [%o0 + __CONTEXT_OFFSET_I0], %i0 74 ldx [%o0 + __CONTEXT_OFFSET_I1], %i1 75 ldx [%o0 + __CONTEXT_OFFSET_I2], %i2 76 ldx [%o0 + __CONTEXT_OFFSET_I3], %i3 77 ldx [%o0 + __CONTEXT_OFFSET_I4], %i4 78 ldx [%o0 + __CONTEXT_OFFSET_I5], %i5 79 ldx [%o0 + __CONTEXT_OFFSET_FP], %fp 80 ldx [%o0 + __CONTEXT_OFFSET_I7], %i7 81 ldx [%o0 + __CONTEXT_OFFSET_L0], %l0 82 ldx [%o0 + __CONTEXT_OFFSET_L1], %l1 83 ldx [%o0 + __CONTEXT_OFFSET_L2], %l2 84 ldx [%o0 + __CONTEXT_OFFSET_L3], %l3 85 ldx [%o0 + __CONTEXT_OFFSET_L4], %l4 86 ldx [%o0 + __CONTEXT_OFFSET_L5], %l5 87 ldx [%o0 + __CONTEXT_OFFSET_L6], %l6 88 ldx [%o0 + __CONTEXT_OFFSET_L7], %l7 89 ldx [%o0 + __CONTEXT_OFFSET_TP], %g7 90 90 retl 91 mov %o1, %o0 ! __ longjmpreturns second argument92 FUNCTION_END(__ longjmp)91 mov %o1, %o0 ! __context_restore returns second argument 92 FUNCTION_END(__context_restore) -
uspace/lib/c/arch/sparc64/src/tls.c
re3272101 rd5a89a3 38 38 #include <stddef.h> 39 39 40 #ifdef CONFIG_RTLD 41 #include <rtld/rtld.h> 42 #endif 43 40 44 tcb_t *tls_alloc_arch(size_t size, size_t align) 41 45 { … … 48 52 } 49 53 54 /* 55 * Rtld TLS support 56 */ 57 58 typedef struct { 59 unsigned long int ti_module; 60 unsigned long int ti_offset; 61 } tls_index; 62 63 void *__tls_get_addr(tls_index *ti); 64 65 void *__tls_get_addr(tls_index *ti) 66 { 67 uint8_t *tls; 68 69 #ifdef CONFIG_RTLD 70 if (runtime_env != NULL) { 71 return rtld_tls_get_addr(runtime_env, __tcb_get(), 72 ti->ti_module, ti->ti_offset); 73 } 74 #endif 75 /* Get address of static TLS block */ 76 tls = tls_get(); 77 return tls + ti->ti_offset; 78 } 79 50 80 /** @} 51 81 */
Note:
See TracChangeset
for help on using the changeset viewer.
