forked from ariadne/libucontext
everywhere: rename __setcontext to libucontext_setcontext
parent
99ed5bbe12
commit
37fe7afd5f
|
@ -12,9 +12,9 @@
|
|||
|
||||
#include "defs.h"
|
||||
|
||||
ALIAS(setcontext, __setcontext)
|
||||
ALIAS(setcontext, libucontext_setcontext)
|
||||
|
||||
FUNC(__setcontext)
|
||||
FUNC(libucontext_setcontext)
|
||||
/* restore GPRs */
|
||||
ldp x18, x19, [x0, #REG_OFFSET(18)]
|
||||
ldp x20, x21, [x0, #REG_OFFSET(20)]
|
||||
|
@ -41,4 +41,4 @@ FUNC(__setcontext)
|
|||
|
||||
/* jump to new PC */
|
||||
br x16
|
||||
END(__setcontext)
|
||||
END(libucontext_setcontext)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
FUNC(libucontext_trampoline)
|
||||
/* get the proper context into position and test for NULL */
|
||||
mov x0, x19
|
||||
cbnz x0, __setcontext
|
||||
cbnz x0, libucontext_setcontext
|
||||
|
||||
/* something went wrong, exit */
|
||||
b exit
|
||||
|
|
|
@ -50,7 +50,7 @@ FUNC(__swapcontext)
|
|||
|
||||
/* move x1 to x0 and call setcontext */
|
||||
mov x0, x1
|
||||
bl __setcontext
|
||||
bl libucontext_setcontext
|
||||
|
||||
/* hmm, we came back here try to return */
|
||||
mov x30, x28
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
|
||||
#include "defs.h"
|
||||
|
||||
ALIAS(setcontext, __setcontext)
|
||||
ALIAS(setcontext, libucontext_setcontext)
|
||||
|
||||
FUNC(__setcontext)
|
||||
FUNC(libucontext_setcontext)
|
||||
/* copy all of the current registers into the ucontext structure */
|
||||
add r14, r0, #REG_OFFSET(0)
|
||||
ldmia r14, {r0-r12}
|
||||
|
@ -23,4 +23,4 @@ FUNC(__setcontext)
|
|||
|
||||
/* load link register and jump to new context */
|
||||
ldmia r14, {r14, pc}
|
||||
END(__setcontext)
|
||||
END(libucontext_setcontext)
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
libucontext_trampoline:
|
||||
/* get the proper context into position and test for NULL */
|
||||
movs r0, r4
|
||||
bne __setcontext@plt
|
||||
bne libucontext_setcontext@plt
|
||||
|
||||
/* we are returning into a null context, it seems, so maybe we should exit */
|
||||
b exit@plt
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
|
||||
#include "defs.h"
|
||||
|
||||
ALIAS(setcontext, __setcontext)
|
||||
ALIAS(setcontext, libucontext_setcontext)
|
||||
|
||||
FUNC(__setcontext)
|
||||
FUNC(libucontext_setcontext)
|
||||
move.l 4(%sp), %a0 /* load ucontext_t pointer from stack */
|
||||
|
||||
move.l REG_OFFSET(REG_SP)(%a0), %sp /* load new stack pointer */
|
||||
|
@ -27,4 +27,4 @@ FUNC(__setcontext)
|
|||
move.l REG_OFFSET(REG_PC)(%a0), %a1 /* load jump target */
|
||||
|
||||
jmp (%a1) /* jump to *$a1 */
|
||||
END(__setcontext)
|
||||
END(libucontext_setcontext)
|
||||
|
|
|
@ -18,7 +18,7 @@ FUNC(libucontext_trampoline)
|
|||
tst.l (%sp) /* test next content for NULL */
|
||||
jeq no_linked_context
|
||||
|
||||
jbsr __setcontext /* call setcontext */
|
||||
jbsr libucontext_setcontext /* call setcontext */
|
||||
move.l %d0, (%sp)
|
||||
|
||||
no_linked_context:
|
||||
|
|
|
@ -14,10 +14,10 @@ LOCALSZ = 1
|
|||
|
||||
#include "defs.h"
|
||||
|
||||
ALIAS(setcontext, __setcontext)
|
||||
ALIAS(setcontext, libucontext_setcontext)
|
||||
|
||||
FUNC(__setcontext)
|
||||
PUSH_FRAME(__setcontext)
|
||||
FUNC(libucontext_setcontext)
|
||||
PUSH_FRAME(libucontext_setcontext)
|
||||
|
||||
/* move the context to $v0 */
|
||||
move $v0, $a0
|
||||
|
@ -46,5 +46,5 @@ FUNC(__setcontext)
|
|||
move $v0, $zero
|
||||
jr $t9
|
||||
|
||||
POP_FRAME(__setcontext)
|
||||
END(__setcontext)
|
||||
POP_FRAME(libucontext_setcontext)
|
||||
END(libucontext_setcontext)
|
||||
|
|
|
@ -22,7 +22,7 @@ FUNC(libucontext_trampoline)
|
|||
|
||||
/* call setcontext */
|
||||
move $a0, $s0
|
||||
la $t9, __setcontext
|
||||
la $t9, libucontext_setcontext
|
||||
|
||||
jr $t9
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ LOCALSZ = 1
|
|||
|
||||
#include "defs.h"
|
||||
|
||||
ALIAS(setcontext, __setcontext)
|
||||
ALIAS(setcontext, libucontext_setcontext)
|
||||
|
||||
FUNC(__setcontext)
|
||||
PUSH_FRAME(__setcontext)
|
||||
FUNC(libucontext_setcontext)
|
||||
PUSH_FRAME(libucontext_setcontext)
|
||||
|
||||
/* move the context to $v0 */
|
||||
move $v0, $a0
|
||||
|
@ -50,5 +50,5 @@ FUNC(__setcontext)
|
|||
move $v0, $zero
|
||||
jr $t9
|
||||
|
||||
POP_FRAME(__setcontext)
|
||||
END(__setcontext)
|
||||
POP_FRAME(libucontext_setcontext)
|
||||
END(libucontext_setcontext)
|
||||
|
|
|
@ -22,7 +22,7 @@ FUNC(libucontext_trampoline)
|
|||
|
||||
/* call setcontext */
|
||||
move $a0, $s0
|
||||
dla $t9, __setcontext
|
||||
dla $t9, libucontext_setcontext
|
||||
|
||||
jr $t9
|
||||
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
* from the use of this software.
|
||||
*/
|
||||
|
||||
.global __setcontext
|
||||
.global libucontext_setcontext
|
||||
.hidden __swapcontext
|
||||
__setcontext:
|
||||
libucontext_setcontext:
|
||||
mr 4, 3
|
||||
li 3, 0
|
||||
b __swapcontext@local
|
||||
|
||||
.weak setcontext
|
||||
setcontext = __setcontext
|
||||
setcontext = libucontext_setcontext
|
||||
|
|
|
@ -19,7 +19,7 @@ libucontext_trampoline:
|
|||
beq no_linked_context
|
||||
|
||||
/* jump to setcontext */
|
||||
bl __setcontext@local
|
||||
bl libucontext_setcontext@local
|
||||
|
||||
no_linked_context:
|
||||
b exit@GOT
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
* from the use of this software.
|
||||
*/
|
||||
|
||||
.global __setcontext
|
||||
.global libucontext_setcontext
|
||||
.hidden __swapcontext
|
||||
__setcontext:
|
||||
addis 2, 12, .TOC.-__setcontext@ha
|
||||
addi 2, 12, .TOC.-__setcontext@l
|
||||
libucontext_setcontext:
|
||||
addis 2, 12, .TOC.-libucontext_setcontext@ha
|
||||
addi 2, 12, .TOC.-libucontext_setcontext@l
|
||||
|
||||
.localentry __setcontext,.-__setcontext
|
||||
.localentry libucontext_setcontext,.-libucontext_setcontext
|
||||
|
||||
mr 4, 3
|
||||
li 3, 0
|
||||
b __swapcontext
|
||||
|
||||
.weak setcontext
|
||||
setcontext = __setcontext
|
||||
setcontext = libucontext_setcontext
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
|
||||
#include "defs.h"
|
||||
|
||||
ALIAS(setcontext, __setcontext)
|
||||
ALIAS(setcontext, libucontext_setcontext)
|
||||
|
||||
FUNC(__setcontext)
|
||||
FUNC(libucontext_setcontext)
|
||||
/* move $a0 to $t0 to avoid clobbering. */
|
||||
mv t0, a0
|
||||
|
||||
|
@ -52,4 +52,4 @@ FUNC(__setcontext)
|
|||
|
||||
/* done saving, return */
|
||||
ret
|
||||
END(__setcontext)
|
||||
END(libucontext_setcontext)
|
||||
|
|
|
@ -21,7 +21,7 @@ FUNC(libucontext_trampoline)
|
|||
|
||||
/* if one is set, invoke it */
|
||||
mv a0, s2
|
||||
jal __setcontext
|
||||
jal libucontext_setcontext
|
||||
|
||||
/* otherwise, exit. */
|
||||
no_linked_context:
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
extern void libucontext_trampoline(void);
|
||||
extern int __setcontext(const ucontext_t *ucp);
|
||||
extern int libucontext_setcontext(const ucontext_t *ucp);
|
||||
|
||||
|
||||
void
|
||||
|
@ -37,7 +37,7 @@ libucontext_makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
|
|||
|
||||
ucp->uc_mcontext.gregs[7] = (uintptr_t) func;
|
||||
ucp->uc_mcontext.gregs[8] = (uintptr_t) ucp->uc_link;
|
||||
ucp->uc_mcontext.gregs[9] = (uintptr_t) &__setcontext;
|
||||
ucp->uc_mcontext.gregs[9] = (uintptr_t) &libucontext_setcontext;
|
||||
ucp->uc_mcontext.gregs[14] = (uintptr_t) &libucontext_trampoline;
|
||||
|
||||
va_start(va, argc);
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
|
||||
#include "defs.h"
|
||||
|
||||
ALIAS(setcontext, __setcontext)
|
||||
ALIAS(setcontext, libucontext_setcontext)
|
||||
|
||||
FUNC(__setcontext)
|
||||
FUNC(libucontext_setcontext)
|
||||
lgr %r1, %r2 /* use %r1 as our working register */
|
||||
|
||||
lam %a2, %a15, AREG_OFFSET(2)(%r1) /* load access registers, but skip %a0 and %a1 which are for TLS */
|
||||
lmg %r0, %r15, REG_OFFSET(0)(%r1) /* store general-purpose registers */
|
||||
|
||||
br %r14 /* return to new link register address */
|
||||
END(__setcontext)
|
||||
END(libucontext_setcontext)
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
|
||||
#include "defs.h"
|
||||
|
||||
ALIAS(setcontext, __setcontext)
|
||||
ALIAS(setcontext, libucontext_setcontext)
|
||||
|
||||
FUNC(__setcontext)
|
||||
FUNC(libucontext_setcontext)
|
||||
/* load address of the ucontext structure */
|
||||
movl 4(%esp), %eax
|
||||
|
||||
|
@ -41,4 +41,4 @@ FUNC(__setcontext)
|
|||
movl REG_OFFSET(REG_EAX)(%eax), %eax
|
||||
|
||||
ret
|
||||
END(__setcontext)
|
||||
END(libucontext_setcontext)
|
||||
|
|
|
@ -17,7 +17,7 @@ FUNC(libucontext_trampoline)
|
|||
leal (%esp,%ebx,4), %esp
|
||||
cmpl $0, (%esp)
|
||||
|
||||
/* restore global offset table, exit@plt and __setcontext@plt need this */
|
||||
/* restore global offset table, exit@plt and libucontext_setcontext@plt need this */
|
||||
call __i686.get_pc_thunk.bx
|
||||
addl $_GLOBAL_OFFSET_TABLE_, %ebx
|
||||
|
||||
|
@ -25,7 +25,7 @@ FUNC(libucontext_trampoline)
|
|||
je no_linked_context
|
||||
|
||||
/* call setcontext to switch to the linked context */
|
||||
call __setcontext@plt
|
||||
call libucontext_setcontext@plt
|
||||
movl %eax, (%esp)
|
||||
|
||||
no_linked_context:
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
|
||||
#include "defs.h"
|
||||
|
||||
ALIAS(setcontext, __setcontext)
|
||||
ALIAS(setcontext, libucontext_setcontext)
|
||||
|
||||
FUNC(__setcontext)
|
||||
FUNC(libucontext_setcontext)
|
||||
/* set all of the registers */
|
||||
movq REG_OFFSET(REG_R8)(%rdi), %r8
|
||||
movq REG_OFFSET(REG_R9)(%rdi), %r9
|
||||
|
@ -42,4 +42,4 @@ FUNC(__setcontext)
|
|||
/* we're all done here, return 0 */
|
||||
xorl %eax, %eax
|
||||
ret
|
||||
END(__setcontext)
|
||||
END(libucontext_setcontext)
|
||||
|
|
|
@ -22,7 +22,7 @@ FUNC(libucontext_trampoline)
|
|||
je no_linked_context
|
||||
|
||||
/* call setcontext to switch to the linked context */
|
||||
call __setcontext@plt
|
||||
call libucontext_setcontext@plt
|
||||
movq %rax, %rdi
|
||||
|
||||
no_linked_context:
|
||||
|
|
Loading…
Reference in New Issue