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-ppc-rename/diet.c (-2 / +2 lines)
Lines 36-42 static const char* Os[] = { Link Here
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
  "powerpc","-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
  "powerpc64","-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,
42
  "sh","-Os","-fomit-frame-pointer",0,
42
  "sh","-Os","-fomit-frame-pointer",0,
Lines 154-160 int main(int argc,char *argv[]) { Link Here
154
      shortplatform="powerpc";
154
      shortplatform="powerpc";
155
#endif
155
#endif
156
#ifdef __powerpc64__
156
#ifdef __powerpc64__
157
      shortplatform="ppc64";
157
      shortplatform="powerpc64";
158
#endif
158
#endif
159
#ifdef __i386__
159
#ifdef __i386__
160
      shortplatform="i386";
160
      shortplatform="i386";
(-)dietlibc-0.30-ppc-rename/Makefile (-4 / +9 lines)
Lines 31-37 ifeq ($(MYARCH),powerpc) Link Here
31
ARCH=powerpc
31
ARCH=powerpc
32
else
32
else
33
ifeq ($(MYARCH),ppc64)
33
ifeq ($(MYARCH),ppc64)
34
ARCH=ppc64
34
ARCH=powerpc64
35
MYARCH=powerpc64
36
else
37
ifeq ($(MYARCH),powerpc64)
38
ARCH=powerpc64
35
else
39
else
36
ifeq ($(MYARCH),arm)
40
ifeq ($(MYARCH),arm)
37
ARCH=arm
41
ARCH=arm
Lines 85-90 endif Link Here
85
endif
89
endif
86
endif
90
endif
87
endif
91
endif
92
endif
88
93
89
# ARCH=$(MYARCH)
94
# ARCH=$(MYARCH)
90
95
Lines 391-399 uninstall: Link Here
391
	-rmdir $(DESTDIR)$(ILIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(BINDIR)
396
	-rmdir $(DESTDIR)$(ILIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(BINDIR)
392
397
393
.PHONY: sparc powerpc mips arm alpha i386 parisc mipsel powerpc s390 sparc64
398
.PHONY: sparc powerpc mips arm alpha i386 parisc mipsel powerpc s390 sparc64
394
.PHONY: x86_64 ia64 ppc64 s390x
399
.PHONY: x86_64 ia64 powerpc64 s390x
395
400
396
arm sparc alpha mips parisc s390 sparc64 x86_64 ia64 ppc64 s390x:
401
arm sparc alpha mips parisc s390 sparc64 x86_64 ia64 powerpc64 s390x:
397
	$(MAKE) ARCH=$@ CROSS=$@-linux- all
402
	$(MAKE) ARCH=$@ CROSS=$@-linux- all
398
403
399
i386:
404
i386:
Lines 404-410 else Link Here
404
endif
409
endif
405
410
406
powerpc:
411
powerpc:
407
ifeq ($(MYARCH),ppc64)
412
ifeq ($(MYARCH),powerpc64)
408
	$(MAKE) ARCH=$@ CC="$(CC) -m32" all
413
	$(MAKE) ARCH=$@ CC="$(CC) -m32" all
409
else
414
else
410
	$(MAKE) ARCH=$@ CROSS=$@-linux- all
415
	$(MAKE) ARCH=$@ CROSS=$@-linux- all
(-)dietlibc-0.30-ppc-rename/powerpc64/clone.S (+56 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
	stdu	 1,-64(1)	/* alloc some space on the stack */
16
	std	29, 16(1)	/* save r29,r30,r31 on stack */
17
	std	30, 24(1)
18
	std	31, 32(1)
19
20
	rlwinm	4,4,0,0,27	/* mask out lower 4 bits */
21
22
	/* move parameter to positions clone wants them */
23
	mr	29,3		/* r29 = r3 fn */
24
	mr	30,4		/* r30 = r4 stack */
25
	mr	31,6		/* r31 = r6 arg */
26
	mr	3, 5		/* r3  = r5 flags */
27
28
	li	0, __NR_clone	/* load syscall nr. */
29
	sc
30
31
	cmpwi	cr1,3,0		/* compare return of syscall with 0 */
32
	crandc	4*cr1+eq,4*cr1+eq,so
33
	bne	.Lclone_parent	/* return was non zero -> .Lclone_parent */
34
35
	/* we are the cloned process */
36
	mr	 1, 30		/* set stack pointer */
37
	mtctr	29		/* set count register to fn ? */
38
	mr	 3, 31		/* set argument */
39
	bctrl			/* branch trough count register and link */
40
	b	_exit		/* exit thread */
41
42
.Lclone_parent:
43
	ld	29,16(1)	/* restore saved registers */
44
	ld	30,24(1)
45
	ld	31,32(1)
46
	addi	 1, 1,64	/* free stack */
47
	bnslr+			/* had cloned a thread so return to parent */
48
	b	error_unified_syscall
49
50
.Lclone_error:
51
	li	3, EINVAL
52
	b	error_unified_syscall
53
54
#ifdef __ELF__
55
.section .note.GNU-stack,"",%progbits
56
#endif
(-)dietlibc-0.30-ppc-rename/powerpc64/__longjmp.S (+58 lines)
Line 0 Link Here
1
#include <setjmp.h>
2
3
		.quad	.__longjmp,.TOC.@tocbase,0
4
		.text
5
		.size	__longjmp,24
6
		.type	.__longjmp,@function
7
		.globl	.__longjmp
8
.align 2
9
.__longjmp:
10
	ld  1,(JB_GPR1*8)(3)
11
	ld  2,(JB_GPR2*8)(3)
12
	ld  0,(JB_LR*8)(3)
13
	ld  14,((JB_GPRS+0)*8)(3)
14
	lfd 14,((JB_FPRS+0)*8)(3)
15
	ld  15,((JB_GPRS+1)*8)(3)
16
	lfd 15,((JB_FPRS+1)*8)(3)
17
	ld  16,((JB_GPRS+2)*8)(3)
18
	lfd 16,((JB_FPRS+2)*8)(3)
19
	ld  17,((JB_GPRS+3)*8)(3)
20
	lfd 17,((JB_FPRS+3)*8)(3)
21
	ld  18,((JB_GPRS+4)*8)(3)
22
	lfd 18,((JB_FPRS+4)*8)(3)
23
	ld  19,((JB_GPRS+5)*8)(3)
24
	lfd 19,((JB_FPRS+5)*8)(3)
25
	ld  20,((JB_GPRS+6)*8)(3)
26
	lfd 20,((JB_FPRS+6)*8)(3)
27
	mtlr 0
28
	ld  21,((JB_GPRS+7)*8)(3)
29
	lfd 21,((JB_FPRS+7)*8)(3)
30
	ld  22,((JB_GPRS+8)*8)(3)
31
	lfd 22,((JB_FPRS+8)*8)(3)
32
	ld  0,(JB_CR*8)(3)
33
	ld  23,((JB_GPRS+9)*8)(3)
34
	lfd 23,((JB_FPRS+9)*8)(3)
35
	ld  24,((JB_GPRS+10)*8)(3)
36
	lfd 24,((JB_FPRS+10)*8)(3)
37
	ld  25,((JB_GPRS+11)*8)(3)
38
	lfd 25,((JB_FPRS+11)*8)(3)
39
	mtcrf 0xFF,0
40
	ld  26,((JB_GPRS+12)*8)(3)
41
	lfd 26,((JB_FPRS+12)*8)(3)
42
	ld  27,((JB_GPRS+13)*8)(3)
43
	lfd 27,((JB_FPRS+13)*8)(3)
44
	ld  28,((JB_GPRS+14)*8)(3)
45
	lfd 28,((JB_FPRS+14)*8)(3)
46
	ld  29,((JB_GPRS+15)*8)(3)
47
	lfd 29,((JB_FPRS+15)*8)(3)
48
	ld  30,((JB_GPRS+16)*8)(3)
49
	lfd 30,((JB_FPRS+16)*8)(3)
50
	ld  31,((JB_GPRS+17)*8)(3)
51
	lfd 31,((JB_FPRS+17)*8)(3)
52
	mr 3,4
53
	blr
54
.size .__longjmp,.-.__longjmp
55
56
#ifdef __ELF__
57
.section .note.GNU-stack,"",%progbits
58
#endif
(-)dietlibc-0.30-ppc-rename/powerpc64/Makefile.add (+5 lines)
Line 0 Link Here
1
2
CFLAGS+=-Os -mpowerpc64
3
VPATH:=powerpc64:syscalls.s:$(VPATH)
4
5
CC+=-m64
(-)dietlibc-0.30-ppc-rename/powerpc64/setjmp.S (+63 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
		.quad	.__sigsetjmp,.TOC.@tocbase,0
10
		.text
11
		.size	__sigsetjmp,24
12
		.type	.__sigsetjmp,@function
13
		.globl	.__sigsetjmp
14
.align 2
15
.__sigsetjmp:
16
        std  1,(JB_GPR1*8)(3)
17
        mflr 0
18
        std  2,(JB_GPR2*8)(3)
19
        std  14,((JB_GPRS+0)*8)(3)
20
        stfd 14,((JB_FPRS+0)*8)(3)
21
        std  0,(JB_LR*8)(3)
22
        std  15,((JB_GPRS+1)*8)(3)
23
        stfd 15,((JB_FPRS+1)*8)(3)
24
        mfcr 0
25
        std  16,((JB_GPRS+2)*8)(3)
26
        stfd 16,((JB_FPRS+2)*8)(3)
27
        std  0,(JB_CR*8)(3)
28
        std  17,((JB_GPRS+3)*8)(3)
29
        stfd 17,((JB_FPRS+3)*8)(3)
30
        std  18,((JB_GPRS+4)*8)(3)
31
        stfd 18,((JB_FPRS+4)*8)(3)
32
        std  19,((JB_GPRS+5)*8)(3)
33
        stfd 19,((JB_FPRS+5)*8)(3)
34
        std  20,((JB_GPRS+6)*8)(3)
35
        stfd 20,((JB_FPRS+6)*8)(3)
36
        std  21,((JB_GPRS+7)*8)(3)
37
        stfd 21,((JB_FPRS+7)*8)(3)
38
        std  22,((JB_GPRS+8)*8)(3)
39
        stfd 22,((JB_FPRS+8)*8)(3)
40
        std  23,((JB_GPRS+9)*8)(3)
41
        stfd 23,((JB_FPRS+9)*8)(3)
42
        std  24,((JB_GPRS+10)*8)(3)
43
        stfd 24,((JB_FPRS+10)*8)(3)
44
        std  25,((JB_GPRS+11)*8)(3)
45
        stfd 25,((JB_FPRS+11)*8)(3)
46
        std  26,((JB_GPRS+12)*8)(3)
47
        stfd 26,((JB_FPRS+12)*8)(3)
48
        std  27,((JB_GPRS+13)*8)(3)
49
        stfd 27,((JB_FPRS+13)*8)(3)
50
        std  28,((JB_GPRS+14)*8)(3)
51
        stfd 28,((JB_FPRS+14)*8)(3)
52
        std  29,((JB_GPRS+15)*8)(3)
53
        stfd 29,((JB_FPRS+15)*8)(3)
54
        std  30,((JB_GPRS+16)*8)(3)
55
        stfd 30,((JB_FPRS+16)*8)(3)
56
        std  31,((JB_GPRS+17)*8)(3)
57
        stfd 31,((JB_FPRS+17)*8)(3)
58
        b JUMPTARGET (__sigjmp_save)
59
.size .__sigsetjmp,.-.__sigsetjmp
60
61
#ifdef __ELF__
62
.section .note.GNU-stack,"",%progbits
63
#endif
(-)dietlibc-0.30-ppc-rename/powerpc64/start.S (+95 lines)
Line 0 Link Here
1
#include "dietfeatures.h"
2
3
	.section ".text"
4
	.align	2
5
	.globl	._start
6
	.type	._start,@function
7
	.globl	_start
8
	.section ".opd","aw"
9
_start:
10
	.quad	._start
11
	.quad	.TOC.@tocbase, 0
12
	.previous
13
._start:
14
15
/*
16
	.section ".text"
17
	.align	2
18
	.globl	._start
19
	.type	._start,@function
20
	.globl	_start
21
	.section ".opd","aw"
22
_start:
23
	.quad	._start
24
	.quad	.TOC.@tocbase, 0
25
	.previous
26
._start:
27
*/
28
 /* Save the stack pointer, in case we're statically linked under Linux.  */
29
	mr	9,1
30
 /* Set up an initial stack frame, and clear the LR.  */
31
	clrrdi	1,1,4
32
	li	0,0
33
	stdu	1,-128(1)
34
	mtlr	0
35
	std	0,0(1)
36
37
 /* r9 contains the initial stack pointer
38
    argc = (r9)
39
    argv = (r9+4)
40
    envp = argv+(argc+1)*4 */
41
42
	lis	14,__libc_stack_end@highesta
43
	ori	14,14,__libc_stack_end@highera
44
	sldi    14,14,32
45
	oris	14,14,__libc_stack_end@ha
46
	std	9,__libc_stack_end@l(14)
47
48
	ldu	3,0(9)	/* argc */
49
	addi	4,9,8	/* argv */
50
	add	5,0,3	/* argc... */
51
	addi	5,5,1	/* argc+1...*/
52
	slwi	5,5,3	/* (argc+1)*8 */
53
	add	5,5,4	/* argv+(argc+1)*8 */
54
55
	lis	14,environ@highesta
56
	ori	14,14,environ@highera
57
	sldi    14,14,32
58
	oris	14,14,environ@ha
59
	std	5,environ@l(14)
60
61
#ifdef WANT_DYNAMIC
62
/* #warning dynamic */
63
	mr	6,7
64
	bl	._dyn_start
65
#else
66
/* #warning static */
67
#define DOTIFY(name) .##name
68
	bl	DOTIFY(CALL_IN_STARTCODE)
69
#endif
70
	b	.exit
71
72
.LT_start:
73
	.long	0
74
	.quad	0x000c000000000000 | 0x0000200000000000 | 0x0000004000000000
75
	.long	.LT_start-._start
76
	.short	.LT_start_name_end-.LT_start_name_start
77
.LT_start_name_start:
78
	.ascii "_start"
79
.LT_start_name_end:
80
	.align 2
81
	.size _start,.-_start
82
83
/* Define a symbol for the first piece of initialized data.  */
84
	.section ".data"
85
__data_start:
86
87
/* this is needed for libgcc_eh.a - see gcc-3.4/gcc/config/rs6000/linux-unwind.h */
88
	.weak	__libc_stack_end
89
	.lcomm	__libc_stack_end,8,8
90
	.type	__libc_stack_end,@object
91
92
93
#ifdef __ELF__
94
.section .note.GNU-stack,"",%progbits
95
#endif
(-)dietlibc-0.30-ppc-rename/powerpc64/syscalls.h (+317 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	32bit only */
194
/* #define __NR_truncate64	193	32bit only */
195
/* #define __NR_ftruncate64	194	32bit only */
196
/* #define __NR_stat64		195	32bit only */
197
/* #define __NR_lstat64		196	32bit only */
198
/* #define __NR_fstat64		197	32bit only */
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	32bit only */
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	32bit only */
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	32bit only */
256
#define __NR_rtas		255
257
/* Number 256 is reserved for sys_debug_setcontext */
258
/* Number 257 is reserved for vserver */
259
/* Number 258 is reserved for new sys_remap_file_pages */
260
#define __NR_mbind		259
261
#define __NR_get_mempolicy	260
262
#define __NR_set_mempolicy	261
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
282
#define __diet_proto_common(sym) \
283
	.section ".opd","aw"; \
284
	.align	3; \
285
sym: \
286
	.quad	.sym,.TOC.@tocbase,0; \
287
	.previous; \
288
	.size	sym,24; \
289
	.type	.sym,@function
290
291
#define diet_proto_weak(sym) \
292
	.weak	sym; \
293
	.weak	.sym; \
294
	__diet_proto_common(sym)
295
296
#define diet_proto(sym) \
297
	.globl	sym; \
298
	.globl	.sym; \
299
	__diet_proto_common(sym)
300
301
302
#define syscall_weak(name,wsym,sym) \
303
.text; \
304
diet_proto_weak(wsym); \
305
diet_proto(sym); \
306
.wsym: \
307
.sym: \
308
	li	0,__NR_##name; \
309
	b	__unified_syscall
310
311
#define syscall(name,sym) \
312
.text; \
313
diet_proto(sym); \
314
.sym: \
315
	li	0,__NR_##name; \
316
	b	__unified_syscall
317
(-)dietlibc-0.30-ppc-rename/powerpc64/__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-ppc-rename/powerpc64/umount.S (+12 lines)
Line 0 Link Here
1
#include "syscalls.h"
2
3
		.text
4
diet_proto(umount)
5
.umount:
6
		li 0, __NR_umount2
7
		li 4, 0
8
		b __unified_syscall
9
10
#ifdef __ELF__
11
.section .note.GNU-stack,"",%progbits
12
#endif
(-)dietlibc-0.30-ppc-rename/powerpc64/unified.S (+75 lines)
Line 0 Link Here
1
#include <dietfeatures.h>
2
#include "syscalls.h"
3
4
	.text
5
.exit:
6
	.weak	.exit
7
._exit:
8
	li	0,__NR_exit
9
	.global __unified_syscall
10
__unified_syscall:
11
	sc
12
	bnslr+
13
14
	.global error_unified_syscall
15
error_unified_syscall:
16
17
#ifdef WANT_THREAD_SAFE
18
	stdu	1,-128(1)
19
	mflr	0
20
	std	0,20(1)
21
	std	3,12(1)
22
	bl	.__errno_location
23
	ld	0,12(1)
24
	stw	0,0(3)
25
	ld	0,20(1)
26
	mtlr	0
27
	addi	1,1,128
28
#else
29
	lis	9,errno@highesta
30
	ori	9,9,errno@highera
31
	sldi    9,9,32
32
	oris	9,9,errno@ha
33
	stw	3,errno@l(9)
34
#endif
35
	li	3,-1
36
37
/* here we go and "reuse" the return for weak-void functions */
38
//#include "dietuglyweaks.h"
39
.__thread_doexit:
40
	.weak	.__thread_doexit
41
.__fflush_stdin:
42
	.weak	.__fflush_stdin
43
.__fflush_stdout:
44
	.weak	.__fflush_stdout
45
.__fflush_stderr:
46
	.weak	.__fflush_stderr
47
.flockfile:
48
	.weak	.flockfile
49
.funlockfile:
50
	.weak	.funlockfile
51
.__nop:
52
	.weak	.__nop
53
.__you_tried_to_link_a_dietlibc_object_against_glibc:
54
	.weak	.__you_tried_to_link_a_dietlibc_object_against_glibc
55
56
	blr
57
	.long 0
58
	.byte 0,0,0,1,128,0,0,0
59
	.size	._exit,.-._exit
60
	.size	.exit,.-.exit
61
62
diet_proto_weak(__thread_doexit)
63
diet_proto_weak(__fflush_stdin)
64
diet_proto_weak(__fflush_stdout)
65
diet_proto_weak(__fflush_stderr)
66
diet_proto_weak(flockfile)
67
diet_proto_weak(funlockfile)
68
diet_proto_weak(__nop)
69
diet_proto_weak(__you_tried_to_link_a_dietlibc_object_against_glibc)
70
diet_proto_weak(exit)
71
diet_proto(_exit)
72
73
#ifdef __ELF__
74
.section .note.GNU-stack,"",%progbits
75
#endif
(-)dietlibc-0.30-ppc-rename/ppc64/clone.S (-56 lines)
Lines 1-56 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
	stdu	 1,-64(1)	/* alloc some space on the stack */
16
	std	29, 16(1)	/* save r29,r30,r31 on stack */
17
	std	30, 24(1)
18
	std	31, 32(1)
19
20
	rlwinm	4,4,0,0,27	/* mask out lower 4 bits */
21
22
	/* move parameter to positions clone wants them */
23
	mr	29,3		/* r29 = r3 fn */
24
	mr	30,4		/* r30 = r4 stack */
25
	mr	31,6		/* r31 = r6 arg */
26
	mr	3, 5		/* r3  = r5 flags */
27
28
	li	0, __NR_clone	/* load syscall nr. */
29
	sc
30
31
	cmpwi	cr1,3,0		/* compare return of syscall with 0 */
32
	crandc	4*cr1+eq,4*cr1+eq,so
33
	bne	.Lclone_parent	/* return was non zero -> .Lclone_parent */
34
35
	/* we are the cloned process */
36
	mr	 1, 30		/* set stack pointer */
37
	mtctr	29		/* set count register to fn ? */
38
	mr	 3, 31		/* set argument */
39
	bctrl			/* branch trough count register and link */
40
	b	_exit		/* exit thread */
41
42
.Lclone_parent:
43
	ld	29,16(1)	/* restore saved registers */
44
	ld	30,24(1)
45
	ld	31,32(1)
46
	addi	 1, 1,64	/* free stack */
47
	bnslr+			/* had cloned a thread so return to parent */
48
	b	error_unified_syscall
49
50
.Lclone_error:
51
	li	3, EINVAL
52
	b	error_unified_syscall
53
54
#ifdef __ELF__
55
.section .note.GNU-stack,"",%progbits
56
#endif
(-)dietlibc-0.30-ppc-rename/ppc64/__longjmp.S (-58 lines)
Lines 1-58 Link Here
1
#include <setjmp.h>
2
3
		.quad	.__longjmp,.TOC.@tocbase,0
4
		.text
5
		.size	__longjmp,24
6
		.type	.__longjmp,@function
7
		.globl	.__longjmp
8
.align 2
9
.__longjmp:
10
	ld  1,(JB_GPR1*8)(3)
11
	ld  2,(JB_GPR2*8)(3)
12
	ld  0,(JB_LR*8)(3)
13
	ld  14,((JB_GPRS+0)*8)(3)
14
	lfd 14,((JB_FPRS+0)*8)(3)
15
	ld  15,((JB_GPRS+1)*8)(3)
16
	lfd 15,((JB_FPRS+1)*8)(3)
17
	ld  16,((JB_GPRS+2)*8)(3)
18
	lfd 16,((JB_FPRS+2)*8)(3)
19
	ld  17,((JB_GPRS+3)*8)(3)
20
	lfd 17,((JB_FPRS+3)*8)(3)
21
	ld  18,((JB_GPRS+4)*8)(3)
22
	lfd 18,((JB_FPRS+4)*8)(3)
23
	ld  19,((JB_GPRS+5)*8)(3)
24
	lfd 19,((JB_FPRS+5)*8)(3)
25
	ld  20,((JB_GPRS+6)*8)(3)
26
	lfd 20,((JB_FPRS+6)*8)(3)
27
	mtlr 0
28
	ld  21,((JB_GPRS+7)*8)(3)
29
	lfd 21,((JB_FPRS+7)*8)(3)
30
	ld  22,((JB_GPRS+8)*8)(3)
31
	lfd 22,((JB_FPRS+8)*8)(3)
32
	ld  0,(JB_CR*8)(3)
33
	ld  23,((JB_GPRS+9)*8)(3)
34
	lfd 23,((JB_FPRS+9)*8)(3)
35
	ld  24,((JB_GPRS+10)*8)(3)
36
	lfd 24,((JB_FPRS+10)*8)(3)
37
	ld  25,((JB_GPRS+11)*8)(3)
38
	lfd 25,((JB_FPRS+11)*8)(3)
39
	mtcrf 0xFF,0
40
	ld  26,((JB_GPRS+12)*8)(3)
41
	lfd 26,((JB_FPRS+12)*8)(3)
42
	ld  27,((JB_GPRS+13)*8)(3)
43
	lfd 27,((JB_FPRS+13)*8)(3)
44
	ld  28,((JB_GPRS+14)*8)(3)
45
	lfd 28,((JB_FPRS+14)*8)(3)
46
	ld  29,((JB_GPRS+15)*8)(3)
47
	lfd 29,((JB_FPRS+15)*8)(3)
48
	ld  30,((JB_GPRS+16)*8)(3)
49
	lfd 30,((JB_FPRS+16)*8)(3)
50
	ld  31,((JB_GPRS+17)*8)(3)
51
	lfd 31,((JB_FPRS+17)*8)(3)
52
	mr 3,4
53
	blr
54
.size .__longjmp,.-.__longjmp
55
56
#ifdef __ELF__
57
.section .note.GNU-stack,"",%progbits
58
#endif
(-)dietlibc-0.30-ppc-rename/ppc64/Makefile.add (-5 lines)
Lines 1-5 Link Here
1
2
CFLAGS+=-Os -mpowerpc64
3
VPATH:=ppc64:syscalls.s:$(VPATH)
4
5
CC+=-m64
(-)dietlibc-0.30-ppc-rename/ppc64/setjmp.S (-63 lines)
Lines 1-63 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
		.quad	.__sigsetjmp,.TOC.@tocbase,0
10
		.text
11
		.size	__sigsetjmp,24
12
		.type	.__sigsetjmp,@function
13
		.globl	.__sigsetjmp
14
.align 2
15
.__sigsetjmp:
16
        std  1,(JB_GPR1*8)(3)
17
        mflr 0
18
        std  2,(JB_GPR2*8)(3)
19
        std  14,((JB_GPRS+0)*8)(3)
20
        stfd 14,((JB_FPRS+0)*8)(3)
21
        std  0,(JB_LR*8)(3)
22
        std  15,((JB_GPRS+1)*8)(3)
23
        stfd 15,((JB_FPRS+1)*8)(3)
24
        mfcr 0
25
        std  16,((JB_GPRS+2)*8)(3)
26
        stfd 16,((JB_FPRS+2)*8)(3)
27
        std  0,(JB_CR*8)(3)
28
        std  17,((JB_GPRS+3)*8)(3)
29
        stfd 17,((JB_FPRS+3)*8)(3)
30
        std  18,((JB_GPRS+4)*8)(3)
31
        stfd 18,((JB_FPRS+4)*8)(3)
32
        std  19,((JB_GPRS+5)*8)(3)
33
        stfd 19,((JB_FPRS+5)*8)(3)
34
        std  20,((JB_GPRS+6)*8)(3)
35
        stfd 20,((JB_FPRS+6)*8)(3)
36
        std  21,((JB_GPRS+7)*8)(3)
37
        stfd 21,((JB_FPRS+7)*8)(3)
38
        std  22,((JB_GPRS+8)*8)(3)
39
        stfd 22,((JB_FPRS+8)*8)(3)
40
        std  23,((JB_GPRS+9)*8)(3)
41
        stfd 23,((JB_FPRS+9)*8)(3)
42
        std  24,((JB_GPRS+10)*8)(3)
43
        stfd 24,((JB_FPRS+10)*8)(3)
44
        std  25,((JB_GPRS+11)*8)(3)
45
        stfd 25,((JB_FPRS+11)*8)(3)
46
        std  26,((JB_GPRS+12)*8)(3)
47
        stfd 26,((JB_FPRS+12)*8)(3)
48
        std  27,((JB_GPRS+13)*8)(3)
49
        stfd 27,((JB_FPRS+13)*8)(3)
50
        std  28,((JB_GPRS+14)*8)(3)
51
        stfd 28,((JB_FPRS+14)*8)(3)
52
        std  29,((JB_GPRS+15)*8)(3)
53
        stfd 29,((JB_FPRS+15)*8)(3)
54
        std  30,((JB_GPRS+16)*8)(3)
55
        stfd 30,((JB_FPRS+16)*8)(3)
56
        std  31,((JB_GPRS+17)*8)(3)
57
        stfd 31,((JB_FPRS+17)*8)(3)
58
        b JUMPTARGET (__sigjmp_save)
59
.size .__sigsetjmp,.-.__sigsetjmp
60
61
#ifdef __ELF__
62
.section .note.GNU-stack,"",%progbits
63
#endif
(-)dietlibc-0.30-ppc-rename/ppc64/start.S (-95 lines)
Lines 1-95 Link Here
1
#include "dietfeatures.h"
2
3
	.section ".text"
4
	.align	2
5
	.globl	._start
6
	.type	._start,@function
7
	.globl	_start
8
	.section ".opd","aw"
9
_start:
10
	.quad	._start
11
	.quad	.TOC.@tocbase, 0
12
	.previous
13
._start:
14
15
/*
16
	.section ".text"
17
	.align	2
18
	.globl	._start
19
	.type	._start,@function
20
	.globl	_start
21
	.section ".opd","aw"
22
_start:
23
	.quad	._start
24
	.quad	.TOC.@tocbase, 0
25
	.previous
26
._start:
27
*/
28
 /* Save the stack pointer, in case we're statically linked under Linux.  */
29
	mr	9,1
30
 /* Set up an initial stack frame, and clear the LR.  */
31
	clrrdi	1,1,4
32
	li	0,0
33
	stdu	1,-128(1)
34
	mtlr	0
35
	std	0,0(1)
36
37
 /* r9 contains the initial stack pointer
38
    argc = (r9)
39
    argv = (r9+4)
40
    envp = argv+(argc+1)*4 */
41
42
	lis	14,__libc_stack_end@highesta
43
	ori	14,14,__libc_stack_end@highera
44
	sldi    14,14,32
45
	oris	14,14,__libc_stack_end@ha
46
	std	9,__libc_stack_end@l(14)
47
48
	ldu	3,0(9)	/* argc */
49
	addi	4,9,8	/* argv */
50
	add	5,0,3	/* argc... */
51
	addi	5,5,1	/* argc+1...*/
52
	slwi	5,5,3	/* (argc+1)*8 */
53
	add	5,5,4	/* argv+(argc+1)*8 */
54
55
	lis	14,environ@highesta
56
	ori	14,14,environ@highera
57
	sldi    14,14,32
58
	oris	14,14,environ@ha
59
	std	5,environ@l(14)
60
61
#ifdef WANT_DYNAMIC
62
/* #warning dynamic */
63
	mr	6,7
64
	bl	._dyn_start
65
#else
66
/* #warning static */
67
#define DOTIFY(name) .##name
68
	bl	DOTIFY(CALL_IN_STARTCODE)
69
#endif
70
	b	.exit
71
72
.LT_start:
73
	.long	0
74
	.quad	0x000c000000000000 | 0x0000200000000000 | 0x0000004000000000
75
	.long	.LT_start-._start
76
	.short	.LT_start_name_end-.LT_start_name_start
77
.LT_start_name_start:
78
	.ascii "_start"
79
.LT_start_name_end:
80
	.align 2
81
	.size _start,.-_start
82
83
/* Define a symbol for the first piece of initialized data.  */
84
	.section ".data"
85
__data_start:
86
87
/* this is needed for libgcc_eh.a - see gcc-3.4/gcc/config/rs6000/linux-unwind.h */
88
	.weak	__libc_stack_end
89
	.lcomm	__libc_stack_end,8,8
90
	.type	__libc_stack_end,@object
91
92
93
#ifdef __ELF__
94
.section .note.GNU-stack,"",%progbits
95
#endif
(-)dietlibc-0.30-ppc-rename/ppc64/syscalls.h (-317 lines)
Lines 1-317 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	32bit only */
194
/* #define __NR_truncate64	193	32bit only */
195
/* #define __NR_ftruncate64	194	32bit only */
196
/* #define __NR_stat64		195	32bit only */
197
/* #define __NR_lstat64		196	32bit only */
198
/* #define __NR_fstat64		197	32bit only */
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	32bit only */
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	32bit only */
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	32bit only */
256
#define __NR_rtas		255
257
/* Number 256 is reserved for sys_debug_setcontext */
258
/* Number 257 is reserved for vserver */
259
/* Number 258 is reserved for new sys_remap_file_pages */
260
#define __NR_mbind		259
261
#define __NR_get_mempolicy	260
262
#define __NR_set_mempolicy	261
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
282
#define __diet_proto_common(sym) \
283
	.section ".opd","aw"; \
284
	.align	3; \
285
sym: \
286
	.quad	.sym,.TOC.@tocbase,0; \
287
	.previous; \
288
	.size	sym,24; \
289
	.type	.sym,@function
290
291
#define diet_proto_weak(sym) \
292
	.weak	sym; \
293
	.weak	.sym; \
294
	__diet_proto_common(sym)
295
296
#define diet_proto(sym) \
297
	.globl	sym; \
298
	.globl	.sym; \
299
	__diet_proto_common(sym)
300
301
302
#define syscall_weak(name,wsym,sym) \
303
.text; \
304
diet_proto_weak(wsym); \
305
diet_proto(sym); \
306
.wsym: \
307
.sym: \
308
	li	0,__NR_##name; \
309
	b	__unified_syscall
310
311
#define syscall(name,sym) \
312
.text; \
313
diet_proto(sym); \
314
.sym: \
315
	li	0,__NR_##name; \
316
	b	__unified_syscall
317
(-)dietlibc-0.30-ppc-rename/ppc64/__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-ppc-rename/ppc64/umount.S (-12 lines)
Lines 1-12 Link Here
1
#include "syscalls.h"
2
3
		.text
4
diet_proto(umount)
5
.umount:
6
		li 0, __NR_umount2
7
		li 4, 0
8
		b __unified_syscall
9
10
#ifdef __ELF__
11
.section .note.GNU-stack,"",%progbits
12
#endif
(-)dietlibc-0.30-ppc-rename/ppc64/unified.S (-75 lines)
Lines 1-75 Link Here
1
#include <dietfeatures.h>
2
#include "syscalls.h"
3
4
	.text
5
.exit:
6
	.weak	.exit
7
._exit:
8
	li	0,__NR_exit
9
	.global __unified_syscall
10
__unified_syscall:
11
	sc
12
	bnslr+
13
14
	.global error_unified_syscall
15
error_unified_syscall:
16
17
#ifdef WANT_THREAD_SAFE
18
	stdu	1,-128(1)
19
	mflr	0
20
	std	0,20(1)
21
	std	3,12(1)
22
	bl	.__errno_location
23
	ld	0,12(1)
24
	stw	0,0(3)
25
	ld	0,20(1)
26
	mtlr	0
27
	addi	1,1,128
28
#else
29
	lis	9,errno@highesta
30
	ori	9,9,errno@highera
31
	sldi    9,9,32
32
	oris	9,9,errno@ha
33
	stw	3,errno@l(9)
34
#endif
35
	li	3,-1
36
37
/* here we go and "reuse" the return for weak-void functions */
38
//#include "dietuglyweaks.h"
39
.__thread_doexit:
40
	.weak	.__thread_doexit
41
.__fflush_stdin:
42
	.weak	.__fflush_stdin
43
.__fflush_stdout:
44
	.weak	.__fflush_stdout
45
.__fflush_stderr:
46
	.weak	.__fflush_stderr
47
.flockfile:
48
	.weak	.flockfile
49
.funlockfile:
50
	.weak	.funlockfile
51
.__nop:
52
	.weak	.__nop
53
.__you_tried_to_link_a_dietlibc_object_against_glibc:
54
	.weak	.__you_tried_to_link_a_dietlibc_object_against_glibc
55
56
	blr
57
	.long 0
58
	.byte 0,0,0,1,128,0,0,0
59
	.size	._exit,.-._exit
60
	.size	.exit,.-.exit
61
62
diet_proto_weak(__thread_doexit)
63
diet_proto_weak(__fflush_stdin)
64
diet_proto_weak(__fflush_stdout)
65
diet_proto_weak(__fflush_stderr)
66
diet_proto_weak(flockfile)
67
diet_proto_weak(funlockfile)
68
diet_proto_weak(__nop)
69
diet_proto_weak(__you_tried_to_link_a_dietlibc_object_against_glibc)
70
diet_proto_weak(exit)
71
diet_proto(_exit)
72
73
#ifdef __ELF__
74
.section .note.GNU-stack,"",%progbits
75
#endif
(-)dietlibc-0.30-ppc-rename/syscalls.h (-1 / +1 lines)
Lines 12-18 Link Here
12
#endif
12
#endif
13
13
14
#elif defined(__powerpc64__)
14
#elif defined(__powerpc64__)
15
#include "ppc64/syscalls.h"
15
#include "powerpc64/syscalls.h"
16
16
17
#elif defined(__powerpc__)
17
#elif defined(__powerpc__)
18
#include "powerpc/syscalls.h"
18
#include "powerpc/syscalls.h"

Return to bug 179408