Changeset a5c78a18 in mainline
- Timestamp:
- 2019-02-03T14:35:44Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b4f1171
- Parents:
- 67ca359
- Location:
- uspace/lib/c
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/abs32le/include/libarch/fibril_context.h
r67ca359 ra5c78a18 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/src/fibril.c
r67ca359 ra5c78a18 33 33 #include <stdbool.h> 34 34 35 int __setjmp( context_t *ctx)35 int __setjmp(__context_t *ctx) 36 36 { 37 37 return 0; 38 38 } 39 39 40 void __longjmp( context_t *ctx, int val)40 void __longjmp(__context_t *ctx, int val) 41 41 { 42 42 while (true) -
uspace/lib/c/arch/amd64/include/libarch/fibril_context.h
r67ca359 ra5c78a18 30 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/src/fibril.S
r67ca359 ra5c78a18 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 56 xorq %rax, %rax # __setjmp returns 0 … … 64 64 # 65 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), %rbx66 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 -
uspace/lib/c/arch/arm32/include/libarch/fibril_context.h
r67ca359 ra5c78a18 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/ia32/include/libarch/fibril_context.h
r67ca359 ra5c78a18 30 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/src/fibril.S
r67ca359 ra5c78a18 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 55 xorl %eax, %eax # __setjmp returns 0 … … 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 -
uspace/lib/c/arch/ia64/include/libarch/fibril_context.h
r67ca359 ra5c78a18 30 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/src/fibril.S
r67ca359 ra5c78a18 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 /* … … 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 */ -
uspace/lib/c/arch/mips32/include/libarch/fibril_context.h
r67ca359 ra5c78a18 30 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/src/fibril.S
r67ca359 ra5c78a18 36 36 37 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)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 89 # __setjmp returns 0 … … 93 93 94 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)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, -
uspace/lib/c/arch/ppc32/include/libarch/fibril_context.h
r67ca359 ra5c78a18 30 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/src/fibril.S
r67ca359 ra5c78a18 34 34 35 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)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 64 # __setjmp returns 0 … … 68 68 69 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)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 -
uspace/lib/c/arch/riscv64/include/libarch/fibril_context.h
r67ca359 ra5c78a18 30 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/src/fibril.c
r67ca359 ra5c78a18 33 33 #include <stdbool.h> 34 34 35 int __setjmp( context_t *ctx)35 int __setjmp(__context_t *ctx) 36 36 { 37 37 return 0; 38 38 } 39 39 40 void __longjmp( context_t *ctx, int ret)40 void __longjmp(__context_t *ctx, int ret) 41 41 { 42 42 while (true) -
uspace/lib/c/arch/sparc64/include/libarch/fibril_context.h
r67ca359 ra5c78a18 30 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/src/fibril.S
r67ca359 ra5c78a18 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 59 mov 0, %o0 ! __setjmp returns 0 … … 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 91 mov %o1, %o0 ! __longjmp returns second argument -
uspace/lib/c/include/context.h
r67ca359 ra5c78a18 33 33 #include <libarch/fibril_context.h> 34 34 35 typedef __context_t context_t; 36 35 37 /* Context initialization data. */ 36 38 typedef struct { -
uspace/lib/c/include/setjmp.h
r67ca359 ra5c78a18 41 41 #include <_bits/__noreturn.h> 42 42 43 typedef context_t jmp_buf[1];43 typedef __context_t jmp_buf[1]; 44 44 45 45 extern int __setjmp(jmp_buf) __attribute__((returns_twice));
Note:
See TracChangeset
for help on using the changeset viewer.