summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/arch.mak1
-rw-r--r--arch/powerpc/bits/alltypes.h.in20
-rw-r--r--arch/powerpc/bits/endian.h15
-rw-r--r--arch/powerpc/bits/fenv.h2
-rw-r--r--arch/powerpc/bits/ioctl.h101
-rw-r--r--arch/powerpc/bits/ipc.h3
-rw-r--r--arch/powerpc/bits/ipcstat.h1
-rw-r--r--arch/powerpc/bits/limits.h7
-rw-r--r--arch/powerpc/bits/mman.h1
-rw-r--r--arch/powerpc/bits/msg.h15
-rw-r--r--arch/powerpc/bits/ptrace.h2
-rw-r--r--arch/powerpc/bits/sem.h10
-rw-r--r--arch/powerpc/bits/shm.h19
-rw-r--r--arch/powerpc/bits/signal.h2
-rw-r--r--arch/powerpc/bits/socket.h18
-rw-r--r--arch/powerpc/bits/stat.h6
-rw-r--r--arch/powerpc/bits/syscall.h.in77
-rw-r--r--arch/powerpc/bits/termios.h2
-rw-r--r--arch/powerpc/bits/user.h10
-rw-r--r--arch/powerpc/kstat.h20
-rw-r--r--arch/powerpc/pthread_arch.h10
-rw-r--r--arch/powerpc/reloc.h3
-rw-r--r--arch/powerpc/syscall_arch.h89
23 files changed, 230 insertions, 204 deletions
diff --git a/arch/powerpc/arch.mak b/arch/powerpc/arch.mak
new file mode 100644
index 00000000..aa4d05ce
--- /dev/null
+++ b/arch/powerpc/arch.mak
@@ -0,0 +1 @@
+COMPAT_SRC_DIRS = compat/time32
diff --git a/arch/powerpc/bits/alltypes.h.in b/arch/powerpc/bits/alltypes.h.in
index 37f27d6f..b48df6a6 100644
--- a/arch/powerpc/bits/alltypes.h.in
+++ b/arch/powerpc/bits/alltypes.h.in
@@ -1,26 +1,20 @@
+#define _REDIR_TIME64 1
#define _Addr int
#define _Int64 long long
#define _Reg int
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
+#define __BYTE_ORDER 4321
+#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
+#ifdef __WCHAR_TYPE__
+TYPEDEF __WCHAR_TYPE__ wchar_t;
+#else
TYPEDEF long wchar_t;
#endif
+#endif
TYPEDEF float float_t;
TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
-TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
diff --git a/arch/powerpc/bits/endian.h b/arch/powerpc/bits/endian.h
deleted file mode 100644
index 4442abf4..00000000
--- a/arch/powerpc/bits/endian.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifdef __BIG_ENDIAN__
- #if __BIG_ENDIAN__
- #define __BYTE_ORDER __BIG_ENDIAN
- #endif
-#endif /* __BIG_ENDIAN__ */
-
-#ifdef __LITTLE_ENDIAN__
- #if __LITTLE_ENDIAN__
- #define __BYTE_ORDER __LITTLE_ENDIAN
- #endif
-#endif /* __LITTLE_ENDIAN__ */
-
-#ifndef __BYTE_ORDER
- #define __BYTE_ORDER __BIG_ENDIAN
-#endif
diff --git a/arch/powerpc/bits/fenv.h b/arch/powerpc/bits/fenv.h
index c5a3e5c5..5b15c69a 100644
--- a/arch/powerpc/bits/fenv.h
+++ b/arch/powerpc/bits/fenv.h
@@ -1,4 +1,4 @@
-#ifdef _SOFT_FLOAT
+#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
#define FE_ALL_EXCEPT 0
#define FE_TONEAREST 0
#else
diff --git a/arch/powerpc/bits/ioctl.h b/arch/powerpc/bits/ioctl.h
index 47586234..ac9bfd20 100644
--- a/arch/powerpc/bits/ioctl.h
+++ b/arch/powerpc/bits/ioctl.h
@@ -78,14 +78,6 @@
#define TIOCGSERIAL 0x541E
#define TIOCSSERIAL 0x541F
#define TIOCPKT 0x5420
-#define TIOCPKT_DATA 0
-#define TIOCPKT_FLUSHREAD 1
-#define TIOCPKT_FLUSHWRITE 2
-#define TIOCPKT_STOP 4
-#define TIOCPKT_START 8
-#define TIOCPKT_NOSTOP 16
-#define TIOCPKT_DOSTOP 32
-#define TIOCPKT_IOCTL 64
#define TIOCNOTTY 0x5422
#define TIOCSETD 0x5423
@@ -113,105 +105,16 @@
#define TIOCSLCKTRMIOS 0x5457
#define TIOCSERGSTRUCT 0x5458
#define TIOCSERGETLSR 0x5459
-#define TIOCSER_TEMT 0x01
#define TIOCSERGETMULTI 0x545A
#define TIOCSERSETMULTI 0x545B
#define TIOCMIWAIT 0x545C
#define TIOCGICOUNT 0x545D
-
-struct winsize {
- unsigned short ws_row;
- unsigned short ws_col;
- unsigned short ws_xpixel;
- unsigned short ws_ypixel;
-};
-
-#define N_TTY 0
-#define N_SLIP 1
-#define N_MOUSE 2
-#define N_PPP 3
-#define N_STRIP 4
-#define N_AX25 5
-#define N_X25 6
-#define N_6PACK 7
-#define N_MASC 8
-#define N_R3964 9
-#define N_PROFIBUS_FDL 10
-#define N_IRDA 11
-#define N_SMSBLOCK 12
-#define N_HDLC 13
-#define N_SYNC_PPP 14
-#define N_HCI 15
-
#define FIOSETOWN 0x8901
#define SIOCSPGRP 0x8902
#define FIOGETOWN 0x8903
#define SIOCGPGRP 0x8904
#define SIOCATMARK 0x8905
-#define SIOCGSTAMP 0x8906
-#define SIOCGSTAMPNS 0x8907
-
-#define SIOCADDRT 0x890B
-#define SIOCDELRT 0x890C
-#define SIOCRTMSG 0x890D
-
-#define SIOCGIFNAME 0x8910
-#define SIOCSIFLINK 0x8911
-#define SIOCGIFCONF 0x8912
-#define SIOCGIFFLAGS 0x8913
-#define SIOCSIFFLAGS 0x8914
-#define SIOCGIFADDR 0x8915
-#define SIOCSIFADDR 0x8916
-#define SIOCGIFDSTADDR 0x8917
-#define SIOCSIFDSTADDR 0x8918
-#define SIOCGIFBRDADDR 0x8919
-#define SIOCSIFBRDADDR 0x891a
-#define SIOCGIFNETMASK 0x891b
-#define SIOCSIFNETMASK 0x891c
-#define SIOCGIFMETRIC 0x891d
-#define SIOCSIFMETRIC 0x891e
-#define SIOCGIFMEM 0x891f
-#define SIOCSIFMEM 0x8920
-#define SIOCGIFMTU 0x8921
-#define SIOCSIFMTU 0x8922
-#define SIOCSIFNAME 0x8923
-#define SIOCSIFHWADDR 0x8924
-#define SIOCGIFENCAP 0x8925
-#define SIOCSIFENCAP 0x8926
-#define SIOCGIFHWADDR 0x8927
-#define SIOCGIFSLAVE 0x8929
-#define SIOCSIFSLAVE 0x8930
-#define SIOCADDMULTI 0x8931
-#define SIOCDELMULTI 0x8932
-#define SIOCGIFINDEX 0x8933
-#define SIOGIFINDEX SIOCGIFINDEX
-#define SIOCSIFPFLAGS 0x8934
-#define SIOCGIFPFLAGS 0x8935
-#define SIOCDIFADDR 0x8936
-#define SIOCSIFHWBROADCAST 0x8937
-#define SIOCGIFCOUNT 0x8938
-
-#define SIOCGIFBR 0x8940
-#define SIOCSIFBR 0x8941
-
-#define SIOCGIFTXQLEN 0x8942
-#define SIOCSIFTXQLEN 0x8943
-
-#define SIOCDARP 0x8953
-#define SIOCGARP 0x8954
-#define SIOCSARP 0x8955
-
-#define SIOCDRARP 0x8960
-#define SIOCGRARP 0x8961
-#define SIOCSRARP 0x8962
-
-#define SIOCGIFMAP 0x8970
-#define SIOCSIFMAP 0x8971
-
-#define SIOCADDDLCI 0x8980
-#define SIOCDELDLCI 0x8981
-
-#define SIOCDEVPRIVATE 0x89F0
-#define SIOCPROTOPRIVATE 0x89E0
+#define SIOCGSTAMP _IOR(0x89, 6, char[16])
+#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
diff --git a/arch/powerpc/bits/ipc.h b/arch/powerpc/bits/ipc.h
index 3f2ede07..a388d56b 100644
--- a/arch/powerpc/bits/ipc.h
+++ b/arch/powerpc/bits/ipc.h
@@ -10,6 +10,3 @@ struct ipc_perm {
long long __pad2;
long long __pad3;
};
-
-#define IPC_64 0x100
-
diff --git a/arch/powerpc/bits/ipcstat.h b/arch/powerpc/bits/ipcstat.h
new file mode 100644
index 00000000..4f4fcb0c
--- /dev/null
+++ b/arch/powerpc/bits/ipcstat.h
@@ -0,0 +1 @@
+#define IPC_STAT 0x102
diff --git a/arch/powerpc/bits/limits.h b/arch/powerpc/bits/limits.h
deleted file mode 100644
index fbc6d238..00000000
--- a/arch/powerpc/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 32
-#endif
-
-#define LONG_MAX 0x7fffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/arch/powerpc/bits/mman.h b/arch/powerpc/bits/mman.h
index b3a675a8..95ec4358 100644
--- a/arch/powerpc/bits/mman.h
+++ b/arch/powerpc/bits/mman.h
@@ -4,7 +4,6 @@
#define MAP_NORESERVE 0x40
#undef MAP_LOCKED
#define MAP_LOCKED 0x80
-#undef MAP_SYNC
#undef MCL_CURRENT
#define MCL_CURRENT 0x2000
diff --git a/arch/powerpc/bits/msg.h b/arch/powerpc/bits/msg.h
index 171c11a3..9fb15dcc 100644
--- a/arch/powerpc/bits/msg.h
+++ b/arch/powerpc/bits/msg.h
@@ -1,15 +1,18 @@
struct msqid_ds {
struct ipc_perm msg_perm;
- int __unused1;
- time_t msg_stime;
- int __unused2;
- time_t msg_rtime;
- int __unused3;
- time_t msg_ctime;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_ctime_hi;
+ unsigned long __msg_ctime_lo;
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
+ time_t msg_stime;
+ time_t msg_rtime;
+ time_t msg_ctime;
};
diff --git a/arch/powerpc/bits/ptrace.h b/arch/powerpc/bits/ptrace.h
index 75086ca0..303a0735 100644
--- a/arch/powerpc/bits/ptrace.h
+++ b/arch/powerpc/bits/ptrace.h
@@ -8,6 +8,8 @@
#define PTRACE_SET_DEBUGREG 0x1a
#define PTRACE_GETVSRREGS 0x1b
#define PTRACE_SETVSRREGS 0x1c
+#define PTRACE_SYSEMU 0x1d
+#define PTRACE_SYSEMU_SINGLESTEP 0x1e
#define PTRACE_SINGLEBLOCK 0x100
#define PT_GETVRREGS PTRACE_GETVRREGS
diff --git a/arch/powerpc/bits/sem.h b/arch/powerpc/bits/sem.h
index bc2d6d1f..28be4845 100644
--- a/arch/powerpc/bits/sem.h
+++ b/arch/powerpc/bits/sem.h
@@ -1,10 +1,12 @@
struct semid_ds {
struct ipc_perm sem_perm;
- int __unused1;
- time_t sem_otime;
- int __unused2;
- time_t sem_ctime;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_ctime_hi;
+ unsigned long __sem_ctime_lo;
unsigned short __sem_nsems_pad, sem_nsems;
long __unused3;
long __unused4;
+ time_t sem_otime;
+ time_t sem_ctime;
};
diff --git a/arch/powerpc/bits/shm.h b/arch/powerpc/bits/shm.h
index 40e5e8be..7f1ca17e 100644
--- a/arch/powerpc/bits/shm.h
+++ b/arch/powerpc/bits/shm.h
@@ -2,19 +2,21 @@
struct shmid_ds {
struct ipc_perm shm_perm;
- int __unused1;
- time_t shm_atime;
- int __unused2;
- time_t shm_dtime;
- int __unused3;
- time_t shm_ctime;
- int __unused4;
+ unsigned long __shm_atime_hi;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_dtime_hi;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_ctime_hi;
+ unsigned long __shm_ctime_lo;
+ unsigned long __pad1;
size_t shm_segsz;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
- unsigned long __pad1;
unsigned long __pad2;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
};
struct shminfo {
@@ -26,4 +28,3 @@ struct shm_info {
unsigned long shm_tot, shm_rss, shm_swp;
unsigned long __swap_attempts, __swap_successes;
};
-
diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
index 06efb11c..c1bf3caf 100644
--- a/arch/powerpc/bits/signal.h
+++ b/arch/powerpc/bits/signal.h
@@ -28,7 +28,7 @@ struct sigcontext {
int signal;
unsigned long handler;
unsigned long oldmask;
- void *regs;
+ struct pt_regs *regs;
};
typedef struct {
diff --git a/arch/powerpc/bits/socket.h b/arch/powerpc/bits/socket.h
index a94b8bdb..b19ed42b 100644
--- a/arch/powerpc/bits/socket.h
+++ b/arch/powerpc/bits/socket.h
@@ -1,19 +1,3 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen;
- void *msg_control;
- socklen_t msg_controllen;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int cmsg_level;
- int cmsg_type;
-};
-
#define SO_DEBUG 1
#define SO_REUSEADDR 2
#define SO_TYPE 3
@@ -31,8 +15,6 @@ struct cmsghdr {
#define SO_REUSEPORT 15
#define SO_RCVLOWAT 16
#define SO_SNDLOWAT 17
-#define SO_RCVTIMEO 18
-#define SO_SNDTIMEO 19
#define SO_PASSCRED 20
#define SO_PEERCRED 21
#define SO_ACCEPTCONN 30
diff --git a/arch/powerpc/bits/stat.h b/arch/powerpc/bits/stat.h
index dcb896fd..585d98e9 100644
--- a/arch/powerpc/bits/stat.h
+++ b/arch/powerpc/bits/stat.h
@@ -13,8 +13,12 @@ struct stat {
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
+ unsigned __unused[2];
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
- unsigned __unused[2];
};
diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
index 54e155f2..ea95f3ed 100644
--- a/arch/powerpc/bits/syscall.h.in
+++ b/arch/powerpc/bits/syscall.h.in
@@ -76,8 +76,8 @@
#define __NR_setrlimit 75
#define __NR_getrlimit 76
#define __NR_getrusage 77
-#define __NR_gettimeofday 78
-#define __NR_settimeofday 79
+#define __NR_gettimeofday_time32 78
+#define __NR_settimeofday_time32 79
#define __NR_getgroups 80
#define __NR_setgroups 81
#define __NR_select 82
@@ -238,14 +238,14 @@
#define __NR_epoll_wait 238
#define __NR_remap_file_pages 239
#define __NR_timer_create 240
-#define __NR_timer_settime 241
-#define __NR_timer_gettime 242
+#define __NR_timer_settime32 241
+#define __NR_timer_gettime32 242
#define __NR_timer_getoverrun 243
#define __NR_timer_delete 244
-#define __NR_clock_settime 245
-#define __NR_clock_gettime 246
-#define __NR_clock_getres 247
-#define __NR_clock_nanosleep 248
+#define __NR_clock_settime32 245
+#define __NR_clock_gettime32 246
+#define __NR_clock_getres_time32 247
+#define __NR_clock_nanosleep_time32 248
#define __NR_swapcontext 249
#define __NR_tgkill 250
#define __NR_utimes 251
@@ -307,8 +307,8 @@
#define __NR_sync_file_range2 308
#define __NR_fallocate 309
#define __NR_subpage_prot 310
-#define __NR_timerfd_settime 311
-#define __NR_timerfd_gettime 312
+#define __NR_timerfd_settime32 311
+#define __NR_timerfd_gettime32 312
#define __NR_signalfd4 313
#define __NR_eventfd2 314
#define __NR_epoll_create1 315
@@ -373,4 +373,61 @@
#define __NR_pkey_mprotect 386
#define __NR_rseq 387
#define __NR_io_pgetevents 388
+#define __NR_semget 393
+#define __NR_semctl 394
+#define __NR_shmget 395
+#define __NR_shmctl 396
+#define __NR_shmat 397
+#define __NR_shmdt 398
+#define __NR_msgget 399
+#define __NR_msgsnd 400
+#define __NR_msgrcv 401
+#define __NR_msgctl 402
+#define __NR_clock_gettime64 403
+#define __NR_clock_settime64 404
+#define __NR_clock_adjtime64 405
+#define __NR_clock_getres_time64 406
+#define __NR_clock_nanosleep_time64 407
+#define __NR_timer_gettime64 408
+#define __NR_timer_settime64 409
+#define __NR_timerfd_gettime64 410
+#define __NR_timerfd_settime64 411
+#define __NR_utimensat_time64 412
+#define __NR_pselect6_time64 413
+#define __NR_ppoll_time64 414
+#define __NR_io_pgetevents_time64 416
+#define __NR_recvmmsg_time64 417
+#define __NR_mq_timedsend_time64 418
+#define __NR_mq_timedreceive_time64 419
+#define __NR_semtimedop_time64 420
+#define __NR_rt_sigtimedwait_time64 421
+#define __NR_futex_time64 422
+#define __NR_sched_rr_get_interval_time64 423
+#define __NR_pidfd_send_signal 424
+#define __NR_io_uring_setup 425
+#define __NR_io_uring_enter 426
+#define __NR_io_uring_register 427
+#define __NR_open_tree 428
+#define __NR_move_mount 429
+#define __NR_fsopen 430
+#define __NR_fsconfig 431
+#define __NR_fsmount 432
+#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
+#define __NR_close_range 436
+#define __NR_openat2 437
+#define __NR_pidfd_getfd 438
+#define __NR_faccessat2 439
+#define __NR_process_madvise 440
+#define __NR_epoll_pwait2 441
+#define __NR_mount_setattr 442
+#define __NR_landlock_create_ruleset 444
+#define __NR_landlock_add_rule 445
+#define __NR_landlock_restrict_self 446
+#define __NR_process_mrelease 448
+#define __NR_futex_waitv 449
+#define __NR_set_mempolicy_home_node 450
+#define __NR_cachestat 451
+#define __NR_fchmodat2 452
diff --git a/arch/powerpc/bits/termios.h b/arch/powerpc/bits/termios.h
index e3f22e86..da1f406b 100644
--- a/arch/powerpc/bits/termios.h
+++ b/arch/powerpc/bits/termios.h
@@ -167,5 +167,5 @@ struct termios {
#define EXTPROC 0x10000000
#define XTABS 00006000
-#define TIOCSER_TEMT 0x01
+#define TIOCSER_TEMT 1
#endif
diff --git a/arch/powerpc/bits/user.h b/arch/powerpc/bits/user.h
index 6cc8aaf7..7f528746 100644
--- a/arch/powerpc/bits/user.h
+++ b/arch/powerpc/bits/user.h
@@ -1,10 +1,8 @@
-struct pt_regs {
- unsigned long gpr[32], nip, msr, orig_gpr3, ctr, link, xer, ccr, mq;
- unsigned long trap, dar, dsisr, result;
-};
-
struct user {
- struct pt_regs regs;
+ struct {
+ unsigned long gpr[32], nip, msr, orig_gpr3, ctr, link, xer, ccr, mq;
+ unsigned long trap, dar, dsisr, result;
+ } regs;
unsigned long u_tsize, u_dsize, u_ssize;
unsigned long start_code, start_data, start_stack;
long signal;
diff --git a/arch/powerpc/kstat.h b/arch/powerpc/kstat.h
new file mode 100644
index 00000000..5a611e7b
--- /dev/null
+++ b/arch/powerpc/kstat.h
@@ -0,0 +1,20 @@
+struct kstat {
+ dev_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ short __st_rdev_padding;
+ off_t st_size;
+ blksize_t st_blksize;
+ blkcnt_t st_blocks;
+ long st_atime_sec;
+ long st_atime_nsec;
+ long st_mtime_sec;
+ long st_mtime_nsec;
+ long st_ctime_sec;
+ long st_ctime_nsec;
+ unsigned __unused[2];
+};
diff --git a/arch/powerpc/pthread_arch.h b/arch/powerpc/pthread_arch.h
index ae0f28d6..42e88b07 100644
--- a/arch/powerpc/pthread_arch.h
+++ b/arch/powerpc/pthread_arch.h
@@ -1,18 +1,16 @@
-static inline struct pthread *__pthread_self()
+static inline uintptr_t __get_tp()
{
- register char *tp __asm__("r2");
+ register uintptr_t tp __asm__("r2");
__asm__ ("" : "=r" (tp) );
- return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
+ return tp;
}
#define TLS_ABOVE_TP
#define GAP_ABOVE_TP 0
-#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
+#define TP_OFFSET 0x7000
#define DTP_OFFSET 0x8000
// the kernel calls the ip "nip", it's the first saved value after the 32
// GPRs.
#define MC_PC gregs[32]
-
-#define CANARY canary_at_end
diff --git a/arch/powerpc/reloc.h b/arch/powerpc/reloc.h
index 1b4cab36..fdfbf827 100644
--- a/arch/powerpc/reloc.h
+++ b/arch/powerpc/reloc.h
@@ -1,4 +1,4 @@
-#ifdef _SOFT_FLOAT
+#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
#define FP_SUFFIX "-sf"
#else
#define FP_SUFFIX ""
@@ -9,6 +9,7 @@
#define TPOFF_K (-0x7000)
#define REL_SYMBOLIC R_PPC_ADDR32
+#define REL_USYMBOLIC R_PPC_UADDR32
#define REL_GOT R_PPC_GLOB_DAT
#define REL_PLT R_PPC_JMP_SLOT
#define REL_RELATIVE R_PPC_RELATIVE
diff --git a/arch/powerpc/syscall_arch.h b/arch/powerpc/syscall_arch.h
index 004060e6..ede97c1c 100644
--- a/arch/powerpc/syscall_arch.h
+++ b/arch/powerpc/syscall_arch.h
@@ -3,7 +3,92 @@
((union { long long ll; long l[2]; }){ .ll = x }).l[1]
#define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
-#undef SYSCALL_NO_INLINE
-#define SYSCALL_NO_INLINE
+static inline long __syscall0(long n)
+{
+ register long r0 __asm__("r0") = n;
+ register long r3 __asm__("r3");
+ __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
+ : "+r"(r0), "=r"(r3)
+ :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
+ return r3;
+}
+
+static inline long __syscall1(long n, long a)
+{
+ register long r0 __asm__("r0") = n;
+ register long r3 __asm__("r3") = a;
+ __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
+ : "+r"(r0), "+r"(r3)
+ :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
+ return r3;
+}
+
+static inline long __syscall2(long n, long a, long b)
+{
+ register long r0 __asm__("r0") = n;
+ register long r3 __asm__("r3") = a;
+ register long r4 __asm__("r4") = b;
+ __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
+ : "+r"(r0), "+r"(r3), "+r"(r4)
+ :: "memory", "cr0", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
+ return r3;
+}
+
+static inline long __syscall3(long n, long a, long b, long c)
+{
+ register long r0 __asm__("r0") = n;
+ register long r3 __asm__("r3") = a;
+ register long r4 __asm__("r4") = b;
+ register long r5 __asm__("r5") = c;
+ __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
+ : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5)
+ :: "memory", "cr0", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
+ return r3;
+}
+
+static inline long __syscall4(long n, long a, long b, long c, long d)
+{
+ register long r0 __asm__("r0") = n;
+ register long r3 __asm__("r3") = a;
+ register long r4 __asm__("r4") = b;
+ register long r5 __asm__("r5") = c;
+ register long r6 __asm__("r6") = d;
+ __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
+ : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6)
+ :: "memory", "cr0", "r7", "r8", "r9", "r10", "r11", "r12");
+ return r3;
+}
+
+static inline long __syscall5(long n, long a, long b, long c, long d, long e)
+{
+ register long r0 __asm__("r0") = n;
+ register long r3 __asm__("r3") = a;
+ register long r4 __asm__("r4") = b;
+ register long r5 __asm__("r5") = c;
+ register long r6 __asm__("r6") = d;
+ register long r7 __asm__("r7") = e;
+ __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
+ : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7)
+ :: "memory", "cr0", "r8", "r9", "r10", "r11", "r12");
+ return r3;
+}
+
+static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
+{
+ register long r0 __asm__("r0") = n;
+ register long r3 __asm__("r3") = a;
+ register long r4 __asm__("r4") = b;
+ register long r5 __asm__("r5") = c;
+ register long r6 __asm__("r6") = d;
+ register long r7 __asm__("r7") = e;
+ register long r8 __asm__("r8") = f;
+ __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
+ : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7), "+r"(r8)
+ :: "memory", "cr0", "r9", "r10", "r11", "r12");
+ return r3;
+}
#define SYSCALL_FADVISE_6_ARG
+
+#define SO_RCVTIMEO_OLD 18
+#define SO_SNDTIMEO_OLD 19