Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 179408 | Differences between
and this patch

Collapse All | Expand All

(-)dietlibc-0.30-execstack/diet.c (-2 / +2 lines)
Lines 35-41 static const char* Os[] = { Link Here
35
  "arm","-Os","-fomit-frame-pointer",0,
35
  "arm","-Os","-fomit-frame-pointer",0,
36
  "mips","-Os","-fomit-frame-pointer","-mno-abicalls","-fno-pic","-G","0",0,
36
  "mips","-Os","-fomit-frame-pointer","-mno-abicalls","-fno-pic","-G","0",0,
37
  "mipsel","-Os","-fomit-frame-pointer","-mno-abicalls","-fno-pic","-G","0",0,
37
  "mipsel","-Os","-fomit-frame-pointer","-mno-abicalls","-fno-pic","-G","0",0,
38
  "ppc","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
38
  "powerpc","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
39
  "ppc64","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
39
  "ppc64","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
40
  "s390","-Os","-fomit-frame-pointer",0,
40
  "s390","-Os","-fomit-frame-pointer",0,
41
  "s390x","-Os","-fomit-frame-pointer",0,
41
  "s390x","-Os","-fomit-frame-pointer",0,
Lines 151-157 int main(int argc,char *argv[]) { Link Here
151
#endif
151
#endif
152
#endif
152
#endif
153
#ifdef __powerpc__
153
#ifdef __powerpc__
154
      shortplatform="ppc";
154
      shortplatform="powerpc";
155
#endif
155
#endif
156
#ifdef __powerpc64__
156
#ifdef __powerpc64__
157
      shortplatform="ppc64";
157
      shortplatform="ppc64";
(-)dietlibc-0.30-execstack/Makefile (-8 / +9 lines)
Lines 24-30 ifeq ($(MYARCH),alpha) Link Here
24
ARCH=alpha
24
ARCH=alpha
25
else
25
else
26
ifeq ($(MYARCH),ppc)
26
ifeq ($(MYARCH),ppc)
27
ARCH=ppc
27
ARCH=powerpc
28
MYARCH=powerpc
29
else
30
ifeq ($(MYARCH),powerpc)
31
ARCH=powerpc
28
else
32
else
29
ifeq ($(MYARCH),ppc64)
33
ifeq ($(MYARCH),ppc64)
30
ARCH=ppc64
34
ARCH=ppc64
Lines 80-85 endif Link Here
80
endif
84
endif
81
endif
85
endif
82
endif
86
endif
87
endif
83
88
84
# ARCH=$(MYARCH)
89
# ARCH=$(MYARCH)
85
90
Lines 385-391 uninstall: Link Here
385
	for i in `find include -name \*.h`; do rm -f $(DESTDIR)$(prefix)/$$i; done
390
	for i in `find include -name \*.h`; do rm -f $(DESTDIR)$(prefix)/$$i; done
386
	-rmdir $(DESTDIR)$(ILIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(BINDIR)
391
	-rmdir $(DESTDIR)$(ILIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(BINDIR)
387
392
388
.PHONY: sparc ppc mips arm alpha i386 parisc mipsel powerpc s390 sparc64
393
.PHONY: sparc powerpc mips arm alpha i386 parisc mipsel powerpc s390 sparc64
389
.PHONY: x86_64 ia64 ppc64 s390x
394
.PHONY: x86_64 ia64 ppc64 s390x
390
395
391
arm sparc alpha mips parisc s390 sparc64 x86_64 ia64 ppc64 s390x:
396
arm sparc alpha mips parisc s390 sparc64 x86_64 ia64 ppc64 s390x:
Lines 398-404 else Link Here
398
	$(MAKE) ARCH=$@ CROSS=$@-linux- all
403
	$(MAKE) ARCH=$@ CROSS=$@-linux- all
399
endif
404
endif
400
405
401
ppc:
406
powerpc:
402
ifeq ($(MYARCH),ppc64)
407
ifeq ($(MYARCH),ppc64)
403
	$(MAKE) ARCH=$@ CC="$(CC) -m32" all
408
	$(MAKE) ARCH=$@ CC="$(CC) -m32" all
404
else
409
else
Lines 412-426 mipsel: Link Here
412
mips-gnu:
417
mips-gnu:
413
	$(MAKE) ARCH=$@ CROSS=$@-linux-gnu- all
418
	$(MAKE) ARCH=$@ CROSS=$@-linux-gnu- all
414
419
415
# Some people named their cross compiler toolchain powerpc-linux-gcc
416
powerpc:
417
	$(MAKE) ARCH=ppc CROSS=powerpc-linux- all
418
419
hppa:
420
hppa:
420
	ln -sf bin-parisc bin-hppa
421
	ln -sf bin-parisc bin-hppa
421
	$(MAKE) ARCH=parisc CROSS=hppa-linux- all
422
	$(MAKE) ARCH=parisc CROSS=hppa-linux- all
422
423
423
CROSS_ARCH=arm sparc ppc alpha i386 mips sparc64 x86_64 s390 parisc
424
CROSS_ARCH=arm sparc powerpc alpha i386 mips sparc64 x86_64 s390 parisc
424
cross:
425
cross:
425
	$(MAKE) $(subst $(ARCH),,$(CROSS_ARCH))
426
	$(MAKE) $(subst $(ARCH),,$(CROSS_ARCH))
426
427
(-)dietlibc-0.30-execstack/powerpc/clone.S (+52 lines)
Line 0 Link Here
1
#include <dietfeatures.h>
2
#include "syscalls.h"
3
#include <errno.h>
4
5
.text
6
.weak clone
7
clone:
8
.global __clone
9
__clone:
10
	cmpwi	     4,0	/* check have non null child_stack pointer */
11
	cmpwi	cr1, 3,0	/* check have non null thread_funcion */
12
	cror	eq,4*cr1+eq,eq	/* now if eq is set one is or both are zero */
13
	beq	.Lclone_error
14
15
	stwu	 1,-32(1)	/* alloc some space on the stack */
16
	stmw	29, 16(1)	/* save r29,r30,r31 on stack */
17
18
	rlwinm	4,4,0,0,27	/* mask out lower 4 bits */
19
20
	/* move parameter to positions clone wants them */
21
	mr	29,3		/* r29 = r3 fn */
22
	mr	30,4		/* r30 = r4 stack */
23
	mr	31,6		/* r31 = r6 arg */
24
	mr	3, 5		/* r3  = r5 flags */
25
26
	li	0, __NR_clone	/* load syscall nr. */
27
	sc
28
29
	cmpwi	cr1,3,0		/* compare return of syscall with 0 */
30
	crandc	4*cr1+eq,4*cr1+eq,so
31
	bne	.Lclone_parent	/* return was non zero -> .Lclone_parent */
32
33
	/* we are the cloned process */
34
	mr	 1, 30		/* set stack pointer */
35
	mtctr	29		/* set count register to fn ? */
36
	mr	 3, 31		/* set argument */
37
	bctrl			/* branch trough count register and link */
38
	b	_exit		/* exit thread */
39
40
.Lclone_parent:
41
	lmw	29,16(1)	/* restore saved registers */
42
	addi	 1, 1,32	/* free stack */
43
	bnslr+			/* had cloned a thread so return to parent */
44
	b	error_unified_syscall
45
46
.Lclone_error:
47
	li	3, EINVAL
48
	b	error_unified_syscall
49
50
#ifdef __ELF__
51
.section .note.GNU-stack,"",%progbits
52
#endif
(-)dietlibc-0.30-execstack/powerpc/__longjmp.S (+63 lines)
Line 0 Link Here
1
#include <setjmp.h>
2
3
4
#ifdef PIC
5
#define JUMPTARGET(name) name##@plt
6
#else
7
#define JUMPTARGET(name) name
8
#endif
9
10
.global __longjmp
11
.type __longjmp,@function
12
.align 2
13
__longjmp:
14
	lwz 1,(JB_GPR1*4)(3)
15
	lwz 2,(JB_GPR2*4)(3)
16
	lwz 0,(JB_LR*4)(3)
17
	lwz 14,((JB_GPRS+0)*4)(3)
18
	lfd 14,((JB_FPRS+0*2)*4)(3)
19
	lwz 15,((JB_GPRS+1)*4)(3)
20
	lfd 15,((JB_FPRS+1*2)*4)(3)
21
	lwz 16,((JB_GPRS+2)*4)(3)
22
	lfd 16,((JB_FPRS+2*2)*4)(3)
23
	lwz 17,((JB_GPRS+3)*4)(3)
24
	lfd 17,((JB_FPRS+3*2)*4)(3)
25
	lwz 18,((JB_GPRS+4)*4)(3)
26
	lfd 18,((JB_FPRS+4*2)*4)(3)
27
	lwz 19,((JB_GPRS+5)*4)(3)
28
	lfd 19,((JB_FPRS+5*2)*4)(3)
29
	lwz 20,((JB_GPRS+6)*4)(3)
30
	lfd 20,((JB_FPRS+6*2)*4)(3)
31
	mtlr 0
32
	lwz 21,((JB_GPRS+7)*4)(3)
33
	lfd 21,((JB_FPRS+7*2)*4)(3)
34
	lwz 22,((JB_GPRS+8)*4)(3)
35
	lfd 22,((JB_FPRS+8*2)*4)(3)
36
	lwz 0,(JB_CR*4)(3)
37
	lwz 23,((JB_GPRS+9)*4)(3)
38
	lfd 23,((JB_FPRS+9*2)*4)(3)
39
	lwz 24,((JB_GPRS+10)*4)(3)
40
	lfd 24,((JB_FPRS+10*2)*4)(3)
41
	lwz 25,((JB_GPRS+11)*4)(3)
42
	lfd 25,((JB_FPRS+11*2)*4)(3)
43
	mtcrf 0xFF,0
44
	lwz 26,((JB_GPRS+12)*4)(3)
45
	lfd 26,((JB_FPRS+12*2)*4)(3)
46
	lwz 27,((JB_GPRS+13)*4)(3)
47
	lfd 27,((JB_FPRS+13*2)*4)(3)
48
	lwz 28,((JB_GPRS+14)*4)(3)
49
	lfd 28,((JB_FPRS+14*2)*4)(3)
50
	lwz 29,((JB_GPRS+15)*4)(3)
51
	lfd 29,((JB_FPRS+15*2)*4)(3)
52
	lwz 30,((JB_GPRS+16)*4)(3)
53
	lfd 30,((JB_FPRS+16*2)*4)(3)
54
	lwz 31,((JB_GPRS+17)*4)(3)
55
	lfd 31,((JB_FPRS+17*2)*4)(3)
56
	mr 3,4
57
	blr
58
.size __longjmp,.-__longjmp
59
60
61
#ifdef __ELF__
62
.section .note.GNU-stack,"",%progbits
63
#endif
(-)dietlibc-0.30-execstack/powerpc/Makefile.add (+3 lines)
Line 0 Link Here
1
2
CFLAGS+=-mpowerpc-gpopt -mpowerpc-gfxopt -Os
3
VPATH:=powerpc:syscalls.s:$(VPATH)
(-)dietlibc-0.30-execstack/powerpc/mmap.c (+40 lines)
Line 0 Link Here
1
#include "dietfeatures.h"
2
#include <sys/types.h>
3
#include <errno.h>
4
#include "syscalls.h"
5
6
int mmap(void*start,size_t length,int prot,int flags,int fd,off_t offset) {
7
  unsigned long __sc_ret, __sc_err;
8
  {
9
    register unsigned long __sc_0 __asm__ ("r0");
10
    register unsigned long __sc_3 __asm__ ("r3");
11
    register unsigned long __sc_4 __asm__ ("r4");
12
    register unsigned long __sc_5 __asm__ ("r5");
13
    register unsigned long __sc_6 __asm__ ("r6");
14
    register unsigned long __sc_7 __asm__ ("r7");
15
    register unsigned long __sc_8 __asm__ ("r8");
16
17
    __sc_3 = (unsigned long) (start);
18
    __sc_4 = (unsigned long) (length);
19
    __sc_5 = (unsigned long) (prot);
20
    __sc_6 = (unsigned long) (flags);
21
    __sc_7 = (unsigned long) (fd);
22
    __sc_8 = (unsigned long) (offset);
23
    __sc_0 = __NR_mmap;
24
    __asm__ __volatile__
25
	    ("sc           \n\t"
26
	      "mfcr %1      "
27
	    : "=&r" (__sc_3), "=&r" (__sc_0)
28
	    : "0"   (__sc_3), "1"   (__sc_0),
29
	      "r"   (__sc_4),
30
	      "r"   (__sc_5),
31
	      "r"   (__sc_6),
32
	      "r"   (__sc_7),
33
	      "r"   (__sc_8)
34
	    : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
35
    __sc_ret = __sc_3;
36
    __sc_err = __sc_0;
37
  }
38
  return (__sc_err & 0x10000000 ? errno = __sc_ret, __sc_ret = -1 : 0),
39
	  (int) __sc_ret;
40
}
(-)dietlibc-0.30-execstack/powerpc/setjmp.S (+60 lines)
Line 0 Link Here
1
#include <setjmp.h>
2
3
#ifdef PIC
4
#define JUMPTARGET(name) name##@plt
5
#else
6
#define JUMPTARGET(name) name
7
#endif
8
9
.global __sigsetjmp
10
.type __sigsetjmp,@function
11
.align 2
12
__sigsetjmp:
13
        stw  1,(JB_GPR1*4)(3)
14
        mflr 0
15
        stw  2,(JB_GPR2*4)(3)
16
        stw  14,((JB_GPRS+0)*4)(3)
17
        stfd 14,((JB_FPRS+0*2)*4)(3)
18
        stw  0,(JB_LR*4)(3)
19
        stw  15,((JB_GPRS+1)*4)(3)
20
        stfd 15,((JB_FPRS+1*2)*4)(3)
21
        mfcr 0
22
        stw  16,((JB_GPRS+2)*4)(3)
23
        stfd 16,((JB_FPRS+2*2)*4)(3)
24
        stw  0,(JB_CR*4)(3)
25
        stw  17,((JB_GPRS+3)*4)(3)
26
        stfd 17,((JB_FPRS+3*2)*4)(3)
27
        stw  18,((JB_GPRS+4)*4)(3)
28
        stfd 18,((JB_FPRS+4*2)*4)(3)
29
        stw  19,((JB_GPRS+5)*4)(3)
30
        stfd 19,((JB_FPRS+5*2)*4)(3)
31
        stw  20,((JB_GPRS+6)*4)(3)
32
        stfd 20,((JB_FPRS+6*2)*4)(3)
33
        stw  21,((JB_GPRS+7)*4)(3)
34
        stfd 21,((JB_FPRS+7*2)*4)(3)
35
        stw  22,((JB_GPRS+8)*4)(3)
36
        stfd 22,((JB_FPRS+8*2)*4)(3)
37
        stw  23,((JB_GPRS+9)*4)(3)
38
        stfd 23,((JB_FPRS+9*2)*4)(3)
39
        stw  24,((JB_GPRS+10)*4)(3)
40
        stfd 24,((JB_FPRS+10*2)*4)(3)
41
        stw  25,((JB_GPRS+11)*4)(3)
42
        stfd 25,((JB_FPRS+11*2)*4)(3)
43
        stw  26,((JB_GPRS+12)*4)(3)
44
        stfd 26,((JB_FPRS+12*2)*4)(3)
45
        stw  27,((JB_GPRS+13)*4)(3)
46
        stfd 27,((JB_FPRS+13*2)*4)(3)
47
        stw  28,((JB_GPRS+14)*4)(3)
48
        stfd 28,((JB_FPRS+14*2)*4)(3)
49
        stw  29,((JB_GPRS+15)*4)(3)
50
        stfd 29,((JB_FPRS+15*2)*4)(3)
51
        stw  30,((JB_GPRS+16)*4)(3)
52
        stfd 30,((JB_FPRS+16*2)*4)(3)
53
        stw  31,((JB_GPRS+17)*4)(3)
54
        stfd 31,((JB_FPRS+17*2)*4)(3)
55
        b JUMPTARGET (__sigjmp_save)
56
.size __sigsetjmp,.-__sigsetjmp
57
58
#ifdef __ELF__
59
.section .note.GNU-stack,"",%progbits
60
#endif
(-)dietlibc-0.30-execstack/powerpc/start.S (+56 lines)
Line 0 Link Here
1
#include "dietfeatures.h"
2
3
.text
4
.global _start
5
.type _start,@function
6
_start:
7
 /* Save the stack pointer, in case we're statically linked under Linux.  */
8
	mr	9,1
9
 /* Set up an initial stack frame, and clear the LR.  */
10
	clrrwi	1,1,4
11
	li	0,0
12
	stwu	1,-16(1)
13
	mtlr	0
14
	stw	0,0(1)
15
16
 /* r9 contains the initial stack pointer
17
    argc = (r9)
18
    argv = (r9+4)
19
    envp = argv+(argc+1)*4 */
20
21
	lis	14,__libc_stack_end@ha
22
	stw	9,__libc_stack_end@l(14)
23
24
	lwzu	3,0(9)	/* argc */
25
	addi	4,9,4	/* argv */
26
	add	5,0,3	/* argc... */
27
	addi	5,5,1	/* argc+1...*/
28
	slwi	5,5,2	/* (argc+1)*4 */
29
	add	5,5,4	/* argv+(argc+1)*4 */
30
31
	lis	14,environ@ha
32
	stw	5,environ@l(14)
33
34
#ifdef WANT_DYNAMIC
35
	mr	6,7
36
	bl	_dyn_start
37
#else
38
	bl	CALL_IN_STARTCODE
39
#endif
40
	b	exit
41
.size _start,.-_start
42
43
44
/* Define a symbol for the first piece of initialized data.  */
45
	.section ".data"
46
__data_start:
47
48
/* this is needed for libgcc_eh.a - see gcc-3.4/gcc/config/rs6000/linux-unwind.h */
49
	.weak	__libc_stack_end
50
	.lcomm	__libc_stack_end,4,4
51
	.type	__libc_stack_end,@object
52
53
54
#ifdef __ELF__
55
.section .note.GNU-stack,"",%progbits
56
#endif
(-)dietlibc-0.30-execstack/powerpc/syscalls.h (+299 lines)
Line 0 Link Here
1
2
#define __NR_exit		  1
3
#define __NR_fork		  2
4
#define __NR_read		  3
5
#define __NR_write		  4
6
#define __NR_open		  5
7
#define __NR_close		  6
8
#define __NR_waitpid		  7
9
#define __NR_creat		  8
10
#define __NR_link		  9
11
#define __NR_unlink		 10
12
#define __NR_execve		 11
13
#define __NR_chdir		 12
14
#define __NR_time		 13
15
#define __NR_mknod		 14
16
#define __NR_chmod		 15
17
#define __NR_lchown		 16
18
#define __NR_break		 17
19
#define __NR_oldstat		 18
20
#define __NR_lseek		 19
21
#define __NR_getpid		 20
22
#define __NR_mount		 21
23
#define __NR_umount		 22
24
#define __NR_setuid		 23
25
#define __NR_getuid		 24
26
#define __NR_stime		 25
27
#define __NR_ptrace		 26
28
#define __NR_alarm		 27
29
#define __NR_oldfstat		 28
30
#define __NR_pause		 29
31
#define __NR_utime		 30
32
#define __NR_stty		 31
33
#define __NR_gtty		 32
34
#define __NR_access		 33
35
#define __NR_nice		 34
36
#define __NR_ftime		 35
37
#define __NR_sync		 36
38
#define __NR_kill		 37
39
#define __NR_rename		 38
40
#define __NR_mkdir		 39
41
#define __NR_rmdir		 40
42
#define __NR_dup		 41
43
#define __NR_pipe		 42
44
#define __NR_times		 43
45
#define __NR_prof		 44
46
#define __NR_brk		 45
47
#define __NR_setgid		 46
48
#define __NR_getgid		 47
49
#define __NR_signal		 48
50
#define __NR_geteuid		 49
51
#define __NR_getegid		 50
52
#define __NR_acct		 51
53
#define __NR_umount2		 52
54
#define __NR_lock		 53
55
#define __NR_ioctl		 54
56
#define __NR_fcntl		 55
57
#define __NR_mpx		 56
58
#define __NR_setpgid		 57
59
#define __NR_ulimit		 58
60
#define __NR_oldolduname	 59
61
#define __NR_umask		 60
62
#define __NR_chroot		 61
63
#define __NR_ustat		 62
64
#define __NR_dup2		 63
65
#define __NR_getppid		 64
66
#define __NR_getpgrp		 65
67
#define __NR_setsid		 66
68
#define __NR_sigaction		 67
69
#define __NR_sgetmask		 68
70
#define __NR_ssetmask		 69
71
#define __NR_setreuid		 70
72
#define __NR_setregid		 71
73
#define __NR_sigsuspend		 72
74
#define __NR_sigpending		 73
75
#define __NR_sethostname	 74
76
#define __NR_setrlimit		 75
77
#define __NR_getrlimit		 76
78
#define __NR_getrusage		 77
79
#define __NR_gettimeofday	 78
80
#define __NR_settimeofday	 79
81
#define __NR_getgroups		 80
82
#define __NR_setgroups		 81
83
#define __NR_select		 82
84
#define __NR_symlink		 83
85
#define __NR_oldlstat		 84
86
#define __NR_readlink		 85
87
#define __NR_uselib		 86
88
#define __NR_swapon		 87
89
#define __NR_reboot		 88
90
#define __NR_readdir		 89
91
#define __NR_mmap		 90
92
#define __NR_munmap		 91
93
#define __NR_truncate		 92
94
#define __NR_ftruncate		 93
95
#define __NR_fchmod		 94
96
#define __NR_fchown		 95
97
#define __NR_getpriority	 96
98
#define __NR_setpriority	 97
99
#define __NR_profil		 98
100
#define __NR_statfs		 99
101
#define __NR_fstatfs		100
102
#define __NR_ioperm		101
103
#define __NR_socketcall		102
104
#define __NR_syslog		103
105
#define __NR_setitimer		104
106
#define __NR_getitimer		105
107
#define __NR_stat		106
108
#define __NR_lstat		107
109
#define __NR_fstat		108
110
#define __NR_olduname		109
111
#define __NR_iopl		110
112
#define __NR_vhangup		111
113
#define __NR_idle		112
114
#define __NR_vm86		113
115
#define __NR_wait4		114
116
#define __NR_swapoff		115
117
#define __NR_sysinfo		116
118
#define __NR_ipc		117
119
#define __NR_fsync		118
120
#define __NR_sigreturn		119
121
#define __NR_clone		120
122
#define __NR_setdomainname	121
123
#define __NR_uname		122
124
#define __NR_modify_ldt		123
125
#define __NR_adjtimex		124
126
#define __NR_mprotect		125
127
#define __NR_sigprocmask	126
128
#define __NR_create_module	127
129
#define __NR_init_module	128
130
#define __NR_delete_module	129
131
#define __NR_get_kernel_syms	130
132
#define __NR_quotactl		131
133
#define __NR_getpgid		132
134
#define __NR_fchdir		133
135
#define __NR_bdflush		134
136
#define __NR_sysfs		135
137
#define __NR_personality	136
138
#define __NR_afs_syscall	137 /* Syscall for Andrew File System */
139
#define __NR_setfsuid		138
140
#define __NR_setfsgid		139
141
#define __NR__llseek		140
142
#define __NR_getdents		141
143
#define __NR__newselect		142
144
#define __NR_flock		143
145
#define __NR_msync		144
146
#define __NR_readv		145
147
#define __NR_writev		146
148
#define __NR_getsid		147
149
#define __NR_fdatasync		148
150
#define __NR__sysctl		149
151
#define __NR_mlock		150
152
#define __NR_munlock		151
153
#define __NR_mlockall		152
154
#define __NR_munlockall		153
155
#define __NR_sched_setparam		154
156
#define __NR_sched_getparam		155
157
#define __NR_sched_setscheduler		156
158
#define __NR_sched_getscheduler		157
159
#define __NR_sched_yield		158
160
#define __NR_sched_get_priority_max	159
161
#define __NR_sched_get_priority_min	160
162
#define __NR_sched_rr_get_interval	161
163
#define __NR_nanosleep		162
164
#define __NR_mremap		163
165
#define __NR_setresuid		164
166
#define __NR_getresuid		165
167
#define __NR_query_module	166
168
#define __NR_poll		167
169
#define __NR_nfsservctl		168
170
#define __NR_setresgid		169
171
#define __NR_getresgid		170
172
#define __NR_prctl		171
173
#define __NR_rt_sigreturn	172
174
#define __NR_rt_sigaction	173
175
#define __NR_rt_sigprocmask	174
176
#define __NR_rt_sigpending	175
177
#define __NR_rt_sigtimedwait	176
178
#define __NR_rt_sigqueueinfo	177
179
#define __NR_rt_sigsuspend	178
180
#define __NR_pread		179
181
#define __NR_pwrite		180
182
#define __NR_chown		181
183
#define __NR_getcwd		182
184
#define __NR_capget		183
185
#define __NR_capset		184
186
#define __NR_sigaltstack	185
187
#define __NR_sendfile		186
188
#define __NR_getpmsg		187	/* some people actually want streams */
189
#define __NR_putpmsg		188	/* some people actually want streams */
190
#define __NR_vfork		189
191
#define __NR_ugetrlimit		190	/* SuS compliant getrlimit */
192
#define __NR_readahead		191
193
#define __NR_mmap2		192
194
#define __NR_truncate64		193
195
#define __NR_ftruncate64	194
196
#define __NR_stat64		195
197
#define __NR_lstat64		196
198
#define __NR_fstat64		197
199
#define __NR_pciconfig_read	198
200
#define __NR_pciconfig_write	199
201
#define __NR_pciconfig_iobase	200
202
#define __NR_multiplexer	201
203
#define __NR_getdents64		202
204
#define __NR_pivot_root		203
205
#define __NR_fcntl64		204
206
#define __NR_madvise		205
207
#define __NR_mincore		206
208
#define __NR_gettid		207
209
#define __NR_tkill		208
210
#define __NR_setxattr		209
211
#define __NR_lsetxattr		210
212
#define __NR_fsetxattr		211
213
#define __NR_getxattr		212
214
#define __NR_lgetxattr		213
215
#define __NR_fgetxattr		214
216
#define __NR_listxattr		215
217
#define __NR_llistxattr		216
218
#define __NR_flistxattr		217
219
#define __NR_removexattr	218
220
#define __NR_lremovexattr	219
221
#define __NR_fremovexattr	220
222
#define __NR_futex		221
223
#define __NR_sched_setaffinity	222
224
#define __NR_sched_getaffinity	223
225
/* 224 currently unused */
226
#define __NR_tuxcall		225
227
#define __NR_sendfile64		226
228
#define __NR_io_setup		227
229
#define __NR_io_destroy		228
230
#define __NR_io_getevents	229
231
#define __NR_io_submit		230
232
#define __NR_io_cancel		231
233
#define __NR_set_tid_address	232
234
#define __NR_fadvise64		233
235
#define __NR_exit_group		234
236
#define __NR_lookup_dcookie	235
237
#define __NR_epoll_create	236
238
#define __NR_epoll_ctl		237
239
#define __NR_epoll_wait		238
240
#define __NR_remap_file_pages	239
241
#define __NR_timer_create	240
242
#define __NR_timer_settime	241
243
#define __NR_timer_gettime	242
244
#define __NR_timer_getoverrun	243
245
#define __NR_timer_delete	244
246
#define __NR_clock_settime	245
247
#define __NR_clock_gettime	246
248
#define __NR_clock_getres	247
249
#define __NR_clock_nanosleep	248
250
#define __NR_swapcontext	249
251
#define __NR_tgkill		250
252
#define __NR_utimes		251
253
#define __NR_statfs64		252
254
#define __NR_fstatfs64		253
255
#define __NR_fadvise64_64	254
256
#define __NR_rtas		255
257
#define __NR_sys_debug_setcontext 256
258
/* Number 257 is reserved for vserver */
259
/* Number 258 is reserved for new sys_remap_file_pages */
260
/* Number 259 is reserved for new sys_mbind */
261
/* Number 260 is reserved for new sys_get_mempolicy */
262
/* Number 261 is reserved for new sys_set_mempolicy */
263
#define __NR_mq_open		262
264
#define __NR_mq_unlink		263
265
#define __NR_mq_timedsend	264
266
#define __NR_mq_timedreceive	265
267
#define __NR_mq_notify		266
268
#define __NR_mq_getsetattr	267
269
#define __NR_kexec_load		268
270
#define __NR_add_key		269
271
#define __NR_request_key	270
272
#define __NR_keyctl		271
273
#define __NR_waitid		272
274
#define __NR_ioprio_set		273
275
#define __NR_ioprio_get		274
276
#define __NR_inotify_init	275
277
#define __NR_inotify_add_watch	276
278
#define __NR_inotify_rm_watch	277
279
280
281
#define syscall_weak(name,wsym,sym) \
282
.text; \
283
.type wsym,@function; \
284
.weak wsym; \
285
wsym: ; \
286
.type sym,@function; \
287
.global sym; \
288
sym: \
289
	li	0,__NR_##name; \
290
	b __unified_syscall
291
292
#define syscall(name,sym) \
293
.text; \
294
.type sym,@function; \
295
.global sym; \
296
sym: \
297
	li	0,__NR_##name; \
298
	b __unified_syscall
299
(-)dietlibc-0.30-execstack/powerpc/__testandset.S (+16 lines)
Line 0 Link Here
1
.global __testandset
2
.type __testandset,@function
3
.align 2
4
__testandset:
5
1:	lwarx	5,0,3
6
	li	0,1
7
	stwcx.	0,0,3
8
	bne-	1b
9
	mr	3,5
10
	blr
11
.size __testandset,.-__testandset
12
13
14
#ifdef __ELF__
15
.section .note.GNU-stack,"",%progbits
16
#endif
(-)dietlibc-0.30-execstack/powerpc/unified.S (+44 lines)
Line 0 Link Here
1
#include <dietfeatures.h>
2
#include "syscalls.h"
3
4
.text
5
.type exit,@function
6
.weak exit
7
exit:
8
.type _exit,@function
9
.global _exit
10
_exit:
11
	li	0,__NR_exit
12
.global __unified_syscall
13
__unified_syscall:
14
	sc
15
	bnslr+
16
17
.global error_unified_syscall
18
error_unified_syscall:
19
#ifdef WANT_THREAD_SAFE
20
	stwu	1,-16(1)
21
	mflr	0
22
	stw	0,20(1)
23
	stw	3,12(1)
24
	bl	__errno_location
25
	lwz	0,12(1)
26
	stw	0,0(3)
27
	lwz	0,20(1)
28
	mtlr	0
29
	addi	1,1,16
30
#else
31
	lis	9,errno@ha
32
	stw	3,errno@l(9)
33
#endif
34
	li	3,-1
35
36
/* here we go and "reuse" the return for weak-void functions */
37
#include "dietuglyweaks.h"
38
39
	blr
40
41
42
#ifdef __ELF__
43
.section .note.GNU-stack,"",%progbits
44
#endif
(-)dietlibc-0.30-execstack/ppc/clone.S (-52 lines)
Lines 1-52 Link Here
1
#include <dietfeatures.h>
2
#include "syscalls.h"
3
#include <errno.h>
4
5
.text
6
.weak clone
7
clone:
8
.global __clone
9
__clone:
10
	cmpwi	     4,0	/* check have non null child_stack pointer */
11
	cmpwi	cr1, 3,0	/* check have non null thread_funcion */
12
	cror	eq,4*cr1+eq,eq	/* now if eq is set one is or both are zero */
13
	beq	.Lclone_error
14
15
	stwu	 1,-32(1)	/* alloc some space on the stack */
16
	stmw	29, 16(1)	/* save r29,r30,r31 on stack */
17
18
	rlwinm	4,4,0,0,27	/* mask out lower 4 bits */
19
20
	/* move parameter to positions clone wants them */
21
	mr	29,3		/* r29 = r3 fn */
22
	mr	30,4		/* r30 = r4 stack */
23
	mr	31,6		/* r31 = r6 arg */
24
	mr	3, 5		/* r3  = r5 flags */
25
26
	li	0, __NR_clone	/* load syscall nr. */
27
	sc
28
29
	cmpwi	cr1,3,0		/* compare return of syscall with 0 */
30
	crandc	4*cr1+eq,4*cr1+eq,so
31
	bne	.Lclone_parent	/* return was non zero -> .Lclone_parent */
32
33
	/* we are the cloned process */
34
	mr	 1, 30		/* set stack pointer */
35
	mtctr	29		/* set count register to fn ? */
36
	mr	 3, 31		/* set argument */
37
	bctrl			/* branch trough count register and link */
38
	b	_exit		/* exit thread */
39
40
.Lclone_parent:
41
	lmw	29,16(1)	/* restore saved registers */
42
	addi	 1, 1,32	/* free stack */
43
	bnslr+			/* had cloned a thread so return to parent */
44
	b	error_unified_syscall
45
46
.Lclone_error:
47
	li	3, EINVAL
48
	b	error_unified_syscall
49
50
#ifdef __ELF__
51
.section .note.GNU-stack,"",%progbits
52
#endif
(-)dietlibc-0.30-execstack/ppc/__longjmp.S (-63 lines)
Lines 1-63 Link Here
1
#include <setjmp.h>
2
3
4
#ifdef PIC
5
#define JUMPTARGET(name) name##@plt
6
#else
7
#define JUMPTARGET(name) name
8
#endif
9
10
.global __longjmp
11
.type __longjmp,@function
12
.align 2
13
__longjmp:
14
	lwz 1,(JB_GPR1*4)(3)
15
	lwz 2,(JB_GPR2*4)(3)
16
	lwz 0,(JB_LR*4)(3)
17
	lwz 14,((JB_GPRS+0)*4)(3)
18
	lfd 14,((JB_FPRS+0*2)*4)(3)
19
	lwz 15,((JB_GPRS+1)*4)(3)
20
	lfd 15,((JB_FPRS+1*2)*4)(3)
21
	lwz 16,((JB_GPRS+2)*4)(3)
22
	lfd 16,((JB_FPRS+2*2)*4)(3)
23
	lwz 17,((JB_GPRS+3)*4)(3)
24
	lfd 17,((JB_FPRS+3*2)*4)(3)
25
	lwz 18,((JB_GPRS+4)*4)(3)
26
	lfd 18,((JB_FPRS+4*2)*4)(3)
27
	lwz 19,((JB_GPRS+5)*4)(3)
28
	lfd 19,((JB_FPRS+5*2)*4)(3)
29
	lwz 20,((JB_GPRS+6)*4)(3)
30
	lfd 20,((JB_FPRS+6*2)*4)(3)
31
	mtlr 0
32
	lwz 21,((JB_GPRS+7)*4)(3)
33
	lfd 21,((JB_FPRS+7*2)*4)(3)
34
	lwz 22,((JB_GPRS+8)*4)(3)
35
	lfd 22,((JB_FPRS+8*2)*4)(3)
36
	lwz 0,(JB_CR*4)(3)
37
	lwz 23,((JB_GPRS+9)*4)(3)
38
	lfd 23,((JB_FPRS+9*2)*4)(3)
39
	lwz 24,((JB_GPRS+10)*4)(3)
40
	lfd 24,((JB_FPRS+10*2)*4)(3)
41
	lwz 25,((JB_GPRS+11)*4)(3)
42
	lfd 25,((JB_FPRS+11*2)*4)(3)
43
	mtcrf 0xFF,0
44
	lwz 26,((JB_GPRS+12)*4)(3)
45
	lfd 26,((JB_FPRS+12*2)*4)(3)
46
	lwz 27,((JB_GPRS+13)*4)(3)
47
	lfd 27,((JB_FPRS+13*2)*4)(3)
48
	lwz 28,((JB_GPRS+14)*4)(3)
49
	lfd 28,((JB_FPRS+14*2)*4)(3)
50
	lwz 29,((JB_GPRS+15)*4)(3)
51
	lfd 29,((JB_FPRS+15*2)*4)(3)
52
	lwz 30,((JB_GPRS+16)*4)(3)
53
	lfd 30,((JB_FPRS+16*2)*4)(3)
54
	lwz 31,((JB_GPRS+17)*4)(3)
55
	lfd 31,((JB_FPRS+17*2)*4)(3)
56
	mr 3,4
57
	blr
58
.size __longjmp,.-__longjmp
59
60
61
#ifdef __ELF__
62
.section .note.GNU-stack,"",%progbits
63
#endif
(-)dietlibc-0.30-execstack/ppc/Makefile.add (-3 lines)
Lines 1-3 Link Here
1
2
CFLAGS+=-mpowerpc-gpopt -mpowerpc-gfxopt -Os
3
VPATH:=ppc:syscalls.s:$(VPATH)
(-)dietlibc-0.30-execstack/ppc/mmap.c (-40 lines)
Lines 1-40 Link Here
1
#include "dietfeatures.h"
2
#include <sys/types.h>
3
#include <errno.h>
4
#include "syscalls.h"
5
6
int mmap(void*start,size_t length,int prot,int flags,int fd,off_t offset) {
7
  unsigned long __sc_ret, __sc_err;
8
  {
9
    register unsigned long __sc_0 __asm__ ("r0");
10
    register unsigned long __sc_3 __asm__ ("r3");
11
    register unsigned long __sc_4 __asm__ ("r4");
12
    register unsigned long __sc_5 __asm__ ("r5");
13
    register unsigned long __sc_6 __asm__ ("r6");
14
    register unsigned long __sc_7 __asm__ ("r7");
15
    register unsigned long __sc_8 __asm__ ("r8");
16
17
    __sc_3 = (unsigned long) (start);
18
    __sc_4 = (unsigned long) (length);
19
    __sc_5 = (unsigned long) (prot);
20
    __sc_6 = (unsigned long) (flags);
21
    __sc_7 = (unsigned long) (fd);
22
    __sc_8 = (unsigned long) (offset);
23
    __sc_0 = __NR_mmap;
24
    __asm__ __volatile__
25
	    ("sc           \n\t"
26
	      "mfcr %1      "
27
	    : "=&r" (__sc_3), "=&r" (__sc_0)
28
	    : "0"   (__sc_3), "1"   (__sc_0),
29
	      "r"   (__sc_4),
30
	      "r"   (__sc_5),
31
	      "r"   (__sc_6),
32
	      "r"   (__sc_7),
33
	      "r"   (__sc_8)
34
	    : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
35
    __sc_ret = __sc_3;
36
    __sc_err = __sc_0;
37
  }
38
  return (__sc_err & 0x10000000 ? errno = __sc_ret, __sc_ret = -1 : 0),
39
	  (int) __sc_ret;
40
}
(-)dietlibc-0.30-execstack/ppc/setjmp.S (-60 lines)
Lines 1-60 Link Here
1
#include <setjmp.h>
2
3
#ifdef PIC
4
#define JUMPTARGET(name) name##@plt
5
#else
6
#define JUMPTARGET(name) name
7
#endif
8
9
.global __sigsetjmp
10
.type __sigsetjmp,@function
11
.align 2
12
__sigsetjmp:
13
        stw  1,(JB_GPR1*4)(3)
14
        mflr 0
15
        stw  2,(JB_GPR2*4)(3)
16
        stw  14,((JB_GPRS+0)*4)(3)
17
        stfd 14,((JB_FPRS+0*2)*4)(3)
18
        stw  0,(JB_LR*4)(3)
19
        stw  15,((JB_GPRS+1)*4)(3)
20
        stfd 15,((JB_FPRS+1*2)*4)(3)
21
        mfcr 0
22
        stw  16,((JB_GPRS+2)*4)(3)
23
        stfd 16,((JB_FPRS+2*2)*4)(3)
24
        stw  0,(JB_CR*4)(3)
25
        stw  17,((JB_GPRS+3)*4)(3)
26
        stfd 17,((JB_FPRS+3*2)*4)(3)
27
        stw  18,((JB_GPRS+4)*4)(3)
28
        stfd 18,((JB_FPRS+4*2)*4)(3)
29
        stw  19,((JB_GPRS+5)*4)(3)
30
        stfd 19,((JB_FPRS+5*2)*4)(3)
31
        stw  20,((JB_GPRS+6)*4)(3)
32
        stfd 20,((JB_FPRS+6*2)*4)(3)
33
        stw  21,((JB_GPRS+7)*4)(3)
34
        stfd 21,((JB_FPRS+7*2)*4)(3)
35
        stw  22,((JB_GPRS+8)*4)(3)
36
        stfd 22,((JB_FPRS+8*2)*4)(3)
37
        stw  23,((JB_GPRS+9)*4)(3)
38
        stfd 23,((JB_FPRS+9*2)*4)(3)
39
        stw  24,((JB_GPRS+10)*4)(3)
40
        stfd 24,((JB_FPRS+10*2)*4)(3)
41
        stw  25,((JB_GPRS+11)*4)(3)
42
        stfd 25,((JB_FPRS+11*2)*4)(3)
43
        stw  26,((JB_GPRS+12)*4)(3)
44
        stfd 26,((JB_FPRS+12*2)*4)(3)
45
        stw  27,((JB_GPRS+13)*4)(3)
46
        stfd 27,((JB_FPRS+13*2)*4)(3)
47
        stw  28,((JB_GPRS+14)*4)(3)
48
        stfd 28,((JB_FPRS+14*2)*4)(3)
49
        stw  29,((JB_GPRS+15)*4)(3)
50
        stfd 29,((JB_FPRS+15*2)*4)(3)
51
        stw  30,((JB_GPRS+16)*4)(3)
52
        stfd 30,((JB_FPRS+16*2)*4)(3)
53
        stw  31,((JB_GPRS+17)*4)(3)
54
        stfd 31,((JB_FPRS+17*2)*4)(3)
55
        b JUMPTARGET (__sigjmp_save)
56
.size __sigsetjmp,.-__sigsetjmp
57
58
#ifdef __ELF__
59
.section .note.GNU-stack,"",%progbits
60
#endif
(-)dietlibc-0.30-execstack/ppc/start.S (-56 lines)
Lines 1-56 Link Here
1
#include "dietfeatures.h"
2
3
.text
4
.global _start
5
.type _start,@function
6
_start:
7
 /* Save the stack pointer, in case we're statically linked under Linux.  */
8
	mr	9,1
9
 /* Set up an initial stack frame, and clear the LR.  */
10
	clrrwi	1,1,4
11
	li	0,0
12
	stwu	1,-16(1)
13
	mtlr	0
14
	stw	0,0(1)
15
16
 /* r9 contains the initial stack pointer
17
    argc = (r9)
18
    argv = (r9+4)
19
    envp = argv+(argc+1)*4 */
20
21
	lis	14,__libc_stack_end@ha
22
	stw	9,__libc_stack_end@l(14)
23
24
	lwzu	3,0(9)	/* argc */
25
	addi	4,9,4	/* argv */
26
	add	5,0,3	/* argc... */
27
	addi	5,5,1	/* argc+1...*/
28
	slwi	5,5,2	/* (argc+1)*4 */
29
	add	5,5,4	/* argv+(argc+1)*4 */
30
31
	lis	14,environ@ha
32
	stw	5,environ@l(14)
33
34
#ifdef WANT_DYNAMIC
35
	mr	6,7
36
	bl	_dyn_start
37
#else
38
	bl	CALL_IN_STARTCODE
39
#endif
40
	b	exit
41
.size _start,.-_start
42
43
44
/* Define a symbol for the first piece of initialized data.  */
45
	.section ".data"
46
__data_start:
47
48
/* this is needed for libgcc_eh.a - see gcc-3.4/gcc/config/rs6000/linux-unwind.h */
49
	.weak	__libc_stack_end
50
	.lcomm	__libc_stack_end,4,4
51
	.type	__libc_stack_end,@object
52
53
54
#ifdef __ELF__
55
.section .note.GNU-stack,"",%progbits
56
#endif
(-)dietlibc-0.30-execstack/ppc/syscalls.h (-299 lines)
Lines 1-299 Link Here
1
2
#define __NR_exit		  1
3
#define __NR_fork		  2
4
#define __NR_read		  3
5
#define __NR_write		  4
6
#define __NR_open		  5
7
#define __NR_close		  6
8
#define __NR_waitpid		  7
9
#define __NR_creat		  8
10
#define __NR_link		  9
11
#define __NR_unlink		 10
12
#define __NR_execve		 11
13
#define __NR_chdir		 12
14
#define __NR_time		 13
15
#define __NR_mknod		 14
16
#define __NR_chmod		 15
17
#define __NR_lchown		 16
18
#define __NR_break		 17
19
#define __NR_oldstat		 18
20
#define __NR_lseek		 19
21
#define __NR_getpid		 20
22
#define __NR_mount		 21
23
#define __NR_umount		 22
24
#define __NR_setuid		 23
25
#define __NR_getuid		 24
26
#define __NR_stime		 25
27
#define __NR_ptrace		 26
28
#define __NR_alarm		 27
29
#define __NR_oldfstat		 28
30
#define __NR_pause		 29
31
#define __NR_utime		 30
32
#define __NR_stty		 31
33
#define __NR_gtty		 32
34
#define __NR_access		 33
35
#define __NR_nice		 34
36
#define __NR_ftime		 35
37
#define __NR_sync		 36
38
#define __NR_kill		 37
39
#define __NR_rename		 38
40
#define __NR_mkdir		 39
41
#define __NR_rmdir		 40
42
#define __NR_dup		 41
43
#define __NR_pipe		 42
44
#define __NR_times		 43
45
#define __NR_prof		 44
46
#define __NR_brk		 45
47
#define __NR_setgid		 46
48
#define __NR_getgid		 47
49
#define __NR_signal		 48
50
#define __NR_geteuid		 49
51
#define __NR_getegid		 50
52
#define __NR_acct		 51
53
#define __NR_umount2		 52
54
#define __NR_lock		 53
55
#define __NR_ioctl		 54
56
#define __NR_fcntl		 55
57
#define __NR_mpx		 56
58
#define __NR_setpgid		 57
59
#define __NR_ulimit		 58
60
#define __NR_oldolduname	 59
61
#define __NR_umask		 60
62
#define __NR_chroot		 61
63
#define __NR_ustat		 62
64
#define __NR_dup2		 63
65
#define __NR_getppid		 64
66
#define __NR_getpgrp		 65
67
#define __NR_setsid		 66
68
#define __NR_sigaction		 67
69
#define __NR_sgetmask		 68
70
#define __NR_ssetmask		 69
71
#define __NR_setreuid		 70
72
#define __NR_setregid		 71
73
#define __NR_sigsuspend		 72
74
#define __NR_sigpending		 73
75
#define __NR_sethostname	 74
76
#define __NR_setrlimit		 75
77
#define __NR_getrlimit		 76
78
#define __NR_getrusage		 77
79
#define __NR_gettimeofday	 78
80
#define __NR_settimeofday	 79
81
#define __NR_getgroups		 80
82
#define __NR_setgroups		 81
83
#define __NR_select		 82
84
#define __NR_symlink		 83
85
#define __NR_oldlstat		 84
86
#define __NR_readlink		 85
87
#define __NR_uselib		 86
88
#define __NR_swapon		 87
89
#define __NR_reboot		 88
90
#define __NR_readdir		 89
91
#define __NR_mmap		 90
92
#define __NR_munmap		 91
93
#define __NR_truncate		 92
94
#define __NR_ftruncate		 93
95
#define __NR_fchmod		 94
96
#define __NR_fchown		 95
97
#define __NR_getpriority	 96
98
#define __NR_setpriority	 97
99
#define __NR_profil		 98
100
#define __NR_statfs		 99
101
#define __NR_fstatfs		100
102
#define __NR_ioperm		101
103
#define __NR_socketcall		102
104
#define __NR_syslog		103
105
#define __NR_setitimer		104
106
#define __NR_getitimer		105
107
#define __NR_stat		106
108
#define __NR_lstat		107
109
#define __NR_fstat		108
110
#define __NR_olduname		109
111
#define __NR_iopl		110
112
#define __NR_vhangup		111
113
#define __NR_idle		112
114
#define __NR_vm86		113
115
#define __NR_wait4		114
116
#define __NR_swapoff		115
117
#define __NR_sysinfo		116
118
#define __NR_ipc		117
119
#define __NR_fsync		118
120
#define __NR_sigreturn		119
121
#define __NR_clone		120
122
#define __NR_setdomainname	121
123
#define __NR_uname		122
124
#define __NR_modify_ldt		123
125
#define __NR_adjtimex		124
126
#define __NR_mprotect		125
127
#define __NR_sigprocmask	126
128
#define __NR_create_module	127
129
#define __NR_init_module	128
130
#define __NR_delete_module	129
131
#define __NR_get_kernel_syms	130
132
#define __NR_quotactl		131
133
#define __NR_getpgid		132
134
#define __NR_fchdir		133
135
#define __NR_bdflush		134
136
#define __NR_sysfs		135
137
#define __NR_personality	136
138
#define __NR_afs_syscall	137 /* Syscall for Andrew File System */
139
#define __NR_setfsuid		138
140
#define __NR_setfsgid		139
141
#define __NR__llseek		140
142
#define __NR_getdents		141
143
#define __NR__newselect		142
144
#define __NR_flock		143
145
#define __NR_msync		144
146
#define __NR_readv		145
147
#define __NR_writev		146
148
#define __NR_getsid		147
149
#define __NR_fdatasync		148
150
#define __NR__sysctl		149
151
#define __NR_mlock		150
152
#define __NR_munlock		151
153
#define __NR_mlockall		152
154
#define __NR_munlockall		153
155
#define __NR_sched_setparam		154
156
#define __NR_sched_getparam		155
157
#define __NR_sched_setscheduler		156
158
#define __NR_sched_getscheduler		157
159
#define __NR_sched_yield		158
160
#define __NR_sched_get_priority_max	159
161
#define __NR_sched_get_priority_min	160
162
#define __NR_sched_rr_get_interval	161
163
#define __NR_nanosleep		162
164
#define __NR_mremap		163
165
#define __NR_setresuid		164
166
#define __NR_getresuid		165
167
#define __NR_query_module	166
168
#define __NR_poll		167
169
#define __NR_nfsservctl		168
170
#define __NR_setresgid		169
171
#define __NR_getresgid		170
172
#define __NR_prctl		171
173
#define __NR_rt_sigreturn	172
174
#define __NR_rt_sigaction	173
175
#define __NR_rt_sigprocmask	174
176
#define __NR_rt_sigpending	175
177
#define __NR_rt_sigtimedwait	176
178
#define __NR_rt_sigqueueinfo	177
179
#define __NR_rt_sigsuspend	178
180
#define __NR_pread		179
181
#define __NR_pwrite		180
182
#define __NR_chown		181
183
#define __NR_getcwd		182
184
#define __NR_capget		183
185
#define __NR_capset		184
186
#define __NR_sigaltstack	185
187
#define __NR_sendfile		186
188
#define __NR_getpmsg		187	/* some people actually want streams */
189
#define __NR_putpmsg		188	/* some people actually want streams */
190
#define __NR_vfork		189
191
#define __NR_ugetrlimit		190	/* SuS compliant getrlimit */
192
#define __NR_readahead		191
193
#define __NR_mmap2		192
194
#define __NR_truncate64		193
195
#define __NR_ftruncate64	194
196
#define __NR_stat64		195
197
#define __NR_lstat64		196
198
#define __NR_fstat64		197
199
#define __NR_pciconfig_read	198
200
#define __NR_pciconfig_write	199
201
#define __NR_pciconfig_iobase	200
202
#define __NR_multiplexer	201
203
#define __NR_getdents64		202
204
#define __NR_pivot_root		203
205
#define __NR_fcntl64		204
206
#define __NR_madvise		205
207
#define __NR_mincore		206
208
#define __NR_gettid		207
209
#define __NR_tkill		208
210
#define __NR_setxattr		209
211
#define __NR_lsetxattr		210
212
#define __NR_fsetxattr		211
213
#define __NR_getxattr		212
214
#define __NR_lgetxattr		213
215
#define __NR_fgetxattr		214
216
#define __NR_listxattr		215
217
#define __NR_llistxattr		216
218
#define __NR_flistxattr		217
219
#define __NR_removexattr	218
220
#define __NR_lremovexattr	219
221
#define __NR_fremovexattr	220
222
#define __NR_futex		221
223
#define __NR_sched_setaffinity	222
224
#define __NR_sched_getaffinity	223
225
/* 224 currently unused */
226
#define __NR_tuxcall		225
227
#define __NR_sendfile64		226
228
#define __NR_io_setup		227
229
#define __NR_io_destroy		228
230
#define __NR_io_getevents	229
231
#define __NR_io_submit		230
232
#define __NR_io_cancel		231
233
#define __NR_set_tid_address	232
234
#define __NR_fadvise64		233
235
#define __NR_exit_group		234
236
#define __NR_lookup_dcookie	235
237
#define __NR_epoll_create	236
238
#define __NR_epoll_ctl		237
239
#define __NR_epoll_wait		238
240
#define __NR_remap_file_pages	239
241
#define __NR_timer_create	240
242
#define __NR_timer_settime	241
243
#define __NR_timer_gettime	242
244
#define __NR_timer_getoverrun	243
245
#define __NR_timer_delete	244
246
#define __NR_clock_settime	245
247
#define __NR_clock_gettime	246
248
#define __NR_clock_getres	247
249
#define __NR_clock_nanosleep	248
250
#define __NR_swapcontext	249
251
#define __NR_tgkill		250
252
#define __NR_utimes		251
253
#define __NR_statfs64		252
254
#define __NR_fstatfs64		253
255
#define __NR_fadvise64_64	254
256
#define __NR_rtas		255
257
#define __NR_sys_debug_setcontext 256
258
/* Number 257 is reserved for vserver */
259
/* Number 258 is reserved for new sys_remap_file_pages */
260
/* Number 259 is reserved for new sys_mbind */
261
/* Number 260 is reserved for new sys_get_mempolicy */
262
/* Number 261 is reserved for new sys_set_mempolicy */
263
#define __NR_mq_open		262
264
#define __NR_mq_unlink		263
265
#define __NR_mq_timedsend	264
266
#define __NR_mq_timedreceive	265
267
#define __NR_mq_notify		266
268
#define __NR_mq_getsetattr	267
269
#define __NR_kexec_load		268
270
#define __NR_add_key		269
271
#define __NR_request_key	270
272
#define __NR_keyctl		271
273
#define __NR_waitid		272
274
#define __NR_ioprio_set		273
275
#define __NR_ioprio_get		274
276
#define __NR_inotify_init	275
277
#define __NR_inotify_add_watch	276
278
#define __NR_inotify_rm_watch	277
279
280
281
#define syscall_weak(name,wsym,sym) \
282
.text; \
283
.type wsym,@function; \
284
.weak wsym; \
285
wsym: ; \
286
.type sym,@function; \
287
.global sym; \
288
sym: \
289
	li	0,__NR_##name; \
290
	b __unified_syscall
291
292
#define syscall(name,sym) \
293
.text; \
294
.type sym,@function; \
295
.global sym; \
296
sym: \
297
	li	0,__NR_##name; \
298
	b __unified_syscall
299
(-)dietlibc-0.30-execstack/ppc/__testandset.S (-16 lines)
Lines 1-16 Link Here
1
.global __testandset
2
.type __testandset,@function
3
.align 2
4
__testandset:
5
1:	lwarx	5,0,3
6
	li	0,1
7
	stwcx.	0,0,3
8
	bne-	1b
9
	mr	3,5
10
	blr
11
.size __testandset,.-__testandset
12
13
14
#ifdef __ELF__
15
.section .note.GNU-stack,"",%progbits
16
#endif
(-)dietlibc-0.30-execstack/ppc/unified.S (-44 lines)
Lines 1-44 Link Here
1
#include <dietfeatures.h>
2
#include "syscalls.h"
3
4
.text
5
.type exit,@function
6
.weak exit
7
exit:
8
.type _exit,@function
9
.global _exit
10
_exit:
11
	li	0,__NR_exit
12
.global __unified_syscall
13
__unified_syscall:
14
	sc
15
	bnslr+
16
17
.global error_unified_syscall
18
error_unified_syscall:
19
#ifdef WANT_THREAD_SAFE
20
	stwu	1,-16(1)
21
	mflr	0
22
	stw	0,20(1)
23
	stw	3,12(1)
24
	bl	__errno_location
25
	lwz	0,12(1)
26
	stw	0,0(3)
27
	lwz	0,20(1)
28
	mtlr	0
29
	addi	1,1,16
30
#else
31
	lis	9,errno@ha
32
	stw	3,errno@l(9)
33
#endif
34
	li	3,-1
35
36
/* here we go and "reuse" the return for weak-void functions */
37
#include "dietuglyweaks.h"
38
39
	blr
40
41
42
#ifdef __ELF__
43
.section .note.GNU-stack,"",%progbits
44
#endif
(-)dietlibc-0.30-execstack/syscalls.h (-1 / +1 lines)
Lines 15-21 Link Here
15
#include "ppc64/syscalls.h"
15
#include "ppc64/syscalls.h"
16
16
17
#elif defined(__powerpc__)
17
#elif defined(__powerpc__)
18
#include "ppc/syscalls.h"
18
#include "powerpc/syscalls.h"
19
19
20
#elif defined(__mips__)
20
#elif defined(__mips__)
21
#include "mips/syscalls.h"
21
#include "mips/syscalls.h"

Return to bug 179408