1 --- cvs/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions 2003-08-25 13:15:36.000000000 +1000
2 +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions 2003-09-23 18:19:41.000000000 +1000
6 posix_fadvise64; posix_fallocate64;
7 + setcontext; getcontext; swapcontext; makecontext;
10 --- cvs/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S 2003-06-18 13:36:23.000000000 +1000
11 +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S 2003-09-23 19:15:38.000000000 +1000
16 +#include <shlib-compat.h>
19 #include <asm/ptrace.h>
20 #include "ucontext_i.h"
24 + * Since we are not attempting to save the altivec registers,
25 + * there is no need to get the register storage space
26 + * aligned on a 16-byte boundary.
28 + addi r3,r3,_UC_REG_SPACE
29 + stw r3,_UC_REGS_PTR - _UC_REG_SPACE(r3)
30 stw r0,_UC_GREGS+(PT_R0*4)(r3)
31 stw r1,_UC_GREGS+(PT_R1*4)(r3)
34 stfd fp31,_UC_FREGS+(31*8)(r3)
35 stfd fp0,_UC_FREGS+(32*8)(r3)
37 - addi r5,r3,_UC_SIGMASK
38 + addi r5,r3,_UC_SIGMASK - _UC_REG_SPACE
41 bl JUMPTARGET(sigprocmask)
44 PSEUDO_END(__getcontext)
46 -weak_alias(__getcontext, getcontext)
47 +versioned_symbol (libc, __getcontext, getcontext, GLIBC_2_3_3)
49 +#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3)
52 +#include <bits/errno.h>
54 +ENTRY (__getcontext_stub)
56 + b JUMPTARGET(__syscall_error)
57 + END (__getcontext_stub)
59 +compat_symbol (libc, __getcontext_stub, getcontext, GLIBC_2_1)
62 --- cvs/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S 2003-06-18 13:36:38.000000000 +1000
63 +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S 2003-09-23 19:15:48.000000000 +1000
68 +#include <shlib-compat.h>
71 #include <asm/ptrace.h>
75 /* Set up the first 7 args to the function in its registers */
76 - stw r6,_UC_GREGS+(PT_R3*4)(r3)
77 - stw r7,_UC_GREGS+(PT_R4*4)(r3)
78 - stw r8,_UC_GREGS+(PT_R5*4)(r3)
79 - stw r9,_UC_GREGS+(PT_R6*4)(r3)
80 - stw r10,_UC_GREGS+(PT_R7*4)(r3)
81 + addi r11,r3,_UC_REG_SPACE
82 + stw r11,_UC_REGS_PTR(r3)
83 + stw r6,_UC_GREGS+(PT_R3*4)(r11)
84 + stw r7,_UC_GREGS+(PT_R4*4)(r11)
85 + stw r8,_UC_GREGS+(PT_R5*4)(r11)
86 + stw r9,_UC_GREGS+(PT_R6*4)(r11)
87 + stw r10,_UC_GREGS+(PT_R7*4)(r11)
90 - stw r8,_UC_GREGS+(PT_R8*4)(r3)
91 - stw r9,_UC_GREGS+(PT_R9*4)(r3)
92 + stw r8,_UC_GREGS+(PT_R8*4)(r11)
93 + stw r9,_UC_GREGS+(PT_R9*4)(r11)
95 /* Set the NIP to the start of the function */
96 - stw r4,_UC_GREGS+(PT_NIP*4)(r3)
97 + stw r4,_UC_GREGS+(PT_NIP*4)(r11)
99 /* Set the function's r31 to ucp->uc_link for the exitcode below. */
101 - stw r7,_UC_GREGS+(PT_R31*4)(r3)
102 + stw r7,_UC_GREGS+(PT_R31*4)(r11)
104 /* Set the function's LR to point to the exitcode below. */
107 lis r6,L(exitcode)@ha
108 addi r6,r6,L(exitcode)@l
110 - stw r6,_UC_GREGS+(PT_LNK*4)(r3)
111 + stw r6,_UC_GREGS+(PT_LNK*4)(r11)
114 * Set up the stack frame for the function.
117 blt 2f /* less than 8 args is easy */
119 - stw r10,_UC_GREGS+(PT_R10*4)(r3)
120 + stw r10,_UC_GREGS+(PT_R10*4)(r11)
121 beq 2f /* if exactly 8 args */
128 -2: stw r7,_UC_GREGS+(PT_R1*4)(r3)
129 +2: stw r7,_UC_GREGS+(PT_R1*4)(r11)
137 -weak_alias(__makecontext, makecontext)
139 +versioned_symbol (libc, __makecontext, makecontext, GLIBC_2_3_3)
141 +#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3)
144 +#include <bits/errno.h>
146 +ENTRY (__makecontext_stub)
148 + b JUMPTARGET(__syscall_error)
149 + END (__makecontext_stub)
151 +compat_symbol (libc, __makecontext_stub, makecontext, GLIBC_2_1)
154 --- cvs/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S 2003-06-18 13:36:57.000000000 +1000
155 +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S 2003-09-23 17:01:40.000000000 +1000
160 +#include <shlib-compat.h>
163 #include <asm/ptrace.h>
169 + lwz r31,_UC_REGS_PTR(r3)
172 * If this ucontext refers to the point where we were interrupted
177 -PSEUDO_END(__setcontext)
178 +PSEUDO_END (__setcontext)
180 -weak_alias(__setcontext, setcontext)
181 +versioned_symbol (libc, __setcontext, setcontext, GLIBC_2_3_3)
183 +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_3)
186 +#include <bits/errno.h>
188 +ENTRY (__setcontext_stub)
190 + b JUMPTARGET(__syscall_error)
191 + END (__setcontext_stub)
193 +compat_symbol (libc, __setcontext_stub, setcontext, GLIBC_2_0)
196 --- cvs/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S 2003-06-18 13:37:19.000000000 +1000
197 +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S 2003-09-23 19:15:56.000000000 +1000
202 +#include <shlib-compat.h>
205 #include <asm/ptrace.h>
209 /* Save the current context */
210 + addi r3,r3,_UC_REG_SPACE
211 + stw r3,_UC_REGS_PTR - _UC_REG_SPACE(r3)
212 stw r0,_UC_GREGS+(PT_R0*4)(r3)
213 stw r1,_UC_GREGS+(PT_R1*4)(r3)
216 stfd fp31,_UC_FREGS+(31*8)(r3)
217 stfd fp0,_UC_FREGS+(32*8)(r3)
219 - addi r5,r3,_UC_SIGMASK
220 + addi r5,r3,_UC_SIGMASK - _UC_REG_SPACE
221 addi r4,r4,_UC_SIGMASK
223 bl JUMPTARGET(sigprocmask)
225 * r0, xer, ctr. We don't restore r2 since it will be used as
229 + lwz r31,_UC_REGS_PTR(r31)
230 lwz r0,_UC_GREGS+(PT_MSR*4)(r31)
233 @@ -223,11 +228,25 @@
239 li r0,SYS_ify(rt_sigreturn)
243 PSEUDO_END(__swapcontext)
245 -weak_alias(__swapcontext, swapcontext)
246 +versioned_symbol (libc, __swapcontext, swapcontext, GLIBC_2_3_3)
248 +#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3)
251 +#include <bits/errno.h>
253 +ENTRY (__swapcontext_stub)
255 + b JUMPTARGET(__syscall_error)
256 + END (__swapcontext_stub)
258 +compat_symbol (libc, __swapcontext_stub, swapcontext, GLIBC_2_1)
261 --- cvs/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h 2003-06-18 13:37:33.000000000 +1000
262 +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h 2003-09-11 16:48:08.000000000 +1000
265 #define _UC_STACK_SP 8
266 #define _UC_STACK_SIZE 16
267 -#define _UC_SIGMASK 64
268 -#define _UC_GREGS 192
269 -#define _UC_FREGS 384
270 -#define _UC_VREGS 656
271 +#define _UC_REGS_PTR 48
272 +#define _UC_SIGMASK 52
273 +#define _UC_REG_SPACE 180
275 +/* offsets within mcontext_t */
277 +#define _UC_FREGS 192
278 +#define _UC_VREGS 464
279 --- cvs/libc/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h 2003-07-04 10:12:48.000000000 +1000
280 +++ libc/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h 2003-09-11 16:31:52.000000000 +1000
282 struct ucontext *uc_link;
285 - /* These fields are for backwards compatibility. */
287 + * These fields are set up this way to maximize source and
288 + * binary compatibility with code written for the old
289 + * ucontext_t definition, which didn't include space for the
292 + * Different versions of the kernel have stored the registers on
293 + * signal delivery at different offsets from the ucontext struct.
294 + * Programs should thus use the uc_mcontext.uc_regs pointer to
295 + * find where the registers are actually stored. The registers
296 + * will be stored within the ucontext_t struct but not necessarily
297 + * at a fixed address. As a side-effect, this lets us achieve
298 + * 16-byte alignment for the register storage space if the
299 + * Altivec registers are to be saved, without requiring 16-byte
300 + * alignment on the whole ucontext_t.
302 + * The uc_mcontext.regs field is included for source compatibility
303 + * with programs written against the older ucontext_t definition,
304 + * and its name should therefore not change. The uc_pad field
305 + * is for binary compatibility with programs compiled against the
306 + * old ucontext_t; it ensures that uc_mcontext.regs and uc_sigmask
307 + * are at the same offset as previously.
310 - mcontext_t *uc_regs;
311 - unsigned int uc_oldsigmask[2];
314 + union uc_regs_ptr {
315 + struct pt_regs *regs;
316 + mcontext_t *uc_regs;
318 + sigset_t uc_sigmask;
319 + char uc_reg_space[sizeof(mcontext_t) + 12]; /* last for extensibility */
322 mcontext_t uc_mcontext; /* last for extensibility */
326 #endif /* sys/ucontext.h */