Changeset 55f068c in mainline
- Timestamp:
- 2018-03-11T17:15:15Z (7 years ago)
- Children:
- 12ae6d8
- Parents:
- 615e83d
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-11 17:07:39)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-11 17:15:15)
- Location:
- uspace/lib/c
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/abs32le/src/fibril.c
r615e83d r55f068c 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; -
uspace/lib/c/arch/amd64/src/fibril.S
r615e83d r55f068c 35 35 # 36 36 # Save CPU context to context_t variable 37 # pointed by the 1st argument. Returns 0 in EAX.37 # pointed by the 1st argument. Returns 0 in RAX. 38 38 # 39 FUNCTION_BEGIN( setjmp)39 FUNCTION_BEGIN(__setjmp) 40 40 movq (%rsp), %rdx # the caller's return %eip 41 41 … … 54 54 movq %rax, CONTEXT_OFFSET_TLS(%rdi) 55 55 56 xorq %rax, %rax # setjmp returns 056 xorq %rax, %rax # __setjmp returns 0 57 57 ret 58 FUNCTION_END( setjmp)58 FUNCTION_END(__setjmp) 59 59 60 60 ## Restore current CPU context 61 61 # 62 62 # Restore CPU context from context_t variable 63 # pointed by the 1st argument. Returns RSI in EAX.63 # pointed by the 1st argument. Returns second argument in RAX. 64 64 # 65 65 FUNCTION_BEGIN(__longjmp) -
uspace/lib/c/arch/arm32/src/fibril.S
r615e83d r55f068c 31 31 .text 32 32 33 FUNCTION_BEGIN( setjmp)33 FUNCTION_BEGIN(__setjmp) 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(__setjmp) 41 41 42 42 FUNCTION_BEGIN(__longjmp) -
uspace/lib/c/arch/ia32/src/fibril.S
r615e83d r55f068c 37 37 # pointed by the 1st argument. Returns 0 in EAX. 38 38 # 39 FUNCTION_BEGIN( setjmp)39 FUNCTION_BEGIN(__setjmp) 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 … … 53 53 movl %eax, CONTEXT_OFFSET_TLS(%edx) # tls -> ctx->tls 54 54 55 xorl %eax, %eax # setjmp returns 055 xorl %eax, %eax # __setjmp returns 0 56 56 ret 57 FUNCTION_END( setjmp)57 FUNCTION_END(__setjmp) 58 58 59 59 ## Restore saved CPU context -
uspace/lib/c/arch/ia64/include/libarch/fibril.h
r615e83d r55f068c 43 43 44 44 /* 45 * setjmp() and __longjmp() are both leaf procedures.45 * __setjmp() and __longjmp() are both leaf procedures. 46 46 * No need to allocate scratch area. 47 47 */ -
uspace/lib/c/arch/ia64/src/fibril.S
r615e83d r55f068c 32 32 .text 33 33 34 FUNCTION_BEGIN( setjmp)34 FUNCTION_BEGIN(__setjmp) 35 35 alloc loc0 = ar.pfs, 1, 49, 0, 0 36 36 mov loc1 = ar.unat ;; … … 178 178 mov ar.unat = loc1 179 179 180 mov r8 = 0 /* setjmp returns 0 */180 mov r8 = 0 /* __setjmp returns 0 */ 181 181 br.ret.sptk.many b0 182 FUNCTION_END( setjmp)182 FUNCTION_END(__setjmp) 183 183 184 184 FUNCTION_BEGIN(__longjmp) -
uspace/lib/c/arch/mips32/src/fibril.S
r615e83d r55f068c 35 35 #include <libarch/fibril_context.h> 36 36 37 FUNCTION_BEGIN( setjmp)37 FUNCTION_BEGIN(__setjmp) 38 38 sw $s0, CONTEXT_OFFSET_S0($a0) 39 39 sw $s1, CONTEXT_OFFSET_S1($a0) … … 87 87 sw $sp, CONTEXT_OFFSET_SP($a0) 88 88 89 # setjmp returns 089 # __setjmp returns 0 90 90 j $ra 91 91 li $v0, 0 92 FUNCTION_END( setjmp)92 FUNCTION_END(__setjmp) 93 93 94 94 FUNCTION_BEGIN(__longjmp) -
uspace/lib/c/arch/ppc32/src/fibril.S
r615e83d r55f068c 33 33 #include <libarch/fibril_context.h> 34 34 35 FUNCTION_BEGIN( setjmp)35 FUNCTION_BEGIN(__setjmp) 36 36 stw sp, CONTEXT_OFFSET_SP(r3) 37 37 stw r2, CONTEXT_OFFSET_TLS(r3) … … 62 62 stw r4, CONTEXT_OFFSET_CR(r3) 63 63 64 # setjmp returns 064 # __setjmp returns 0 65 65 li r3, 0 66 66 blr 67 FUNCTION_END( setjmp)67 FUNCTION_END(__setjmp) 68 68 69 69 FUNCTION_BEGIN(__longjmp) -
uspace/lib/c/arch/riscv64/src/fibril.c
r615e83d r55f068c 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; -
uspace/lib/c/arch/sparc64/src/fibril.S
r615e83d r55f068c 32 32 .text 33 33 34 FUNCTION_BEGIN( setjmp)34 FUNCTION_BEGIN(__setjmp) 35 35 # 36 36 # We rely on the kernel to flush our active register windows to memory … … 57 57 stx %g7, [%o0 + CONTEXT_OFFSET_TP] 58 58 retl 59 mov 0, %o0 ! setjmp returns 060 FUNCTION_END( setjmp)59 mov 0, %o0 ! __setjmp returns 0 60 FUNCTION_END(__setjmp) 61 61 62 62 FUNCTION_BEGIN(__longjmp) -
uspace/lib/c/generic/context.c
r615e83d r55f068c 43 43 void context_swap(context_t *self, context_t *other) 44 44 { 45 if (! setjmp(self))45 if (!__setjmp(self)) 46 46 __longjmp(other, 1); 47 47 } … … 49 49 void context_create(context_t *context, const context_create_t *arg) 50 50 { 51 setjmp(context);51 __setjmp(context); 52 52 context_set(context, FADDR(arg->fn), arg->stack_base, 53 53 arg->stack_size, arg->tls); -
uspace/lib/c/include/setjmp.h
r615e83d r55f068c 38 38 typedef context_t jmp_buf[1]; 39 39 40 extern int setjmp(jmp_buf) __attribute__((returns_twice)); 41 extern void longjmp(jmp_buf, int) __attribute__((noreturn)); 42 extern void __longjmp(jmp_buf, int) __attribute__((noreturn)); 40 extern int __setjmp(jmp_buf) __attribute__((returns_twice)); 41 extern _Noreturn void __longjmp(jmp_buf, int); 42 43 #define setjmp __setjmp 44 extern _Noreturn void longjmp(jmp_buf, int); 43 45 44 46 #endif
Note:
See TracChangeset
for help on using the changeset viewer.