/[vps]/dietlibc/patches/0.30-r2/150_ppc_rename-powerpc.patch
Gentoo

Contents of /dietlibc/patches/0.30-r2/150_ppc_rename-powerpc.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 469 - (show annotations) (download)
Fri Sep 8 06:55:07 2006 UTC (7 years, 10 months ago) by hollow
File size: 41044 byte(s)
reorder, update readme
1 diff -NurpP dietlibc-0.30-execstack/diet.c dietlibc-0.30-ppc-rename/diet.c
2 --- dietlibc-0.30-execstack/diet.c 2006-04-04 05:47:21.000000000 +0200
3 +++ dietlibc-0.30-ppc-rename/diet.c 2006-09-07 12:32:01.080419500 +0200
4 @@ -35,7 +35,7 @@ static const char* Os[] = {
5 "arm","-Os","-fomit-frame-pointer",0,
6 "mips","-Os","-fomit-frame-pointer","-mno-abicalls","-fno-pic","-G","0",0,
7 "mipsel","-Os","-fomit-frame-pointer","-mno-abicalls","-fno-pic","-G","0",0,
8 - "ppc","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
9 + "powerpc","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
10 "ppc64","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
11 "s390","-Os","-fomit-frame-pointer",0,
12 "s390x","-Os","-fomit-frame-pointer",0,
13 @@ -151,7 +151,7 @@ int main(int argc,char *argv[]) {
14 #endif
15 #endif
16 #ifdef __powerpc__
17 - shortplatform="ppc";
18 + shortplatform="powerpc";
19 #endif
20 #ifdef __powerpc64__
21 shortplatform="ppc64";
22 diff -NurpP dietlibc-0.30-execstack/Makefile dietlibc-0.30-ppc-rename/Makefile
23 --- dietlibc-0.30-execstack/Makefile 2006-06-18 20:32:28.000000000 +0200
24 +++ dietlibc-0.30-ppc-rename/Makefile 2006-09-07 12:44:19.878766750 +0200
25 @@ -24,7 +24,11 @@ ifeq ($(MYARCH),alpha)
26 ARCH=alpha
27 else
28 ifeq ($(MYARCH),ppc)
29 -ARCH=ppc
30 +ARCH=powerpc
31 +MYARCH=powerpc
32 +else
33 +ifeq ($(MYARCH),powerpc)
34 +ARCH=powerpc
35 else
36 ifeq ($(MYARCH),ppc64)
37 ARCH=ppc64
38 @@ -80,6 +84,7 @@ endif
39 endif
40 endif
41 endif
42 +endif
43
44 # ARCH=$(MYARCH)
45
46 @@ -385,7 +390,7 @@ uninstall:
47 for i in `find include -name \*.h`; do rm -f $(DESTDIR)$(prefix)/$$i; done
48 -rmdir $(DESTDIR)$(ILIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(BINDIR)
49
50 -.PHONY: sparc ppc mips arm alpha i386 parisc mipsel powerpc s390 sparc64
51 +.PHONY: sparc powerpc mips arm alpha i386 parisc mipsel powerpc s390 sparc64
52 .PHONY: x86_64 ia64 ppc64 s390x
53
54 arm sparc alpha mips parisc s390 sparc64 x86_64 ia64 ppc64 s390x:
55 @@ -398,7 +403,7 @@ else
56 $(MAKE) ARCH=$@ CROSS=$@-linux- all
57 endif
58
59 -ppc:
60 +powerpc:
61 ifeq ($(MYARCH),ppc64)
62 $(MAKE) ARCH=$@ CC="$(CC) -m32" all
63 else
64 @@ -412,15 +417,11 @@ mipsel:
65 mips-gnu:
66 $(MAKE) ARCH=$@ CROSS=$@-linux-gnu- all
67
68 -# Some people named their cross compiler toolchain powerpc-linux-gcc
69 -powerpc:
70 - $(MAKE) ARCH=ppc CROSS=powerpc-linux- all
71 -
72 hppa:
73 ln -sf bin-parisc bin-hppa
74 $(MAKE) ARCH=parisc CROSS=hppa-linux- all
75
76 -CROSS_ARCH=arm sparc ppc alpha i386 mips sparc64 x86_64 s390 parisc
77 +CROSS_ARCH=arm sparc powerpc alpha i386 mips sparc64 x86_64 s390 parisc
78 cross:
79 $(MAKE) $(subst $(ARCH),,$(CROSS_ARCH))
80
81 diff -NurpP dietlibc-0.30-execstack/powerpc/clone.S dietlibc-0.30-ppc-rename/powerpc/clone.S
82 --- dietlibc-0.30-execstack/powerpc/clone.S 1970-01-01 01:00:00.000000000 +0100
83 +++ dietlibc-0.30-ppc-rename/powerpc/clone.S 2006-09-07 12:24:13.119173000 +0200
84 @@ -0,0 +1,52 @@
85 +#include <dietfeatures.h>
86 +#include "syscalls.h"
87 +#include <errno.h>
88 +
89 +.text
90 +.weak clone
91 +clone:
92 +.global __clone
93 +__clone:
94 + cmpwi 4,0 /* check have non null child_stack pointer */
95 + cmpwi cr1, 3,0 /* check have non null thread_funcion */
96 + cror eq,4*cr1+eq,eq /* now if eq is set one is or both are zero */
97 + beq .Lclone_error
98 +
99 + stwu 1,-32(1) /* alloc some space on the stack */
100 + stmw 29, 16(1) /* save r29,r30,r31 on stack */
101 +
102 + rlwinm 4,4,0,0,27 /* mask out lower 4 bits */
103 +
104 + /* move parameter to positions clone wants them */
105 + mr 29,3 /* r29 = r3 fn */
106 + mr 30,4 /* r30 = r4 stack */
107 + mr 31,6 /* r31 = r6 arg */
108 + mr 3, 5 /* r3 = r5 flags */
109 +
110 + li 0, __NR_clone /* load syscall nr. */
111 + sc
112 +
113 + cmpwi cr1,3,0 /* compare return of syscall with 0 */
114 + crandc 4*cr1+eq,4*cr1+eq,so
115 + bne .Lclone_parent /* return was non zero -> .Lclone_parent */
116 +
117 + /* we are the cloned process */
118 + mr 1, 30 /* set stack pointer */
119 + mtctr 29 /* set count register to fn ? */
120 + mr 3, 31 /* set argument */
121 + bctrl /* branch trough count register and link */
122 + b _exit /* exit thread */
123 +
124 +.Lclone_parent:
125 + lmw 29,16(1) /* restore saved registers */
126 + addi 1, 1,32 /* free stack */
127 + bnslr+ /* had cloned a thread so return to parent */
128 + b error_unified_syscall
129 +
130 +.Lclone_error:
131 + li 3, EINVAL
132 + b error_unified_syscall
133 +
134 +#ifdef __ELF__
135 +.section .note.GNU-stack,"",%progbits
136 +#endif
137 diff -NurpP dietlibc-0.30-execstack/powerpc/__longjmp.S dietlibc-0.30-ppc-rename/powerpc/__longjmp.S
138 --- dietlibc-0.30-execstack/powerpc/__longjmp.S 1970-01-01 01:00:00.000000000 +0100
139 +++ dietlibc-0.30-ppc-rename/powerpc/__longjmp.S 2006-09-07 12:24:13.119173000 +0200
140 @@ -0,0 +1,63 @@
141 +#include <setjmp.h>
142 +
143 +
144 +#ifdef PIC
145 +#define JUMPTARGET(name) name##@plt
146 +#else
147 +#define JUMPTARGET(name) name
148 +#endif
149 +
150 +.global __longjmp
151 +.type __longjmp,@function
152 +.align 2
153 +__longjmp:
154 + lwz 1,(JB_GPR1*4)(3)
155 + lwz 2,(JB_GPR2*4)(3)
156 + lwz 0,(JB_LR*4)(3)
157 + lwz 14,((JB_GPRS+0)*4)(3)
158 + lfd 14,((JB_FPRS+0*2)*4)(3)
159 + lwz 15,((JB_GPRS+1)*4)(3)
160 + lfd 15,((JB_FPRS+1*2)*4)(3)
161 + lwz 16,((JB_GPRS+2)*4)(3)
162 + lfd 16,((JB_FPRS+2*2)*4)(3)
163 + lwz 17,((JB_GPRS+3)*4)(3)
164 + lfd 17,((JB_FPRS+3*2)*4)(3)
165 + lwz 18,((JB_GPRS+4)*4)(3)
166 + lfd 18,((JB_FPRS+4*2)*4)(3)
167 + lwz 19,((JB_GPRS+5)*4)(3)
168 + lfd 19,((JB_FPRS+5*2)*4)(3)
169 + lwz 20,((JB_GPRS+6)*4)(3)
170 + lfd 20,((JB_FPRS+6*2)*4)(3)
171 + mtlr 0
172 + lwz 21,((JB_GPRS+7)*4)(3)
173 + lfd 21,((JB_FPRS+7*2)*4)(3)
174 + lwz 22,((JB_GPRS+8)*4)(3)
175 + lfd 22,((JB_FPRS+8*2)*4)(3)
176 + lwz 0,(JB_CR*4)(3)
177 + lwz 23,((JB_GPRS+9)*4)(3)
178 + lfd 23,((JB_FPRS+9*2)*4)(3)
179 + lwz 24,((JB_GPRS+10)*4)(3)
180 + lfd 24,((JB_FPRS+10*2)*4)(3)
181 + lwz 25,((JB_GPRS+11)*4)(3)
182 + lfd 25,((JB_FPRS+11*2)*4)(3)
183 + mtcrf 0xFF,0
184 + lwz 26,((JB_GPRS+12)*4)(3)
185 + lfd 26,((JB_FPRS+12*2)*4)(3)
186 + lwz 27,((JB_GPRS+13)*4)(3)
187 + lfd 27,((JB_FPRS+13*2)*4)(3)
188 + lwz 28,((JB_GPRS+14)*4)(3)
189 + lfd 28,((JB_FPRS+14*2)*4)(3)
190 + lwz 29,((JB_GPRS+15)*4)(3)
191 + lfd 29,((JB_FPRS+15*2)*4)(3)
192 + lwz 30,((JB_GPRS+16)*4)(3)
193 + lfd 30,((JB_FPRS+16*2)*4)(3)
194 + lwz 31,((JB_GPRS+17)*4)(3)
195 + lfd 31,((JB_FPRS+17*2)*4)(3)
196 + mr 3,4
197 + blr
198 +.size __longjmp,.-__longjmp
199 +
200 +
201 +#ifdef __ELF__
202 +.section .note.GNU-stack,"",%progbits
203 +#endif
204 diff -NurpP dietlibc-0.30-execstack/powerpc/Makefile.add dietlibc-0.30-ppc-rename/powerpc/Makefile.add
205 --- dietlibc-0.30-execstack/powerpc/Makefile.add 1970-01-01 01:00:00.000000000 +0100
206 +++ dietlibc-0.30-ppc-rename/powerpc/Makefile.add 2001-01-30 16:01:20.000000000 +0100
207 @@ -0,0 +1,3 @@
208 +
209 +CFLAGS+=-mpowerpc-gpopt -mpowerpc-gfxopt -Os
210 +VPATH:=ppc:syscalls.s:$(VPATH)
211 diff -NurpP dietlibc-0.30-execstack/powerpc/mmap.c dietlibc-0.30-ppc-rename/powerpc/mmap.c
212 --- dietlibc-0.30-execstack/powerpc/mmap.c 1970-01-01 01:00:00.000000000 +0100
213 +++ dietlibc-0.30-ppc-rename/powerpc/mmap.c 2001-06-18 23:08:07.000000000 +0200
214 @@ -0,0 +1,40 @@
215 +#include "dietfeatures.h"
216 +#include <sys/types.h>
217 +#include <errno.h>
218 +#include "syscalls.h"
219 +
220 +int mmap(void*start,size_t length,int prot,int flags,int fd,off_t offset) {
221 + unsigned long __sc_ret, __sc_err;
222 + {
223 + register unsigned long __sc_0 __asm__ ("r0");
224 + register unsigned long __sc_3 __asm__ ("r3");
225 + register unsigned long __sc_4 __asm__ ("r4");
226 + register unsigned long __sc_5 __asm__ ("r5");
227 + register unsigned long __sc_6 __asm__ ("r6");
228 + register unsigned long __sc_7 __asm__ ("r7");
229 + register unsigned long __sc_8 __asm__ ("r8");
230 +
231 + __sc_3 = (unsigned long) (start);
232 + __sc_4 = (unsigned long) (length);
233 + __sc_5 = (unsigned long) (prot);
234 + __sc_6 = (unsigned long) (flags);
235 + __sc_7 = (unsigned long) (fd);
236 + __sc_8 = (unsigned long) (offset);
237 + __sc_0 = __NR_mmap;
238 + __asm__ __volatile__
239 + ("sc \n\t"
240 + "mfcr %1 "
241 + : "=&r" (__sc_3), "=&r" (__sc_0)
242 + : "0" (__sc_3), "1" (__sc_0),
243 + "r" (__sc_4),
244 + "r" (__sc_5),
245 + "r" (__sc_6),
246 + "r" (__sc_7),
247 + "r" (__sc_8)
248 + : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
249 + __sc_ret = __sc_3;
250 + __sc_err = __sc_0;
251 + }
252 + return (__sc_err & 0x10000000 ? errno = __sc_ret, __sc_ret = -1 : 0),
253 + (int) __sc_ret;
254 +}
255 diff -NurpP dietlibc-0.30-execstack/powerpc/setjmp.S dietlibc-0.30-ppc-rename/powerpc/setjmp.S
256 --- dietlibc-0.30-execstack/powerpc/setjmp.S 1970-01-01 01:00:00.000000000 +0100
257 +++ dietlibc-0.30-ppc-rename/powerpc/setjmp.S 2006-09-07 12:24:13.119173000 +0200
258 @@ -0,0 +1,60 @@
259 +#include <setjmp.h>
260 +
261 +#ifdef PIC
262 +#define JUMPTARGET(name) name##@plt
263 +#else
264 +#define JUMPTARGET(name) name
265 +#endif
266 +
267 +.global __sigsetjmp
268 +.type __sigsetjmp,@function
269 +.align 2
270 +__sigsetjmp:
271 + stw 1,(JB_GPR1*4)(3)
272 + mflr 0
273 + stw 2,(JB_GPR2*4)(3)
274 + stw 14,((JB_GPRS+0)*4)(3)
275 + stfd 14,((JB_FPRS+0*2)*4)(3)
276 + stw 0,(JB_LR*4)(3)
277 + stw 15,((JB_GPRS+1)*4)(3)
278 + stfd 15,((JB_FPRS+1*2)*4)(3)
279 + mfcr 0
280 + stw 16,((JB_GPRS+2)*4)(3)
281 + stfd 16,((JB_FPRS+2*2)*4)(3)
282 + stw 0,(JB_CR*4)(3)
283 + stw 17,((JB_GPRS+3)*4)(3)
284 + stfd 17,((JB_FPRS+3*2)*4)(3)
285 + stw 18,((JB_GPRS+4)*4)(3)
286 + stfd 18,((JB_FPRS+4*2)*4)(3)
287 + stw 19,((JB_GPRS+5)*4)(3)
288 + stfd 19,((JB_FPRS+5*2)*4)(3)
289 + stw 20,((JB_GPRS+6)*4)(3)
290 + stfd 20,((JB_FPRS+6*2)*4)(3)
291 + stw 21,((JB_GPRS+7)*4)(3)
292 + stfd 21,((JB_FPRS+7*2)*4)(3)
293 + stw 22,((JB_GPRS+8)*4)(3)
294 + stfd 22,((JB_FPRS+8*2)*4)(3)
295 + stw 23,((JB_GPRS+9)*4)(3)
296 + stfd 23,((JB_FPRS+9*2)*4)(3)
297 + stw 24,((JB_GPRS+10)*4)(3)
298 + stfd 24,((JB_FPRS+10*2)*4)(3)
299 + stw 25,((JB_GPRS+11)*4)(3)
300 + stfd 25,((JB_FPRS+11*2)*4)(3)
301 + stw 26,((JB_GPRS+12)*4)(3)
302 + stfd 26,((JB_FPRS+12*2)*4)(3)
303 + stw 27,((JB_GPRS+13)*4)(3)
304 + stfd 27,((JB_FPRS+13*2)*4)(3)
305 + stw 28,((JB_GPRS+14)*4)(3)
306 + stfd 28,((JB_FPRS+14*2)*4)(3)
307 + stw 29,((JB_GPRS+15)*4)(3)
308 + stfd 29,((JB_FPRS+15*2)*4)(3)
309 + stw 30,((JB_GPRS+16)*4)(3)
310 + stfd 30,((JB_FPRS+16*2)*4)(3)
311 + stw 31,((JB_GPRS+17)*4)(3)
312 + stfd 31,((JB_FPRS+17*2)*4)(3)
313 + b JUMPTARGET (__sigjmp_save)
314 +.size __sigsetjmp,.-__sigsetjmp
315 +
316 +#ifdef __ELF__
317 +.section .note.GNU-stack,"",%progbits
318 +#endif
319 diff -NurpP dietlibc-0.30-execstack/powerpc/start.S dietlibc-0.30-ppc-rename/powerpc/start.S
320 --- dietlibc-0.30-execstack/powerpc/start.S 1970-01-01 01:00:00.000000000 +0100
321 +++ dietlibc-0.30-ppc-rename/powerpc/start.S 2006-09-07 12:24:13.119173000 +0200
322 @@ -0,0 +1,56 @@
323 +#include "dietfeatures.h"
324 +
325 +.text
326 +.global _start
327 +.type _start,@function
328 +_start:
329 + /* Save the stack pointer, in case we're statically linked under Linux. */
330 + mr 9,1
331 + /* Set up an initial stack frame, and clear the LR. */
332 + clrrwi 1,1,4
333 + li 0,0
334 + stwu 1,-16(1)
335 + mtlr 0
336 + stw 0,0(1)
337 +
338 + /* r9 contains the initial stack pointer
339 + argc = (r9)
340 + argv = (r9+4)
341 + envp = argv+(argc+1)*4 */
342 +
343 + lis 14,__libc_stack_end@ha
344 + stw 9,__libc_stack_end@l(14)
345 +
346 + lwzu 3,0(9) /* argc */
347 + addi 4,9,4 /* argv */
348 + add 5,0,3 /* argc... */
349 + addi 5,5,1 /* argc+1...*/
350 + slwi 5,5,2 /* (argc+1)*4 */
351 + add 5,5,4 /* argv+(argc+1)*4 */
352 +
353 + lis 14,environ@ha
354 + stw 5,environ@l(14)
355 +
356 +#ifdef WANT_DYNAMIC
357 + mr 6,7
358 + bl _dyn_start
359 +#else
360 + bl CALL_IN_STARTCODE
361 +#endif
362 + b exit
363 +.size _start,.-_start
364 +
365 +
366 +/* Define a symbol for the first piece of initialized data. */
367 + .section ".data"
368 +__data_start:
369 +
370 +/* this is needed for libgcc_eh.a - see gcc-3.4/gcc/config/rs6000/linux-unwind.h */
371 + .weak __libc_stack_end
372 + .lcomm __libc_stack_end,4,4
373 + .type __libc_stack_end,@object
374 +
375 +
376 +#ifdef __ELF__
377 +.section .note.GNU-stack,"",%progbits
378 +#endif
379 diff -NurpP dietlibc-0.30-execstack/powerpc/syscalls.h dietlibc-0.30-ppc-rename/powerpc/syscalls.h
380 --- dietlibc-0.30-execstack/powerpc/syscalls.h 1970-01-01 01:00:00.000000000 +0100
381 +++ dietlibc-0.30-ppc-rename/powerpc/syscalls.h 2005-09-21 09:33:08.000000000 +0200
382 @@ -0,0 +1,299 @@
383 +
384 +#define __NR_exit 1
385 +#define __NR_fork 2
386 +#define __NR_read 3
387 +#define __NR_write 4
388 +#define __NR_open 5
389 +#define __NR_close 6
390 +#define __NR_waitpid 7
391 +#define __NR_creat 8
392 +#define __NR_link 9
393 +#define __NR_unlink 10
394 +#define __NR_execve 11
395 +#define __NR_chdir 12
396 +#define __NR_time 13
397 +#define __NR_mknod 14
398 +#define __NR_chmod 15
399 +#define __NR_lchown 16
400 +#define __NR_break 17
401 +#define __NR_oldstat 18
402 +#define __NR_lseek 19
403 +#define __NR_getpid 20
404 +#define __NR_mount 21
405 +#define __NR_umount 22
406 +#define __NR_setuid 23
407 +#define __NR_getuid 24
408 +#define __NR_stime 25
409 +#define __NR_ptrace 26
410 +#define __NR_alarm 27
411 +#define __NR_oldfstat 28
412 +#define __NR_pause 29
413 +#define __NR_utime 30
414 +#define __NR_stty 31
415 +#define __NR_gtty 32
416 +#define __NR_access 33
417 +#define __NR_nice 34
418 +#define __NR_ftime 35
419 +#define __NR_sync 36
420 +#define __NR_kill 37
421 +#define __NR_rename 38
422 +#define __NR_mkdir 39
423 +#define __NR_rmdir 40
424 +#define __NR_dup 41
425 +#define __NR_pipe 42
426 +#define __NR_times 43
427 +#define __NR_prof 44
428 +#define __NR_brk 45
429 +#define __NR_setgid 46
430 +#define __NR_getgid 47
431 +#define __NR_signal 48
432 +#define __NR_geteuid 49
433 +#define __NR_getegid 50
434 +#define __NR_acct 51
435 +#define __NR_umount2 52
436 +#define __NR_lock 53
437 +#define __NR_ioctl 54
438 +#define __NR_fcntl 55
439 +#define __NR_mpx 56
440 +#define __NR_setpgid 57
441 +#define __NR_ulimit 58
442 +#define __NR_oldolduname 59
443 +#define __NR_umask 60
444 +#define __NR_chroot 61
445 +#define __NR_ustat 62
446 +#define __NR_dup2 63
447 +#define __NR_getppid 64
448 +#define __NR_getpgrp 65
449 +#define __NR_setsid 66
450 +#define __NR_sigaction 67
451 +#define __NR_sgetmask 68
452 +#define __NR_ssetmask 69
453 +#define __NR_setreuid 70
454 +#define __NR_setregid 71
455 +#define __NR_sigsuspend 72
456 +#define __NR_sigpending 73
457 +#define __NR_sethostname 74
458 +#define __NR_setrlimit 75
459 +#define __NR_getrlimit 76
460 +#define __NR_getrusage 77
461 +#define __NR_gettimeofday 78
462 +#define __NR_settimeofday 79
463 +#define __NR_getgroups 80
464 +#define __NR_setgroups 81
465 +#define __NR_select 82
466 +#define __NR_symlink 83
467 +#define __NR_oldlstat 84
468 +#define __NR_readlink 85
469 +#define __NR_uselib 86
470 +#define __NR_swapon 87
471 +#define __NR_reboot 88
472 +#define __NR_readdir 89
473 +#define __NR_mmap 90
474 +#define __NR_munmap 91
475 +#define __NR_truncate 92
476 +#define __NR_ftruncate 93
477 +#define __NR_fchmod 94
478 +#define __NR_fchown 95
479 +#define __NR_getpriority 96
480 +#define __NR_setpriority 97
481 +#define __NR_profil 98
482 +#define __NR_statfs 99
483 +#define __NR_fstatfs 100
484 +#define __NR_ioperm 101
485 +#define __NR_socketcall 102
486 +#define __NR_syslog 103
487 +#define __NR_setitimer 104
488 +#define __NR_getitimer 105
489 +#define __NR_stat 106
490 +#define __NR_lstat 107
491 +#define __NR_fstat 108
492 +#define __NR_olduname 109
493 +#define __NR_iopl 110
494 +#define __NR_vhangup 111
495 +#define __NR_idle 112
496 +#define __NR_vm86 113
497 +#define __NR_wait4 114
498 +#define __NR_swapoff 115
499 +#define __NR_sysinfo 116
500 +#define __NR_ipc 117
501 +#define __NR_fsync 118
502 +#define __NR_sigreturn 119
503 +#define __NR_clone 120
504 +#define __NR_setdomainname 121
505 +#define __NR_uname 122
506 +#define __NR_modify_ldt 123
507 +#define __NR_adjtimex 124
508 +#define __NR_mprotect 125
509 +#define __NR_sigprocmask 126
510 +#define __NR_create_module 127
511 +#define __NR_init_module 128
512 +#define __NR_delete_module 129
513 +#define __NR_get_kernel_syms 130
514 +#define __NR_quotactl 131
515 +#define __NR_getpgid 132
516 +#define __NR_fchdir 133
517 +#define __NR_bdflush 134
518 +#define __NR_sysfs 135
519 +#define __NR_personality 136
520 +#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
521 +#define __NR_setfsuid 138
522 +#define __NR_setfsgid 139
523 +#define __NR__llseek 140
524 +#define __NR_getdents 141
525 +#define __NR__newselect 142
526 +#define __NR_flock 143
527 +#define __NR_msync 144
528 +#define __NR_readv 145
529 +#define __NR_writev 146
530 +#define __NR_getsid 147
531 +#define __NR_fdatasync 148
532 +#define __NR__sysctl 149
533 +#define __NR_mlock 150
534 +#define __NR_munlock 151
535 +#define __NR_mlockall 152
536 +#define __NR_munlockall 153
537 +#define __NR_sched_setparam 154
538 +#define __NR_sched_getparam 155
539 +#define __NR_sched_setscheduler 156
540 +#define __NR_sched_getscheduler 157
541 +#define __NR_sched_yield 158
542 +#define __NR_sched_get_priority_max 159
543 +#define __NR_sched_get_priority_min 160
544 +#define __NR_sched_rr_get_interval 161
545 +#define __NR_nanosleep 162
546 +#define __NR_mremap 163
547 +#define __NR_setresuid 164
548 +#define __NR_getresuid 165
549 +#define __NR_query_module 166
550 +#define __NR_poll 167
551 +#define __NR_nfsservctl 168
552 +#define __NR_setresgid 169
553 +#define __NR_getresgid 170
554 +#define __NR_prctl 171
555 +#define __NR_rt_sigreturn 172
556 +#define __NR_rt_sigaction 173
557 +#define __NR_rt_sigprocmask 174
558 +#define __NR_rt_sigpending 175
559 +#define __NR_rt_sigtimedwait 176
560 +#define __NR_rt_sigqueueinfo 177
561 +#define __NR_rt_sigsuspend 178
562 +#define __NR_pread 179
563 +#define __NR_pwrite 180
564 +#define __NR_chown 181
565 +#define __NR_getcwd 182
566 +#define __NR_capget 183
567 +#define __NR_capset 184
568 +#define __NR_sigaltstack 185
569 +#define __NR_sendfile 186
570 +#define __NR_getpmsg 187 /* some people actually want streams */
571 +#define __NR_putpmsg 188 /* some people actually want streams */
572 +#define __NR_vfork 189
573 +#define __NR_ugetrlimit 190 /* SuS compliant getrlimit */
574 +#define __NR_readahead 191
575 +#define __NR_mmap2 192
576 +#define __NR_truncate64 193
577 +#define __NR_ftruncate64 194
578 +#define __NR_stat64 195
579 +#define __NR_lstat64 196
580 +#define __NR_fstat64 197
581 +#define __NR_pciconfig_read 198
582 +#define __NR_pciconfig_write 199
583 +#define __NR_pciconfig_iobase 200
584 +#define __NR_multiplexer 201
585 +#define __NR_getdents64 202
586 +#define __NR_pivot_root 203
587 +#define __NR_fcntl64 204
588 +#define __NR_madvise 205
589 +#define __NR_mincore 206
590 +#define __NR_gettid 207
591 +#define __NR_tkill 208
592 +#define __NR_setxattr 209
593 +#define __NR_lsetxattr 210
594 +#define __NR_fsetxattr 211
595 +#define __NR_getxattr 212
596 +#define __NR_lgetxattr 213
597 +#define __NR_fgetxattr 214
598 +#define __NR_listxattr 215
599 +#define __NR_llistxattr 216
600 +#define __NR_flistxattr 217
601 +#define __NR_removexattr 218
602 +#define __NR_lremovexattr 219
603 +#define __NR_fremovexattr 220
604 +#define __NR_futex 221
605 +#define __NR_sched_setaffinity 222
606 +#define __NR_sched_getaffinity 223
607 +/* 224 currently unused */
608 +#define __NR_tuxcall 225
609 +#define __NR_sendfile64 226
610 +#define __NR_io_setup 227
611 +#define __NR_io_destroy 228
612 +#define __NR_io_getevents 229
613 +#define __NR_io_submit 230
614 +#define __NR_io_cancel 231
615 +#define __NR_set_tid_address 232
616 +#define __NR_fadvise64 233
617 +#define __NR_exit_group 234
618 +#define __NR_lookup_dcookie 235
619 +#define __NR_epoll_create 236
620 +#define __NR_epoll_ctl 237
621 +#define __NR_epoll_wait 238
622 +#define __NR_remap_file_pages 239
623 +#define __NR_timer_create 240
624 +#define __NR_timer_settime 241
625 +#define __NR_timer_gettime 242
626 +#define __NR_timer_getoverrun 243
627 +#define __NR_timer_delete 244
628 +#define __NR_clock_settime 245
629 +#define __NR_clock_gettime 246
630 +#define __NR_clock_getres 247
631 +#define __NR_clock_nanosleep 248
632 +#define __NR_swapcontext 249
633 +#define __NR_tgkill 250
634 +#define __NR_utimes 251
635 +#define __NR_statfs64 252
636 +#define __NR_fstatfs64 253
637 +#define __NR_fadvise64_64 254
638 +#define __NR_rtas 255
639 +#define __NR_sys_debug_setcontext 256
640 +/* Number 257 is reserved for vserver */
641 +/* Number 258 is reserved for new sys_remap_file_pages */
642 +/* Number 259 is reserved for new sys_mbind */
643 +/* Number 260 is reserved for new sys_get_mempolicy */
644 +/* Number 261 is reserved for new sys_set_mempolicy */
645 +#define __NR_mq_open 262
646 +#define __NR_mq_unlink 263
647 +#define __NR_mq_timedsend 264
648 +#define __NR_mq_timedreceive 265
649 +#define __NR_mq_notify 266
650 +#define __NR_mq_getsetattr 267
651 +#define __NR_kexec_load 268
652 +#define __NR_add_key 269
653 +#define __NR_request_key 270
654 +#define __NR_keyctl 271
655 +#define __NR_waitid 272
656 +#define __NR_ioprio_set 273
657 +#define __NR_ioprio_get 274
658 +#define __NR_inotify_init 275
659 +#define __NR_inotify_add_watch 276
660 +#define __NR_inotify_rm_watch 277
661 +
662 +
663 +#define syscall_weak(name,wsym,sym) \
664 +.text; \
665 +.type wsym,@function; \
666 +.weak wsym; \
667 +wsym: ; \
668 +.type sym,@function; \
669 +.global sym; \
670 +sym: \
671 + li 0,__NR_##name; \
672 + b __unified_syscall
673 +
674 +#define syscall(name,sym) \
675 +.text; \
676 +.type sym,@function; \
677 +.global sym; \
678 +sym: \
679 + li 0,__NR_##name; \
680 + b __unified_syscall
681 +
682 diff -NurpP dietlibc-0.30-execstack/powerpc/__testandset.S dietlibc-0.30-ppc-rename/powerpc/__testandset.S
683 --- dietlibc-0.30-execstack/powerpc/__testandset.S 1970-01-01 01:00:00.000000000 +0100
684 +++ dietlibc-0.30-ppc-rename/powerpc/__testandset.S 2006-09-07 12:24:13.119173000 +0200
685 @@ -0,0 +1,16 @@
686 +.global __testandset
687 +.type __testandset,@function
688 +.align 2
689 +__testandset:
690 +1: lwarx 5,0,3
691 + li 0,1
692 + stwcx. 0,0,3
693 + bne- 1b
694 + mr 3,5
695 + blr
696 +.size __testandset,.-__testandset
697 +
698 +
699 +#ifdef __ELF__
700 +.section .note.GNU-stack,"",%progbits
701 +#endif
702 diff -NurpP dietlibc-0.30-execstack/powerpc/unified.S dietlibc-0.30-ppc-rename/powerpc/unified.S
703 --- dietlibc-0.30-execstack/powerpc/unified.S 1970-01-01 01:00:00.000000000 +0100
704 +++ dietlibc-0.30-ppc-rename/powerpc/unified.S 2006-09-07 12:24:13.119173000 +0200
705 @@ -0,0 +1,44 @@
706 +#include <dietfeatures.h>
707 +#include "syscalls.h"
708 +
709 +.text
710 +.type exit,@function
711 +.weak exit
712 +exit:
713 +.type _exit,@function
714 +.global _exit
715 +_exit:
716 + li 0,__NR_exit
717 +.global __unified_syscall
718 +__unified_syscall:
719 + sc
720 + bnslr+
721 +
722 +.global error_unified_syscall
723 +error_unified_syscall:
724 +#ifdef WANT_THREAD_SAFE
725 + stwu 1,-16(1)
726 + mflr 0
727 + stw 0,20(1)
728 + stw 3,12(1)
729 + bl __errno_location
730 + lwz 0,12(1)
731 + stw 0,0(3)
732 + lwz 0,20(1)
733 + mtlr 0
734 + addi 1,1,16
735 +#else
736 + lis 9,errno@ha
737 + stw 3,errno@l(9)
738 +#endif
739 + li 3,-1
740 +
741 +/* here we go and "reuse" the return for weak-void functions */
742 +#include "dietuglyweaks.h"
743 +
744 + blr
745 +
746 +
747 +#ifdef __ELF__
748 +.section .note.GNU-stack,"",%progbits
749 +#endif
750 diff -NurpP dietlibc-0.30-execstack/ppc/clone.S dietlibc-0.30-ppc-rename/ppc/clone.S
751 --- dietlibc-0.30-execstack/ppc/clone.S 2006-09-07 12:24:13.119173750 +0200
752 +++ dietlibc-0.30-ppc-rename/ppc/clone.S 1970-01-01 01:00:00.000000000 +0100
753 @@ -1,52 +0,0 @@
754 -#include <dietfeatures.h>
755 -#include "syscalls.h"
756 -#include <errno.h>
757 -
758 -.text
759 -.weak clone
760 -clone:
761 -.global __clone
762 -__clone:
763 - cmpwi 4,0 /* check have non null child_stack pointer */
764 - cmpwi cr1, 3,0 /* check have non null thread_funcion */
765 - cror eq,4*cr1+eq,eq /* now if eq is set one is or both are zero */
766 - beq .Lclone_error
767 -
768 - stwu 1,-32(1) /* alloc some space on the stack */
769 - stmw 29, 16(1) /* save r29,r30,r31 on stack */
770 -
771 - rlwinm 4,4,0,0,27 /* mask out lower 4 bits */
772 -
773 - /* move parameter to positions clone wants them */
774 - mr 29,3 /* r29 = r3 fn */
775 - mr 30,4 /* r30 = r4 stack */
776 - mr 31,6 /* r31 = r6 arg */
777 - mr 3, 5 /* r3 = r5 flags */
778 -
779 - li 0, __NR_clone /* load syscall nr. */
780 - sc
781 -
782 - cmpwi cr1,3,0 /* compare return of syscall with 0 */
783 - crandc 4*cr1+eq,4*cr1+eq,so
784 - bne .Lclone_parent /* return was non zero -> .Lclone_parent */
785 -
786 - /* we are the cloned process */
787 - mr 1, 30 /* set stack pointer */
788 - mtctr 29 /* set count register to fn ? */
789 - mr 3, 31 /* set argument */
790 - bctrl /* branch trough count register and link */
791 - b _exit /* exit thread */
792 -
793 -.Lclone_parent:
794 - lmw 29,16(1) /* restore saved registers */
795 - addi 1, 1,32 /* free stack */
796 - bnslr+ /* had cloned a thread so return to parent */
797 - b error_unified_syscall
798 -
799 -.Lclone_error:
800 - li 3, EINVAL
801 - b error_unified_syscall
802 -
803 -#ifdef __ELF__
804 -.section .note.GNU-stack,"",%progbits
805 -#endif
806 diff -NurpP dietlibc-0.30-execstack/ppc/__longjmp.S dietlibc-0.30-ppc-rename/ppc/__longjmp.S
807 --- dietlibc-0.30-execstack/ppc/__longjmp.S 2006-09-07 12:24:13.119173750 +0200
808 +++ dietlibc-0.30-ppc-rename/ppc/__longjmp.S 1970-01-01 01:00:00.000000000 +0100
809 @@ -1,63 +0,0 @@
810 -#include <setjmp.h>
811 -
812 -
813 -#ifdef PIC
814 -#define JUMPTARGET(name) name##@plt
815 -#else
816 -#define JUMPTARGET(name) name
817 -#endif
818 -
819 -.global __longjmp
820 -.type __longjmp,@function
821 -.align 2
822 -__longjmp:
823 - lwz 1,(JB_GPR1*4)(3)
824 - lwz 2,(JB_GPR2*4)(3)
825 - lwz 0,(JB_LR*4)(3)
826 - lwz 14,((JB_GPRS+0)*4)(3)
827 - lfd 14,((JB_FPRS+0*2)*4)(3)
828 - lwz 15,((JB_GPRS+1)*4)(3)
829 - lfd 15,((JB_FPRS+1*2)*4)(3)
830 - lwz 16,((JB_GPRS+2)*4)(3)
831 - lfd 16,((JB_FPRS+2*2)*4)(3)
832 - lwz 17,((JB_GPRS+3)*4)(3)
833 - lfd 17,((JB_FPRS+3*2)*4)(3)
834 - lwz 18,((JB_GPRS+4)*4)(3)
835 - lfd 18,((JB_FPRS+4*2)*4)(3)
836 - lwz 19,((JB_GPRS+5)*4)(3)
837 - lfd 19,((JB_FPRS+5*2)*4)(3)
838 - lwz 20,((JB_GPRS+6)*4)(3)
839 - lfd 20,((JB_FPRS+6*2)*4)(3)
840 - mtlr 0
841 - lwz 21,((JB_GPRS+7)*4)(3)
842 - lfd 21,((JB_FPRS+7*2)*4)(3)
843 - lwz 22,((JB_GPRS+8)*4)(3)
844 - lfd 22,((JB_FPRS+8*2)*4)(3)
845 - lwz 0,(JB_CR*4)(3)
846 - lwz 23,((JB_GPRS+9)*4)(3)
847 - lfd 23,((JB_FPRS+9*2)*4)(3)
848 - lwz 24,((JB_GPRS+10)*4)(3)
849 - lfd 24,((JB_FPRS+10*2)*4)(3)
850 - lwz 25,((JB_GPRS+11)*4)(3)
851 - lfd 25,((JB_FPRS+11*2)*4)(3)
852 - mtcrf 0xFF,0
853 - lwz 26,((JB_GPRS+12)*4)(3)
854 - lfd 26,((JB_FPRS+12*2)*4)(3)
855 - lwz 27,((JB_GPRS+13)*4)(3)
856 - lfd 27,((JB_FPRS+13*2)*4)(3)
857 - lwz 28,((JB_GPRS+14)*4)(3)
858 - lfd 28,((JB_FPRS+14*2)*4)(3)
859 - lwz 29,((JB_GPRS+15)*4)(3)
860 - lfd 29,((JB_FPRS+15*2)*4)(3)
861 - lwz 30,((JB_GPRS+16)*4)(3)
862 - lfd 30,((JB_FPRS+16*2)*4)(3)
863 - lwz 31,((JB_GPRS+17)*4)(3)
864 - lfd 31,((JB_FPRS+17*2)*4)(3)
865 - mr 3,4
866 - blr
867 -.size __longjmp,.-__longjmp
868 -
869 -
870 -#ifdef __ELF__
871 -.section .note.GNU-stack,"",%progbits
872 -#endif
873 diff -NurpP dietlibc-0.30-execstack/ppc/Makefile.add dietlibc-0.30-ppc-rename/ppc/Makefile.add
874 --- dietlibc-0.30-execstack/ppc/Makefile.add 2001-01-30 16:01:20.000000000 +0100
875 +++ dietlibc-0.30-ppc-rename/ppc/Makefile.add 1970-01-01 01:00:00.000000000 +0100
876 @@ -1,3 +0,0 @@
877 -
878 -CFLAGS+=-mpowerpc-gpopt -mpowerpc-gfxopt -Os
879 -VPATH:=ppc:syscalls.s:$(VPATH)
880 diff -NurpP dietlibc-0.30-execstack/ppc/mmap.c dietlibc-0.30-ppc-rename/ppc/mmap.c
881 --- dietlibc-0.30-execstack/ppc/mmap.c 2001-06-18 23:08:07.000000000 +0200
882 +++ dietlibc-0.30-ppc-rename/ppc/mmap.c 1970-01-01 01:00:00.000000000 +0100
883 @@ -1,40 +0,0 @@
884 -#include "dietfeatures.h"
885 -#include <sys/types.h>
886 -#include <errno.h>
887 -#include "syscalls.h"
888 -
889 -int mmap(void*start,size_t length,int prot,int flags,int fd,off_t offset) {
890 - unsigned long __sc_ret, __sc_err;
891 - {
892 - register unsigned long __sc_0 __asm__ ("r0");
893 - register unsigned long __sc_3 __asm__ ("r3");
894 - register unsigned long __sc_4 __asm__ ("r4");
895 - register unsigned long __sc_5 __asm__ ("r5");
896 - register unsigned long __sc_6 __asm__ ("r6");
897 - register unsigned long __sc_7 __asm__ ("r7");
898 - register unsigned long __sc_8 __asm__ ("r8");
899 -
900 - __sc_3 = (unsigned long) (start);
901 - __sc_4 = (unsigned long) (length);
902 - __sc_5 = (unsigned long) (prot);
903 - __sc_6 = (unsigned long) (flags);
904 - __sc_7 = (unsigned long) (fd);
905 - __sc_8 = (unsigned long) (offset);
906 - __sc_0 = __NR_mmap;
907 - __asm__ __volatile__
908 - ("sc \n\t"
909 - "mfcr %1 "
910 - : "=&r" (__sc_3), "=&r" (__sc_0)
911 - : "0" (__sc_3), "1" (__sc_0),
912 - "r" (__sc_4),
913 - "r" (__sc_5),
914 - "r" (__sc_6),
915 - "r" (__sc_7),
916 - "r" (__sc_8)
917 - : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
918 - __sc_ret = __sc_3;
919 - __sc_err = __sc_0;
920 - }
921 - return (__sc_err & 0x10000000 ? errno = __sc_ret, __sc_ret = -1 : 0),
922 - (int) __sc_ret;
923 -}
924 diff -NurpP dietlibc-0.30-execstack/ppc/setjmp.S dietlibc-0.30-ppc-rename/ppc/setjmp.S
925 --- dietlibc-0.30-execstack/ppc/setjmp.S 2006-09-07 12:24:13.119173750 +0200
926 +++ dietlibc-0.30-ppc-rename/ppc/setjmp.S 1970-01-01 01:00:00.000000000 +0100
927 @@ -1,60 +0,0 @@
928 -#include <setjmp.h>
929 -
930 -#ifdef PIC
931 -#define JUMPTARGET(name) name##@plt
932 -#else
933 -#define JUMPTARGET(name) name
934 -#endif
935 -
936 -.global __sigsetjmp
937 -.type __sigsetjmp,@function
938 -.align 2
939 -__sigsetjmp:
940 - stw 1,(JB_GPR1*4)(3)
941 - mflr 0
942 - stw 2,(JB_GPR2*4)(3)
943 - stw 14,((JB_GPRS+0)*4)(3)
944 - stfd 14,((JB_FPRS+0*2)*4)(3)
945 - stw 0,(JB_LR*4)(3)
946 - stw 15,((JB_GPRS+1)*4)(3)
947 - stfd 15,((JB_FPRS+1*2)*4)(3)
948 - mfcr 0
949 - stw 16,((JB_GPRS+2)*4)(3)
950 - stfd 16,((JB_FPRS+2*2)*4)(3)
951 - stw 0,(JB_CR*4)(3)
952 - stw 17,((JB_GPRS+3)*4)(3)
953 - stfd 17,((JB_FPRS+3*2)*4)(3)
954 - stw 18,((JB_GPRS+4)*4)(3)
955 - stfd 18,((JB_FPRS+4*2)*4)(3)
956 - stw 19,((JB_GPRS+5)*4)(3)
957 - stfd 19,((JB_FPRS+5*2)*4)(3)
958 - stw 20,((JB_GPRS+6)*4)(3)
959 - stfd 20,((JB_FPRS+6*2)*4)(3)
960 - stw 21,((JB_GPRS+7)*4)(3)
961 - stfd 21,((JB_FPRS+7*2)*4)(3)
962 - stw 22,((JB_GPRS+8)*4)(3)
963 - stfd 22,((JB_FPRS+8*2)*4)(3)
964 - stw 23,((JB_GPRS+9)*4)(3)
965 - stfd 23,((JB_FPRS+9*2)*4)(3)
966 - stw 24,((JB_GPRS+10)*4)(3)
967 - stfd 24,((JB_FPRS+10*2)*4)(3)
968 - stw 25,((JB_GPRS+11)*4)(3)
969 - stfd 25,((JB_FPRS+11*2)*4)(3)
970 - stw 26,((JB_GPRS+12)*4)(3)
971 - stfd 26,((JB_FPRS+12*2)*4)(3)
972 - stw 27,((JB_GPRS+13)*4)(3)
973 - stfd 27,((JB_FPRS+13*2)*4)(3)
974 - stw 28,((JB_GPRS+14)*4)(3)
975 - stfd 28,((JB_FPRS+14*2)*4)(3)
976 - stw 29,((JB_GPRS+15)*4)(3)
977 - stfd 29,((JB_FPRS+15*2)*4)(3)
978 - stw 30,((JB_GPRS+16)*4)(3)
979 - stfd 30,((JB_FPRS+16*2)*4)(3)
980 - stw 31,((JB_GPRS+17)*4)(3)
981 - stfd 31,((JB_FPRS+17*2)*4)(3)
982 - b JUMPTARGET (__sigjmp_save)
983 -.size __sigsetjmp,.-__sigsetjmp
984 -
985 -#ifdef __ELF__
986 -.section .note.GNU-stack,"",%progbits
987 -#endif
988 diff -NurpP dietlibc-0.30-execstack/ppc/start.S dietlibc-0.30-ppc-rename/ppc/start.S
989 --- dietlibc-0.30-execstack/ppc/start.S 2006-09-07 12:24:13.119173750 +0200
990 +++ dietlibc-0.30-ppc-rename/ppc/start.S 1970-01-01 01:00:00.000000000 +0100
991 @@ -1,56 +0,0 @@
992 -#include "dietfeatures.h"
993 -
994 -.text
995 -.global _start
996 -.type _start,@function
997 -_start:
998 - /* Save the stack pointer, in case we're statically linked under Linux. */
999 - mr 9,1
1000 - /* Set up an initial stack frame, and clear the LR. */
1001 - clrrwi 1,1,4
1002 - li 0,0
1003 - stwu 1,-16(1)
1004 - mtlr 0
1005 - stw 0,0(1)
1006 -
1007 - /* r9 contains the initial stack pointer
1008 - argc = (r9)
1009 - argv = (r9+4)
1010 - envp = argv+(argc+1)*4 */
1011 -
1012 - lis 14,__libc_stack_end@ha
1013 - stw 9,__libc_stack_end@l(14)
1014 -
1015 - lwzu 3,0(9) /* argc */
1016 - addi 4,9,4 /* argv */
1017 - add 5,0,3 /* argc... */
1018 - addi 5,5,1 /* argc+1...*/
1019 - slwi 5,5,2 /* (argc+1)*4 */
1020 - add 5,5,4 /* argv+(argc+1)*4 */
1021 -
1022 - lis 14,environ@ha
1023 - stw 5,environ@l(14)
1024 -
1025 -#ifdef WANT_DYNAMIC
1026 - mr 6,7
1027 - bl _dyn_start
1028 -#else
1029 - bl CALL_IN_STARTCODE
1030 -#endif
1031 - b exit
1032 -.size _start,.-_start
1033 -
1034 -
1035 -/* Define a symbol for the first piece of initialized data. */
1036 - .section ".data"
1037 -__data_start:
1038 -
1039 -/* this is needed for libgcc_eh.a - see gcc-3.4/gcc/config/rs6000/linux-unwind.h */
1040 - .weak __libc_stack_end
1041 - .lcomm __libc_stack_end,4,4
1042 - .type __libc_stack_end,@object
1043 -
1044 -
1045 -#ifdef __ELF__
1046 -.section .note.GNU-stack,"",%progbits
1047 -#endif
1048 diff -NurpP dietlibc-0.30-execstack/ppc/syscalls.h dietlibc-0.30-ppc-rename/ppc/syscalls.h
1049 --- dietlibc-0.30-execstack/ppc/syscalls.h 2005-09-21 09:33:08.000000000 +0200
1050 +++ dietlibc-0.30-ppc-rename/ppc/syscalls.h 1970-01-01 01:00:00.000000000 +0100
1051 @@ -1,299 +0,0 @@
1052 -
1053 -#define __NR_exit 1
1054 -#define __NR_fork 2
1055 -#define __NR_read 3
1056 -#define __NR_write 4
1057 -#define __NR_open 5
1058 -#define __NR_close 6
1059 -#define __NR_waitpid 7
1060 -#define __NR_creat 8
1061 -#define __NR_link 9
1062 -#define __NR_unlink 10
1063 -#define __NR_execve 11
1064 -#define __NR_chdir 12
1065 -#define __NR_time 13
1066 -#define __NR_mknod 14
1067 -#define __NR_chmod 15
1068 -#define __NR_lchown 16
1069 -#define __NR_break 17
1070 -#define __NR_oldstat 18
1071 -#define __NR_lseek 19
1072 -#define __NR_getpid 20
1073 -#define __NR_mount 21
1074 -#define __NR_umount 22
1075 -#define __NR_setuid 23
1076 -#define __NR_getuid 24
1077 -#define __NR_stime 25
1078 -#define __NR_ptrace 26
1079 -#define __NR_alarm 27
1080 -#define __NR_oldfstat 28
1081 -#define __NR_pause 29
1082 -#define __NR_utime 30
1083 -#define __NR_stty 31
1084 -#define __NR_gtty 32
1085 -#define __NR_access 33
1086 -#define __NR_nice 34
1087 -#define __NR_ftime 35
1088 -#define __NR_sync 36
1089 -#define __NR_kill 37
1090 -#define __NR_rename 38
1091 -#define __NR_mkdir 39
1092 -#define __NR_rmdir 40
1093 -#define __NR_dup 41
1094 -#define __NR_pipe 42
1095 -#define __NR_times 43
1096 -#define __NR_prof 44
1097 -#define __NR_brk 45
1098 -#define __NR_setgid 46
1099 -#define __NR_getgid 47
1100 -#define __NR_signal 48
1101 -#define __NR_geteuid 49
1102 -#define __NR_getegid 50
1103 -#define __NR_acct 51
1104 -#define __NR_umount2 52
1105 -#define __NR_lock 53
1106 -#define __NR_ioctl 54
1107 -#define __NR_fcntl 55
1108 -#define __NR_mpx 56
1109 -#define __NR_setpgid 57
1110 -#define __NR_ulimit 58
1111 -#define __NR_oldolduname 59
1112 -#define __NR_umask 60
1113 -#define __NR_chroot 61
1114 -#define __NR_ustat 62
1115 -#define __NR_dup2 63
1116 -#define __NR_getppid 64
1117 -#define __NR_getpgrp 65
1118 -#define __NR_setsid 66
1119 -#define __NR_sigaction 67
1120 -#define __NR_sgetmask 68
1121 -#define __NR_ssetmask 69
1122 -#define __NR_setreuid 70
1123 -#define __NR_setregid 71
1124 -#define __NR_sigsuspend 72
1125 -#define __NR_sigpending 73
1126 -#define __NR_sethostname 74
1127 -#define __NR_setrlimit 75
1128 -#define __NR_getrlimit 76
1129 -#define __NR_getrusage 77
1130 -#define __NR_gettimeofday 78
1131 -#define __NR_settimeofday 79
1132 -#define __NR_getgroups 80
1133 -#define __NR_setgroups 81
1134 -#define __NR_select 82
1135 -#define __NR_symlink 83
1136 -#define __NR_oldlstat 84
1137 -#define __NR_readlink 85
1138 -#define __NR_uselib 86
1139 -#define __NR_swapon 87
1140 -#define __NR_reboot 88
1141 -#define __NR_readdir 89
1142 -#define __NR_mmap 90
1143 -#define __NR_munmap 91
1144 -#define __NR_truncate 92
1145 -#define __NR_ftruncate 93
1146 -#define __NR_fchmod 94
1147 -#define __NR_fchown 95
1148 -#define __NR_getpriority 96
1149 -#define __NR_setpriority 97
1150 -#define __NR_profil 98
1151 -#define __NR_statfs 99
1152 -#define __NR_fstatfs 100
1153 -#define __NR_ioperm 101
1154 -#define __NR_socketcall 102
1155 -#define __NR_syslog 103
1156 -#define __NR_setitimer 104
1157 -#define __NR_getitimer 105
1158 -#define __NR_stat 106
1159 -#define __NR_lstat 107
1160 -#define __NR_fstat 108
1161 -#define __NR_olduname 109
1162 -#define __NR_iopl 110
1163 -#define __NR_vhangup 111
1164 -#define __NR_idle 112
1165 -#define __NR_vm86 113
1166 -#define __NR_wait4 114
1167 -#define __NR_swapoff 115
1168 -#define __NR_sysinfo 116
1169 -#define __NR_ipc 117
1170 -#define __NR_fsync 118
1171 -#define __NR_sigreturn 119
1172 -#define __NR_clone 120
1173 -#define __NR_setdomainname 121
1174 -#define __NR_uname 122
1175 -#define __NR_modify_ldt 123
1176 -#define __NR_adjtimex 124
1177 -#define __NR_mprotect 125
1178 -#define __NR_sigprocmask 126
1179 -#define __NR_create_module 127
1180 -#define __NR_init_module 128
1181 -#define __NR_delete_module 129
1182 -#define __NR_get_kernel_syms 130
1183 -#define __NR_quotactl 131
1184 -#define __NR_getpgid 132
1185 -#define __NR_fchdir 133
1186 -#define __NR_bdflush 134
1187 -#define __NR_sysfs 135
1188 -#define __NR_personality 136
1189 -#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
1190 -#define __NR_setfsuid 138
1191 -#define __NR_setfsgid 139
1192 -#define __NR__llseek 140
1193 -#define __NR_getdents 141
1194 -#define __NR__newselect 142
1195 -#define __NR_flock 143
1196 -#define __NR_msync 144
1197 -#define __NR_readv 145
1198 -#define __NR_writev 146
1199 -#define __NR_getsid 147
1200 -#define __NR_fdatasync 148
1201 -#define __NR__sysctl 149
1202 -#define __NR_mlock 150
1203 -#define __NR_munlock 151
1204 -#define __NR_mlockall 152
1205 -#define __NR_munlockall 153
1206 -#define __NR_sched_setparam 154
1207 -#define __NR_sched_getparam 155
1208 -#define __NR_sched_setscheduler 156
1209 -#define __NR_sched_getscheduler 157
1210 -#define __NR_sched_yield 158
1211 -#define __NR_sched_get_priority_max 159
1212 -#define __NR_sched_get_priority_min 160
1213 -#define __NR_sched_rr_get_interval 161
1214 -#define __NR_nanosleep 162
1215 -#define __NR_mremap 163
1216 -#define __NR_setresuid 164
1217 -#define __NR_getresuid 165
1218 -#define __NR_query_module 166
1219 -#define __NR_poll 167
1220 -#define __NR_nfsservctl 168
1221 -#define __NR_setresgid 169
1222 -#define __NR_getresgid 170
1223 -#define __NR_prctl 171
1224 -#define __NR_rt_sigreturn 172
1225 -#define __NR_rt_sigaction 173
1226 -#define __NR_rt_sigprocmask 174
1227 -#define __NR_rt_sigpending 175
1228 -#define __NR_rt_sigtimedwait 176
1229 -#define __NR_rt_sigqueueinfo 177
1230 -#define __NR_rt_sigsuspend 178
1231 -#define __NR_pread 179
1232 -#define __NR_pwrite 180
1233 -#define __NR_chown 181
1234 -#define __NR_getcwd 182
1235 -#define __NR_capget 183
1236 -#define __NR_capset 184
1237 -#define __NR_sigaltstack 185
1238 -#define __NR_sendfile 186
1239 -#define __NR_getpmsg 187 /* some people actually want streams */
1240 -#define __NR_putpmsg 188 /* some people actually want streams */
1241 -#define __NR_vfork 189
1242 -#define __NR_ugetrlimit 190 /* SuS compliant getrlimit */
1243 -#define __NR_readahead 191
1244 -#define __NR_mmap2 192
1245 -#define __NR_truncate64 193
1246 -#define __NR_ftruncate64 194
1247 -#define __NR_stat64 195
1248 -#define __NR_lstat64 196
1249 -#define __NR_fstat64 197
1250 -#define __NR_pciconfig_read 198
1251 -#define __NR_pciconfig_write 199
1252 -#define __NR_pciconfig_iobase 200
1253 -#define __NR_multiplexer 201
1254 -#define __NR_getdents64 202
1255 -#define __NR_pivot_root 203
1256 -#define __NR_fcntl64 204
1257 -#define __NR_madvise 205
1258 -#define __NR_mincore 206
1259 -#define __NR_gettid 207
1260 -#define __NR_tkill 208
1261 -#define __NR_setxattr 209
1262 -#define __NR_lsetxattr 210
1263 -#define __NR_fsetxattr 211
1264 -#define __NR_getxattr 212
1265 -#define __NR_lgetxattr 213
1266 -#define __NR_fgetxattr 214
1267 -#define __NR_listxattr 215
1268 -#define __NR_llistxattr 216
1269 -#define __NR_flistxattr 217
1270 -#define __NR_removexattr 218
1271 -#define __NR_lremovexattr 219
1272 -#define __NR_fremovexattr 220
1273 -#define __NR_futex 221
1274 -#define __NR_sched_setaffinity 222
1275 -#define __NR_sched_getaffinity 223
1276 -/* 224 currently unused */
1277 -#define __NR_tuxcall 225
1278 -#define __NR_sendfile64 226
1279 -#define __NR_io_setup 227
1280 -#define __NR_io_destroy 228
1281 -#define __NR_io_getevents 229
1282 -#define __NR_io_submit 230
1283 -#define __NR_io_cancel 231
1284 -#define __NR_set_tid_address 232
1285 -#define __NR_fadvise64 233
1286 -#define __NR_exit_group 234
1287 -#define __NR_lookup_dcookie 235
1288 -#define __NR_epoll_create 236
1289 -#define __NR_epoll_ctl 237
1290 -#define __NR_epoll_wait 238
1291 -#define __NR_remap_file_pages 239
1292 -#define __NR_timer_create 240
1293 -#define __NR_timer_settime 241
1294 -#define __NR_timer_gettime 242
1295 -#define __NR_timer_getoverrun 243
1296 -#define __NR_timer_delete 244
1297 -#define __NR_clock_settime 245
1298 -#define __NR_clock_gettime 246
1299 -#define __NR_clock_getres 247
1300 -#define __NR_clock_nanosleep 248
1301 -#define __NR_swapcontext 249
1302 -#define __NR_tgkill 250
1303 -#define __NR_utimes 251
1304 -#define __NR_statfs64 252
1305 -#define __NR_fstatfs64 253
1306 -#define __NR_fadvise64_64 254
1307 -#define __NR_rtas 255
1308 -#define __NR_sys_debug_setcontext 256
1309 -/* Number 257 is reserved for vserver */
1310 -/* Number 258 is reserved for new sys_remap_file_pages */
1311 -/* Number 259 is reserved for new sys_mbind */
1312 -/* Number 260 is reserved for new sys_get_mempolicy */
1313 -/* Number 261 is reserved for new sys_set_mempolicy */
1314 -#define __NR_mq_open 262
1315 -#define __NR_mq_unlink 263
1316 -#define __NR_mq_timedsend 264
1317 -#define __NR_mq_timedreceive 265
1318 -#define __NR_mq_notify 266
1319 -#define __NR_mq_getsetattr 267
1320 -#define __NR_kexec_load 268
1321 -#define __NR_add_key 269
1322 -#define __NR_request_key 270
1323 -#define __NR_keyctl 271
1324 -#define __NR_waitid 272
1325 -#define __NR_ioprio_set 273
1326 -#define __NR_ioprio_get 274
1327 -#define __NR_inotify_init 275
1328 -#define __NR_inotify_add_watch 276
1329 -#define __NR_inotify_rm_watch 277
1330 -
1331 -
1332 -#define syscall_weak(name,wsym,sym) \
1333 -.text; \
1334 -.type wsym,@function; \
1335 -.weak wsym; \
1336 -wsym: ; \
1337 -.type sym,@function; \
1338 -.global sym; \
1339 -sym: \
1340 - li 0,__NR_##name; \
1341 - b __unified_syscall
1342 -
1343 -#define syscall(name,sym) \
1344 -.text; \
1345 -.type sym,@function; \
1346 -.global sym; \
1347 -sym: \
1348 - li 0,__NR_##name; \
1349 - b __unified_syscall
1350 -
1351 diff -NurpP dietlibc-0.30-execstack/ppc/__testandset.S dietlibc-0.30-ppc-rename/ppc/__testandset.S
1352 --- dietlibc-0.30-execstack/ppc/__testandset.S 2006-09-07 12:24:13.119173750 +0200
1353 +++ dietlibc-0.30-ppc-rename/ppc/__testandset.S 1970-01-01 01:00:00.000000000 +0100
1354 @@ -1,16 +0,0 @@
1355 -.global __testandset
1356 -.type __testandset,@function
1357 -.align 2
1358 -__testandset:
1359 -1: lwarx 5,0,3
1360 - li 0,1
1361 - stwcx. 0,0,3
1362 - bne- 1b
1363 - mr 3,5
1364 - blr
1365 -.size __testandset,.-__testandset
1366 -
1367 -
1368 -#ifdef __ELF__
1369 -.section .note.GNU-stack,"",%progbits
1370 -#endif
1371 diff -NurpP dietlibc-0.30-execstack/ppc/unified.S dietlibc-0.30-ppc-rename/ppc/unified.S
1372 --- dietlibc-0.30-execstack/ppc/unified.S 2006-09-07 12:24:13.119173750 +0200
1373 +++ dietlibc-0.30-ppc-rename/ppc/unified.S 1970-01-01 01:00:00.000000000 +0100
1374 @@ -1,44 +0,0 @@
1375 -#include <dietfeatures.h>
1376 -#include "syscalls.h"
1377 -
1378 -.text
1379 -.type exit,@function
1380 -.weak exit
1381 -exit:
1382 -.type _exit,@function
1383 -.global _exit
1384 -_exit:
1385 - li 0,__NR_exit
1386 -.global __unified_syscall
1387 -__unified_syscall:
1388 - sc
1389 - bnslr+
1390 -
1391 -.global error_unified_syscall
1392 -error_unified_syscall:
1393 -#ifdef WANT_THREAD_SAFE
1394 - stwu 1,-16(1)
1395 - mflr 0
1396 - stw 0,20(1)
1397 - stw 3,12(1)
1398 - bl __errno_location
1399 - lwz 0,12(1)
1400 - stw 0,0(3)
1401 - lwz 0,20(1)
1402 - mtlr 0
1403 - addi 1,1,16
1404 -#else
1405 - lis 9,errno@ha
1406 - stw 3,errno@l(9)
1407 -#endif
1408 - li 3,-1
1409 -
1410 -/* here we go and "reuse" the return for weak-void functions */
1411 -#include "dietuglyweaks.h"
1412 -
1413 - blr
1414 -
1415 -
1416 -#ifdef __ELF__
1417 -.section .note.GNU-stack,"",%progbits
1418 -#endif
1419 diff -NurpP dietlibc-0.30-execstack/syscalls.h dietlibc-0.30-ppc-rename/syscalls.h
1420 --- dietlibc-0.30-execstack/syscalls.h 2005-03-15 09:51:22.000000000 +0100
1421 +++ dietlibc-0.30-ppc-rename/syscalls.h 2006-09-07 12:28:54.384751750 +0200
1422 @@ -15,7 +15,7 @@
1423 #include "ppc64/syscalls.h"
1424
1425 #elif defined(__powerpc__)
1426 -#include "ppc/syscalls.h"
1427 +#include "powerpc/syscalls.h"
1428
1429 #elif defined(__mips__)
1430 #include "mips/syscalls.h"

  ViewVC Help
Powered by ViewVC 1.1.20