Changeset d5a89a3 in mainline for uspace/lib/c/arch/sparc64
- Timestamp:
- 2019-02-11T22:31:04Z (6 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/sparc64
- Files:
-
- 5 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
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.