2003-06-18 03:38:07 +00:00
|
|
|
/* Set up a context to call a function.
|
2014-01-01 11:03:15 +00:00
|
|
|
Copyright (C) 2002-2014 Free Software Foundation, Inc.
|
2003-06-18 03:38:07 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2003-06-18 03:38:07 +00:00
|
|
|
|
|
|
|
#include <sysdep.h>
|
2003-09-24 03:22:56 +00:00
|
|
|
#include <shlib-compat.h>
|
2003-06-18 03:38:07 +00:00
|
|
|
|
|
|
|
#define __ASSEMBLY__
|
|
|
|
#include <asm/ptrace.h>
|
|
|
|
#include "ucontext_i.h"
|
|
|
|
|
|
|
|
ENTRY(__makecontext)
|
|
|
|
/* Set up the first 7 args to the function in its registers */
|
2006-12-19 15:34:16 +00:00
|
|
|
lwz r11,_UC_REGS_PTR(r3)
|
2003-09-24 03:22:56 +00:00
|
|
|
stw r6,_UC_GREGS+(PT_R3*4)(r11)
|
|
|
|
stw r7,_UC_GREGS+(PT_R4*4)(r11)
|
|
|
|
stw r8,_UC_GREGS+(PT_R5*4)(r11)
|
|
|
|
stw r9,_UC_GREGS+(PT_R6*4)(r11)
|
|
|
|
stw r10,_UC_GREGS+(PT_R7*4)(r11)
|
2003-06-18 03:38:07 +00:00
|
|
|
lwz r8,8(r1)
|
|
|
|
lwz r9,12(r1)
|
2003-09-24 03:22:56 +00:00
|
|
|
stw r8,_UC_GREGS+(PT_R8*4)(r11)
|
|
|
|
stw r9,_UC_GREGS+(PT_R9*4)(r11)
|
2003-06-18 03:38:07 +00:00
|
|
|
|
|
|
|
/* Set the NIP to the start of the function */
|
2003-09-24 03:22:56 +00:00
|
|
|
stw r4,_UC_GREGS+(PT_NIP*4)(r11)
|
2003-06-18 03:38:07 +00:00
|
|
|
|
|
|
|
/* Set the function's r31 to ucp->uc_link for the exitcode below. */
|
|
|
|
lwz r7,_UC_LINK(r3)
|
2003-09-24 03:22:56 +00:00
|
|
|
stw r7,_UC_GREGS+(PT_R31*4)(r11)
|
2003-06-18 03:38:07 +00:00
|
|
|
|
|
|
|
/* Set the function's LR to point to the exitcode below. */
|
|
|
|
#ifdef PIC
|
|
|
|
mflr r0
|
2006-01-07 03:58:05 +00:00
|
|
|
cfi_register(lr,r0)
|
2013-08-17 09:06:45 +00:00
|
|
|
/* Use this conditional form of branch and link to avoid destroying
|
|
|
|
the cpu link stack used to predict blr return addresses. */
|
|
|
|
bcl 20,31,1f
|
2003-06-18 03:38:07 +00:00
|
|
|
1: mflr r6
|
|
|
|
addi r6,r6,L(exitcode)-1b
|
|
|
|
mtlr r0
|
2006-01-07 03:58:05 +00:00
|
|
|
cfi_same_value (lr)
|
2003-06-18 03:38:07 +00:00
|
|
|
#else
|
|
|
|
lis r6,L(exitcode)@ha
|
|
|
|
addi r6,r6,L(exitcode)@l
|
|
|
|
#endif
|
2003-09-24 03:22:56 +00:00
|
|
|
stw r6,_UC_GREGS+(PT_LNK*4)(r11)
|
2003-06-18 03:38:07 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Set up the stack frame for the function.
|
|
|
|
* If we have more than 5 args to the function (8 args to makecontext),
|
|
|
|
* there will be some arguments on the stack which have to end up
|
|
|
|
* in registers. If there are more than 8 args to the function,
|
|
|
|
* we have to copy (argc - 8) args from our stack to the functions'
|
|
|
|
* stack (and allow space for them in the frame).
|
|
|
|
*/
|
|
|
|
lwz r4,_UC_STACK_SP(r3)
|
|
|
|
lwz r8,_UC_STACK_SIZE(r3)
|
|
|
|
add r4,r4,r8
|
|
|
|
rlwinm r4,r4,0,0,27 /* round down to 16-byte boundary */
|
|
|
|
addi r7,r4,-16 /* stack frame for fn's caller */
|
|
|
|
cmpwi r5,8
|
|
|
|
blt 2f /* less than 8 args is easy */
|
|
|
|
lwz r10,16(r1)
|
2003-09-24 03:22:56 +00:00
|
|
|
stw r10,_UC_GREGS+(PT_R10*4)(r11)
|
2003-06-18 03:38:07 +00:00
|
|
|
beq 2f /* if exactly 8 args */
|
|
|
|
subi r9,r5,3
|
|
|
|
subi r5,r5,8
|
|
|
|
rlwinm r9,r9,2,0,27
|
|
|
|
subf r7,r9,r4
|
|
|
|
mtctr r5 /* copy the 9th and following args */
|
|
|
|
addi r6,r1,16
|
|
|
|
addi r8,r7,4
|
|
|
|
3: lwzu r10,4(r6)
|
|
|
|
stwu r10,4(r8)
|
|
|
|
bdnz 3b
|
2003-09-24 03:22:56 +00:00
|
|
|
2: stw r7,_UC_GREGS+(PT_R1*4)(r11)
|
2003-06-18 03:38:07 +00:00
|
|
|
li r6,0
|
|
|
|
stw r6,0(r7)
|
|
|
|
|
|
|
|
blr
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If the function returns, it comes here. We put ucp->uc_link in
|
|
|
|
* r31, which is a callee-saved register. We have to continue with
|
|
|
|
* the context that r31 points to, or exit if it is 0.
|
|
|
|
*/
|
|
|
|
L(exitcode):
|
|
|
|
mr. r3,r31
|
|
|
|
beq 4f
|
2005-05-21 19:29:13 +00:00
|
|
|
bl __setcontext@local
|
2003-06-18 03:38:07 +00:00
|
|
|
4: bl HIDDEN_JUMPTARGET(exit)
|
|
|
|
b 4b
|
|
|
|
|
|
|
|
END(__makecontext)
|
2003-09-24 03:22:56 +00:00
|
|
|
|
Update.
2004-01-14 Steven Munroe <sjmunroe@us.ibm.com>
* include/libc-symbols.h [HAVE_ASM_GLOBAL_DOT_NAME]
(_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed symbols.
(_default_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed
symbols.
* sysdeps/powerpc/Makefile: Add rtld-global-offsets.sym to
gen-as-const-headers.
* sysdeps/powerpc/elf/rtld-global-offsets.sym: New file.
* sysdeps/powerpc/sysdep.h: Define v# symbols for vector registers.
Define PPC_FEATURE_* masks for Aux Vector AT_HWCAP.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_SWAPCONTEXT_SYSCALL): Define for PPC and 2.6.0 kernels.
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h [!__WORDSIZE == 32]:
Declare mcontext_t inline and include altivec state for 64-bit.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, and swapcontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
(__makecontext): Use parm save area instead of compiler_dw to hold
context pointer.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_swapcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h
(SIGCONTEXT_V_REGS_PTR, SIGCONTEXT_V_RESERVE): Defined.
2004-01-12 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
(__makecontext): Upgrade to align for Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_makecontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)]
(__novec_swapcontext): Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h:
(_UC_VSCR, _UC_VRSAVE): Define.
(_FRAME_BACKCHAIN, _FRAME_LR_SAVE,_FRAME_PARM_SAVE1,_FRAME_PARM_SAVE2,
_FRAME_PARM_SAVE3, _FRAME_PARM_SAVE4): Defined.
2004-01-16 04:50:59 +00:00
|
|
|
versioned_symbol (libc, __makecontext, makecontext, GLIBC_2_3_4)
|
|
|
|
|
|
|
|
#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
|
|
|
|
|
2004-03-10 19:28:58 +00:00
|
|
|
compat_text_section
|
Update.
2004-01-14 Steven Munroe <sjmunroe@us.ibm.com>
* include/libc-symbols.h [HAVE_ASM_GLOBAL_DOT_NAME]
(_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed symbols.
(_default_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed
symbols.
* sysdeps/powerpc/Makefile: Add rtld-global-offsets.sym to
gen-as-const-headers.
* sysdeps/powerpc/elf/rtld-global-offsets.sym: New file.
* sysdeps/powerpc/sysdep.h: Define v# symbols for vector registers.
Define PPC_FEATURE_* masks for Aux Vector AT_HWCAP.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_SWAPCONTEXT_SYSCALL): Define for PPC and 2.6.0 kernels.
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h [!__WORDSIZE == 32]:
Declare mcontext_t inline and include altivec state for 64-bit.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, and swapcontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
(__makecontext): Use parm save area instead of compiler_dw to hold
context pointer.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_swapcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h
(SIGCONTEXT_V_REGS_PTR, SIGCONTEXT_V_RESERVE): Defined.
2004-01-12 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
(__makecontext): Upgrade to align for Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_makecontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)]
(__novec_swapcontext): Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h:
(_UC_VSCR, _UC_VRSAVE): Define.
(_FRAME_BACKCHAIN, _FRAME_LR_SAVE,_FRAME_PARM_SAVE1,_FRAME_PARM_SAVE2,
_FRAME_PARM_SAVE3, _FRAME_PARM_SAVE4): Defined.
2004-01-16 04:50:59 +00:00
|
|
|
ENTRY(__novec_makecontext)
|
|
|
|
/* Set up the first 7 args to the function in its registers */
|
|
|
|
addi r11,r3,_UC_REG_SPACE
|
|
|
|
stw r11,_UC_REGS_PTR(r3)
|
|
|
|
stw r6,_UC_GREGS+(PT_R3*4)(r11)
|
|
|
|
stw r7,_UC_GREGS+(PT_R4*4)(r11)
|
|
|
|
stw r8,_UC_GREGS+(PT_R5*4)(r11)
|
|
|
|
stw r9,_UC_GREGS+(PT_R6*4)(r11)
|
|
|
|
stw r10,_UC_GREGS+(PT_R7*4)(r11)
|
|
|
|
lwz r8,8(r1)
|
|
|
|
lwz r9,12(r1)
|
|
|
|
stw r8,_UC_GREGS+(PT_R8*4)(r11)
|
|
|
|
stw r9,_UC_GREGS+(PT_R9*4)(r11)
|
|
|
|
|
|
|
|
/* Set the NIP to the start of the function */
|
|
|
|
stw r4,_UC_GREGS+(PT_NIP*4)(r11)
|
|
|
|
|
|
|
|
/* Set the function's r31 to ucp->uc_link for the exitcode below. */
|
|
|
|
lwz r7,_UC_LINK(r3)
|
|
|
|
stw r7,_UC_GREGS+(PT_R31*4)(r11)
|
|
|
|
|
|
|
|
/* Set the function's LR to point to the exitcode below. */
|
|
|
|
#ifdef PIC
|
|
|
|
mflr r0
|
2006-01-07 03:58:05 +00:00
|
|
|
cfi_register(lr,r0)
|
2013-08-17 09:06:45 +00:00
|
|
|
/* Use this conditional form of branch and link to avoid destroying
|
|
|
|
the cpu link stack used to predict blr return addresses. */
|
|
|
|
bcl 20,31,1f
|
Update.
2004-01-14 Steven Munroe <sjmunroe@us.ibm.com>
* include/libc-symbols.h [HAVE_ASM_GLOBAL_DOT_NAME]
(_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed symbols.
(_default_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed
symbols.
* sysdeps/powerpc/Makefile: Add rtld-global-offsets.sym to
gen-as-const-headers.
* sysdeps/powerpc/elf/rtld-global-offsets.sym: New file.
* sysdeps/powerpc/sysdep.h: Define v# symbols for vector registers.
Define PPC_FEATURE_* masks for Aux Vector AT_HWCAP.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_SWAPCONTEXT_SYSCALL): Define for PPC and 2.6.0 kernels.
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h [!__WORDSIZE == 32]:
Declare mcontext_t inline and include altivec state for 64-bit.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, and swapcontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
(__makecontext): Use parm save area instead of compiler_dw to hold
context pointer.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_swapcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h
(SIGCONTEXT_V_REGS_PTR, SIGCONTEXT_V_RESERVE): Defined.
2004-01-12 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
(__makecontext): Upgrade to align for Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_makecontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)]
(__novec_swapcontext): Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h:
(_UC_VSCR, _UC_VRSAVE): Define.
(_FRAME_BACKCHAIN, _FRAME_LR_SAVE,_FRAME_PARM_SAVE1,_FRAME_PARM_SAVE2,
_FRAME_PARM_SAVE3, _FRAME_PARM_SAVE4): Defined.
2004-01-16 04:50:59 +00:00
|
|
|
1: mflr r6
|
|
|
|
addi r6,r6,L(novec_exitcode)-1b
|
|
|
|
mtlr r0
|
2006-01-07 03:58:05 +00:00
|
|
|
cfi_same_value (lr)
|
Update.
2004-01-14 Steven Munroe <sjmunroe@us.ibm.com>
* include/libc-symbols.h [HAVE_ASM_GLOBAL_DOT_NAME]
(_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed symbols.
(_default_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed
symbols.
* sysdeps/powerpc/Makefile: Add rtld-global-offsets.sym to
gen-as-const-headers.
* sysdeps/powerpc/elf/rtld-global-offsets.sym: New file.
* sysdeps/powerpc/sysdep.h: Define v# symbols for vector registers.
Define PPC_FEATURE_* masks for Aux Vector AT_HWCAP.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_SWAPCONTEXT_SYSCALL): Define for PPC and 2.6.0 kernels.
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h [!__WORDSIZE == 32]:
Declare mcontext_t inline and include altivec state for 64-bit.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, and swapcontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
(__makecontext): Use parm save area instead of compiler_dw to hold
context pointer.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_swapcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h
(SIGCONTEXT_V_REGS_PTR, SIGCONTEXT_V_RESERVE): Defined.
2004-01-12 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
(__makecontext): Upgrade to align for Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_makecontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)]
(__novec_swapcontext): Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h:
(_UC_VSCR, _UC_VRSAVE): Define.
(_FRAME_BACKCHAIN, _FRAME_LR_SAVE,_FRAME_PARM_SAVE1,_FRAME_PARM_SAVE2,
_FRAME_PARM_SAVE3, _FRAME_PARM_SAVE4): Defined.
2004-01-16 04:50:59 +00:00
|
|
|
#else
|
|
|
|
lis r6,L(novec_exitcode)@ha
|
|
|
|
addi r6,r6,L(novec_exitcode)@l
|
|
|
|
#endif
|
|
|
|
stw r6,_UC_GREGS+(PT_LNK*4)(r11)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set up the stack frame for the function.
|
|
|
|
* If we have more than 5 args to the function (8 args to makecontext),
|
|
|
|
* there will be some arguments on the stack which have to end up
|
|
|
|
* in registers. If there are more than 8 args to the function,
|
|
|
|
* we have to copy (argc - 8) args from our stack to the functions'
|
|
|
|
* stack (and allow space for them in the frame).
|
|
|
|
*/
|
|
|
|
lwz r4,_UC_STACK_SP(r3)
|
|
|
|
lwz r8,_UC_STACK_SIZE(r3)
|
|
|
|
add r4,r4,r8
|
|
|
|
rlwinm r4,r4,0,0,27 /* round down to 16-byte boundary */
|
|
|
|
addi r7,r4,-16 /* stack frame for fn's caller */
|
|
|
|
cmpwi r5,8
|
|
|
|
blt 2f /* less than 8 args is easy */
|
|
|
|
lwz r10,16(r1)
|
|
|
|
stw r10,_UC_GREGS+(PT_R10*4)(r11)
|
|
|
|
beq 2f /* if exactly 8 args */
|
|
|
|
subi r9,r5,3
|
|
|
|
subi r5,r5,8
|
|
|
|
rlwinm r9,r9,2,0,27
|
|
|
|
subf r7,r9,r4
|
|
|
|
mtctr r5 /* copy the 9th and following args */
|
|
|
|
addi r6,r1,16
|
|
|
|
addi r8,r7,4
|
|
|
|
3: lwzu r10,4(r6)
|
|
|
|
stwu r10,4(r8)
|
|
|
|
bdnz 3b
|
|
|
|
2: stw r7,_UC_GREGS+(PT_R1*4)(r11)
|
|
|
|
li r6,0
|
|
|
|
stw r6,0(r7)
|
|
|
|
|
|
|
|
blr
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If the function returns, it comes here. We put ucp->uc_link in
|
|
|
|
* r31, which is a callee-saved register. We have to continue with
|
|
|
|
* the context that r31 points to, or exit if it is 0.
|
|
|
|
*/
|
|
|
|
L(novec_exitcode):
|
|
|
|
mr. r3,r31
|
|
|
|
beq 4f
|
2005-05-21 19:29:13 +00:00
|
|
|
bl __novec_setcontext@local
|
Update.
2004-01-14 Steven Munroe <sjmunroe@us.ibm.com>
* include/libc-symbols.h [HAVE_ASM_GLOBAL_DOT_NAME]
(_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed symbols.
(_default_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed
symbols.
* sysdeps/powerpc/Makefile: Add rtld-global-offsets.sym to
gen-as-const-headers.
* sysdeps/powerpc/elf/rtld-global-offsets.sym: New file.
* sysdeps/powerpc/sysdep.h: Define v# symbols for vector registers.
Define PPC_FEATURE_* masks for Aux Vector AT_HWCAP.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_SWAPCONTEXT_SYSCALL): Define for PPC and 2.6.0 kernels.
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h [!__WORDSIZE == 32]:
Declare mcontext_t inline and include altivec state for 64-bit.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, and swapcontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
(__makecontext): Use parm save area instead of compiler_dw to hold
context pointer.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_swapcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h
(SIGCONTEXT_V_REGS_PTR, SIGCONTEXT_V_RESERVE): Defined.
2004-01-12 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
(__makecontext): Upgrade to align for Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_makecontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)]
(__novec_swapcontext): Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h:
(_UC_VSCR, _UC_VRSAVE): Define.
(_FRAME_BACKCHAIN, _FRAME_LR_SAVE,_FRAME_PARM_SAVE1,_FRAME_PARM_SAVE2,
_FRAME_PARM_SAVE3, _FRAME_PARM_SAVE4): Defined.
2004-01-16 04:50:59 +00:00
|
|
|
4: bl HIDDEN_JUMPTARGET(exit)
|
|
|
|
b 4b
|
|
|
|
|
2004-03-10 19:28:58 +00:00
|
|
|
END(__novec_makecontext)
|
|
|
|
.previous
|
Update.
2004-01-14 Steven Munroe <sjmunroe@us.ibm.com>
* include/libc-symbols.h [HAVE_ASM_GLOBAL_DOT_NAME]
(_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed symbols.
(_default_symbol_version): Use C_SYMBOL_DOT_NAME to create '.'ed
symbols.
* sysdeps/powerpc/Makefile: Add rtld-global-offsets.sym to
gen-as-const-headers.
* sysdeps/powerpc/elf/rtld-global-offsets.sym: New file.
* sysdeps/powerpc/sysdep.h: Define v# symbols for vector registers.
Define PPC_FEATURE_* masks for Aux Vector AT_HWCAP.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_SWAPCONTEXT_SYSCALL): Define for PPC and 2.6.0 kernels.
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h [!__WORDSIZE == 32]:
Declare mcontext_t inline and include altivec state for 64-bit.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, and swapcontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
(__makecontext): Use parm save area instead of compiler_dw to hold
context pointer.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)](__novec_swapcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h
(SIGCONTEXT_V_REGS_PTR, SIGCONTEXT_V_RESERVE): Defined.
2004-01-12 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions: Add GLIBC_2.3.4
versions for setcontext, getcontext, swapcontext, and makecontext.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
(__getcontext): Upgrade to save Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_getcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
(__makecontext): Upgrade to align for Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_makecontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
(__setcontext): Upgrade to restore Altivec regs and version
GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)](__novec_setcontext):
Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
(__swapcontext): Upgrade to swap Altivec regs and version GLIBC_2_3_4.
[SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)]
(__novec_swapcontext): Compatible with GLIBC_2.3.3 release.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h:
(_UC_VSCR, _UC_VRSAVE): Define.
(_FRAME_BACKCHAIN, _FRAME_LR_SAVE,_FRAME_PARM_SAVE1,_FRAME_PARM_SAVE2,
_FRAME_PARM_SAVE3, _FRAME_PARM_SAVE4): Defined.
2004-01-16 04:50:59 +00:00
|
|
|
|
|
|
|
compat_symbol (libc, __novec_makecontext, makecontext, GLIBC_2_3_3)
|
|
|
|
#endif
|
2003-09-24 03:22:56 +00:00
|
|
|
|
|
|
|
#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3)
|
|
|
|
|
|
|
|
#define _ERRNO_H 1
|
|
|
|
#include <bits/errno.h>
|
|
|
|
|
2004-03-10 19:28:58 +00:00
|
|
|
compat_text_section
|
2003-09-24 03:22:56 +00:00
|
|
|
ENTRY (__makecontext_stub)
|
|
|
|
li r3,ENOSYS
|
2005-05-21 19:29:13 +00:00
|
|
|
b __syscall_error@local
|
2004-03-10 19:28:58 +00:00
|
|
|
END (__makecontext_stub)
|
|
|
|
.previous
|
2003-09-24 03:22:56 +00:00
|
|
|
|
|
|
|
compat_symbol (libc, __makecontext_stub, makecontext, GLIBC_2_1)
|
|
|
|
|
|
|
|
#endif
|