summaryrefslogtreecommitdiff
path: root/arch/mipsn32
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mipsn32')
-rw-r--r--arch/mipsn32/arch.mak1
-rw-r--r--arch/mipsn32/bits/alltypes.h.in21
-rw-r--r--arch/mipsn32/bits/endian.h5
-rw-r--r--arch/mipsn32/bits/ioctl.h102
-rw-r--r--arch/mipsn32/bits/ipcstat.h1
-rw-r--r--arch/mipsn32/bits/limits.h7
-rw-r--r--arch/mipsn32/bits/msg.h27
-rw-r--r--arch/mipsn32/bits/sem.h14
-rw-r--r--arch/mipsn32/bits/shm.h15
-rw-r--r--arch/mipsn32/bits/signal.h3
-rw-r--r--arch/mipsn32/bits/socket.h18
-rw-r--r--arch/mipsn32/bits/stat.h15
-rw-r--r--arch/mipsn32/bits/syscall.h.in67
-rw-r--r--arch/mipsn32/bits/termios.h2
-rw-r--r--arch/mipsn32/ksigaction.h2
-rw-r--r--arch/mipsn32/kstat.h22
-rw-r--r--arch/mipsn32/pthread_arch.h10
-rw-r--r--arch/mipsn32/reloc.h3
-rw-r--r--arch/mipsn32/syscall_arch.h129
19 files changed, 209 insertions, 255 deletions
diff --git a/arch/mipsn32/arch.mak b/arch/mipsn32/arch.mak
new file mode 100644
index 00000000..aa4d05ce
--- /dev/null
+++ b/arch/mipsn32/arch.mak
@@ -0,0 +1 @@
+COMPAT_SRC_DIRS = compat/time32
diff --git a/arch/mipsn32/bits/alltypes.h.in b/arch/mipsn32/bits/alltypes.h.in
index 66ca18ad..ff934a4c 100644
--- a/arch/mipsn32/bits/alltypes.h.in
+++ b/arch/mipsn32/bits/alltypes.h.in
@@ -1,9 +1,15 @@
+#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;
+#if _MIPSEL || __MIPSEL || __MIPSEL__
+#define __BYTE_ORDER 1234
+#else
+#define __BYTE_ORDER 4321
+#endif
+
+#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
TYPEDEF int wchar_t;
@@ -13,14 +19,3 @@ 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/mipsn32/bits/endian.h b/arch/mipsn32/bits/endian.h
deleted file mode 100644
index 5399dcb5..00000000
--- a/arch/mipsn32/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if _MIPSEL || __MIPSEL || __MIPSEL__
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#else
-#define __BYTE_ORDER __BIG_ENDIAN
-#endif
diff --git a/arch/mipsn32/bits/ioctl.h b/arch/mipsn32/bits/ioctl.h
index b8f77cb5..e20bf19e 100644
--- a/arch/mipsn32/bits/ioctl.h
+++ b/arch/mipsn32/bits/ioctl.h
@@ -90,24 +90,6 @@
#define TIOCMIWAIT 0x5491
#define TIOCGICOUNT 0x5492
-#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 TIOCSER_TEMT 0x01
-
-struct winsize {
- unsigned short ws_row;
- unsigned short ws_col;
- unsigned short ws_xpixel;
- unsigned short ws_ypixel;
-};
-
#define TIOCM_LE 0x001
#define TIOCM_DTR 0x002
#define TIOCM_RTS 0x004
@@ -123,90 +105,10 @@ struct winsize {
#define TIOCM_OUT2 0x4000
#define TIOCM_LOOP 0x8000
-#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 FIOGETOWN _IOR('f', 123, int)
#define FIOSETOWN _IOW('f', 124, int)
#define SIOCATMARK _IOR('s', 7, int)
#define SIOCSPGRP _IOW('s', 8, pid_t)
#define SIOCGPGRP _IOR('s', 9, pid_t)
-#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/mipsn32/bits/ipcstat.h b/arch/mipsn32/bits/ipcstat.h
new file mode 100644
index 00000000..4f4fcb0c
--- /dev/null
+++ b/arch/mipsn32/bits/ipcstat.h
@@ -0,0 +1 @@
+#define IPC_STAT 0x102
diff --git a/arch/mipsn32/bits/limits.h b/arch/mipsn32/bits/limits.h
deleted file mode 100644
index fbc6d238..00000000
--- a/arch/mipsn32/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/mipsn32/bits/msg.h b/arch/mipsn32/bits/msg.h
index f28aece8..c734dbb5 100644
--- a/arch/mipsn32/bits/msg.h
+++ b/arch/mipsn32/bits/msg.h
@@ -1,19 +1,19 @@
struct msqid_ds {
struct ipc_perm msg_perm;
#if _MIPSEL || __MIPSEL || __MIPSEL__
- time_t msg_stime;
- int __unused1;
- time_t msg_rtime;
- int __unused2;
- time_t msg_ctime;
- int __unused3;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_ctime_lo;
+ unsigned long __msg_ctime_hi;
#else
- 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;
#endif
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
@@ -21,4 +21,7 @@ struct msqid_ds {
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/mipsn32/bits/sem.h b/arch/mipsn32/bits/sem.h
index e46ced95..fe6f0948 100644
--- a/arch/mipsn32/bits/sem.h
+++ b/arch/mipsn32/bits/sem.h
@@ -1,14 +1,16 @@
struct semid_ds {
struct ipc_perm sem_perm;
- time_t sem_otime;
- time_t sem_ctime;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_ctime_lo;
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned short sem_nsems;
- char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
+ char __sem_nsems_pad[sizeof(long)-sizeof(short)];
#else
- char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
+ char __sem_nsems_pad[sizeof(long)-sizeof(short)];
unsigned short sem_nsems;
#endif
- time_t __unused3;
- time_t __unused4;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_ctime_hi;
+ time_t sem_otime;
+ time_t sem_ctime;
};
diff --git a/arch/mipsn32/bits/shm.h b/arch/mipsn32/bits/shm.h
index 8d193781..ab8c642d 100644
--- a/arch/mipsn32/bits/shm.h
+++ b/arch/mipsn32/bits/shm.h
@@ -3,14 +3,19 @@
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
- time_t shm_atime;
- time_t shm_dtime;
- time_t shm_ctime;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_ctime_lo;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
- unsigned long __pad1;
- unsigned long __pad2;
+ unsigned short __shm_atime_hi;
+ unsigned short __shm_dtime_hi;
+ unsigned short __shm_ctime_hi;
+ unsigned short __pad1;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
};
struct shminfo {
diff --git a/arch/mipsn32/bits/signal.h b/arch/mipsn32/bits/signal.h
index c31ad07e..ffec7fd0 100644
--- a/arch/mipsn32/bits/signal.h
+++ b/arch/mipsn32/bits/signal.h
@@ -85,7 +85,6 @@ typedef struct __ucontext {
#define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000
-#define SA_RESTORER 0x04000000
#undef SIG_BLOCK
#undef SIG_UNBLOCK
@@ -112,7 +111,7 @@ typedef struct __ucontext {
#define SIGTRAP 5
#define SIGABRT 6
#define SIGIOT SIGABRT
-#define SIGSTKFLT 7
+#define SIGEMT 7
#define SIGFPE 8
#define SIGKILL 9
#define SIGBUS 10
diff --git a/arch/mipsn32/bits/socket.h b/arch/mipsn32/bits/socket.h
index b82c7d34..02fbb88b 100644
--- a/arch/mipsn32/bits/socket.h
+++ b/arch/mipsn32/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 SOCK_STREAM 2
#define SOCK_DGRAM 1
@@ -32,8 +16,6 @@ struct cmsghdr {
#define SO_RCVBUF 0x1002
#define SO_SNDLOWAT 0x1003
#define SO_RCVLOWAT 0x1004
-#define SO_RCVTIMEO 0x1006
-#define SO_SNDTIMEO 0x1005
#define SO_ERROR 0x1007
#define SO_TYPE 0x1008
#define SO_ACCEPTCONN 0x1009
diff --git a/arch/mipsn32/bits/stat.h b/arch/mipsn32/bits/stat.h
index f4d1df83..6e2f2808 100644
--- a/arch/mipsn32/bits/stat.h
+++ b/arch/mipsn32/bits/stat.h
@@ -1,6 +1,3 @@
-#include <string.h>
-#include <bits/alltypes.h>
-
struct stat {
dev_t st_dev;
long __pad1[2];
@@ -12,11 +9,15 @@ struct stat {
dev_t st_rdev;
long __pad2[2];
off_t st_size;
- struct timespec st_atim;
- struct timespec st_mtim;
- struct timespec st_ctim;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
blksize_t st_blksize;
long __pad3;
blkcnt_t st_blocks;
- long __pad4[14];
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+ long __pad4[2];
};
diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
index c1726180..9a4bd301 100644
--- a/arch/mipsn32/bits/syscall.h.in
+++ b/arch/mipsn32/bits/syscall.h.in
@@ -92,7 +92,7 @@
#define __NR_fchown 6091
#define __NR_lchown 6092
#define __NR_umask 6093
-#define __NR_gettimeofday 6094
+#define __NR_gettimeofday_time32 6094
#define __NR_getrlimit 6095
#define __NR_getrusage 6096
#define __NR_sysinfo 6097
@@ -157,7 +157,7 @@
#define __NR_chroot 6156
#define __NR_sync 6157
#define __NR_acct 6158
-#define __NR_settimeofday 6159
+#define __NR_settimeofday_time32 6159
#define __NR_mount 6160
#define __NR_umount2 6161
#define __NR_swapon 6162
@@ -219,14 +219,14 @@
#define __NR_fstatfs64 6218
#define __NR_sendfile64 6219
#define __NR_timer_create 6220
-#define __NR_timer_settime 6221
-#define __NR_timer_gettime 6222
+#define __NR_timer_settime32 6221
+#define __NR_timer_gettime32 6222
#define __NR_timer_getoverrun 6223
#define __NR_timer_delete 6224
-#define __NR_clock_settime 6225
-#define __NR_clock_gettime 6226
-#define __NR_clock_getres 6227
-#define __NR_clock_nanosleep 6228
+#define __NR_clock_settime32 6225
+#define __NR_clock_gettime32 6226
+#define __NR_clock_getres_time32 6227
+#define __NR_clock_nanosleep_time32 6228
#define __NR_tgkill 6229
#define __NR_utimes 6230
#define __NR_mbind 6231
@@ -282,8 +282,8 @@
#define __NR_eventfd 6282
#define __NR_fallocate 6283
#define __NR_timerfd_create 6284
-#define __NR_timerfd_gettime 6285
-#define __NR_timerfd_settime 6286
+#define __NR_timerfd_gettime32 6285
+#define __NR_timerfd_settime32 6286
#define __NR_signalfd4 6287
#define __NR_eventfd2 6288
#define __NR_epoll_create1 6289
@@ -330,4 +330,51 @@
#define __NR_statx 6330
#define __NR_rseq 6331
#define __NR_io_pgetevents 6332
+#define __NR_clock_gettime64 6403
+#define __NR_clock_settime64 6404
+#define __NR_clock_adjtime64 6405
+#define __NR_clock_getres_time64 6406
+#define __NR_clock_nanosleep_time64 6407
+#define __NR_timer_gettime64 6408
+#define __NR_timer_settime64 6409
+#define __NR_timerfd_gettime64 6410
+#define __NR_timerfd_settime64 6411
+#define __NR_utimensat_time64 6412
+#define __NR_pselect6_time64 6413
+#define __NR_ppoll_time64 6414
+#define __NR_io_pgetevents_time64 6416
+#define __NR_recvmmsg_time64 6417
+#define __NR_mq_timedsend_time64 6418
+#define __NR_mq_timedreceive_time64 6419
+#define __NR_semtimedop_time64 6420
+#define __NR_rt_sigtimedwait_time64 6421
+#define __NR_futex_time64 6422
+#define __NR_sched_rr_get_interval_time64 6423
+#define __NR_pidfd_send_signal 6424
+#define __NR_io_uring_setup 6425
+#define __NR_io_uring_enter 6426
+#define __NR_io_uring_register 6427
+#define __NR_open_tree 6428
+#define __NR_move_mount 6429
+#define __NR_fsopen 6430
+#define __NR_fsconfig 6431
+#define __NR_fsmount 6432
+#define __NR_fspick 6433
+#define __NR_pidfd_open 6434
+#define __NR_clone3 6435
+#define __NR_close_range 6436
+#define __NR_openat2 6437
+#define __NR_pidfd_getfd 6438
+#define __NR_faccessat2 6439
+#define __NR_process_madvise 6440
+#define __NR_epoll_pwait2 6441
+#define __NR_mount_setattr 6442
+#define __NR_landlock_create_ruleset 6444
+#define __NR_landlock_add_rule 6445
+#define __NR_landlock_restrict_self 6446
+#define __NR_process_mrelease 6448
+#define __NR_futex_waitv 6449
+#define __NR_set_mempolicy_home_node 6450
+#define __NR_cachestat 6451
+#define __NR_fchmodat2 6452
diff --git a/arch/mipsn32/bits/termios.h b/arch/mipsn32/bits/termios.h
index f7b9dd2e..9d571f78 100644
--- a/arch/mipsn32/bits/termios.h
+++ b/arch/mipsn32/bits/termios.h
@@ -165,5 +165,5 @@ struct termios {
#define EXTPROC 0200000
#define XTABS 0014000
-#define TIOCSER_TEMT 0x01
+#define TIOCSER_TEMT 1
#endif
diff --git a/arch/mipsn32/ksigaction.h b/arch/mipsn32/ksigaction.h
index b565f1fc..485abf75 100644
--- a/arch/mipsn32/ksigaction.h
+++ b/arch/mipsn32/ksigaction.h
@@ -4,7 +4,7 @@ struct k_sigaction {
unsigned flags;
void (*handler)(int);
unsigned long mask[4];
- void (*restorer)();
+ void *unused;
};
hidden void __restore(), __restore_rt();
diff --git a/arch/mipsn32/kstat.h b/arch/mipsn32/kstat.h
new file mode 100644
index 00000000..3841559c
--- /dev/null
+++ b/arch/mipsn32/kstat.h
@@ -0,0 +1,22 @@
+struct kstat {
+ unsigned st_dev;
+ long __pad1[3];
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ uid_t st_uid;
+ gid_t st_gid;
+ unsigned st_rdev;
+ long __pad2[3];
+ off_t st_size;
+ long st_atime_sec;
+ long st_atime_nsec;
+ long st_mtime_sec;
+ long st_mtime_nsec;
+ long st_ctime_sec;
+ long st_ctime_nsec;
+ blksize_t st_blksize;
+ long __pad3;
+ blkcnt_t st_blocks;
+ long __pad4[14];
+};
diff --git a/arch/mipsn32/pthread_arch.h b/arch/mipsn32/pthread_arch.h
index 1e7839ea..c45347ab 100644
--- a/arch/mipsn32/pthread_arch.h
+++ b/arch/mipsn32/pthread_arch.h
@@ -1,19 +1,19 @@
-static inline struct pthread *__pthread_self()
+static inline uintptr_t __get_tp()
{
#if __mips_isa_rev < 2
- register char *tp __asm__("$3");
+ register uintptr_t tp __asm__("$3");
__asm__ (".word 0x7c03e83b" : "=r" (tp) );
#else
- char *tp;
+ uintptr_t tp;
__asm__ ("rdhwr %0, $29" : "=r" (tp) );
#endif
- 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
#define MC_PC pc
diff --git a/arch/mipsn32/reloc.h b/arch/mipsn32/reloc.h
index 728aaab2..bf00bd6a 100644
--- a/arch/mipsn32/reloc.h
+++ b/arch/mipsn32/reloc.h
@@ -1,5 +1,3 @@
-#include <endian.h>
-
#if __mips_isa_rev >= 6
#define ISA_SUFFIX "r6"
#else
@@ -31,6 +29,7 @@
#define NEED_MIPS_GOT_RELOCS 1
#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
+#define DT_DEBUG_INDIRECT_REL DT_MIPS_RLD_MAP_REL
#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
#define CRTJMP(pc,sp) __asm__ __volatile__( \
diff --git a/arch/mipsn32/syscall_arch.h b/arch/mipsn32/syscall_arch.h
index f6a1fbae..c681905d 100644
--- a/arch/mipsn32/syscall_arch.h
+++ b/arch/mipsn32/syscall_arch.h
@@ -1,20 +1,16 @@
#define __SYSCALL_LL_E(x) (x)
#define __SYSCALL_LL_O(x) (x)
-hidden long (__syscall)(long, ...);
-
#define SYSCALL_RLIM_INFINITY (-1UL/2)
-#if _MIPSEL || __MIPSEL || __MIPSEL__
-#define __stat_fix(st) ((st),(void)0)
+#if __mips_isa_rev >= 6
+#define SYSCALL_CLOBBERLIST \
+ "$1", "$3", "$10", "$11", "$12", "$13", \
+ "$14", "$15", "$24", "$25", "memory"
#else
-#include <sys/stat.h>
-static inline void __stat_fix(long p)
-{
- struct stat *st = (struct stat *)p;
- st->st_dev >>= 32;
- st->st_rdev >>= 32;
-}
+#define SYSCALL_CLOBBERLIST \
+ "$1", "$3", "$10", "$11", "$12", "$13", \
+ "$14", "$15", "$24", "$25", "hi", "lo", "memory"
#endif
static inline long __syscall0(long n)
@@ -22,11 +18,11 @@ static inline long __syscall0(long n)
register long r7 __asm__("$7");
register long r2 __asm__("$2");
__asm__ __volatile__ (
- "addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7)
- : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
- "$14", "$15", "$24", "$25", "hi", "lo", "memory");
- return r7 ? -r2 : r2;
+ "daddu $2,$0,%2 ; syscall"
+ : "=&r"(r2), "=r"(r7)
+ : "ir"(n), "0"(r2)
+ : SYSCALL_CLOBBERLIST);
+ return r7 && r2>0 ? -r2 : r2;
}
static inline long __syscall1(long n, long a)
@@ -35,12 +31,11 @@ static inline long __syscall1(long n, long a)
register long r7 __asm__("$7");
register long r2 __asm__("$2");
__asm__ __volatile__ (
- "addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4)
- : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
- "$14", "$15", "$24", "$25", "hi", "lo", "memory");
- return r7 ? -r2 : r2;
+ "daddu $2,$0,%2 ; syscall"
+ : "=&r"(r2), "=r"(r7)
+ : "ir"(n), "0"(r2), "r"(r4)
+ : SYSCALL_CLOBBERLIST);
+ return r7 && r2>0 ? -r2 : r2;
}
static inline long __syscall2(long n, long a, long b)
@@ -49,16 +44,13 @@ static inline long __syscall2(long n, long a, long b)
register long r5 __asm__("$5") = b;
register long r7 __asm__("$7");
register long r2 __asm__("$2");
+
__asm__ __volatile__ (
- "addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4), "r"(r5)
- : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
- "$14", "$15", "$24", "$25", "hi", "lo", "memory");
- if (r7) return -r2;
- long ret = r2;
- if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b);
- return ret;
+ "daddu $2,$0,%2 ; syscall"
+ : "=&r"(r2), "=r"(r7)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5)
+ : SYSCALL_CLOBBERLIST);
+ return r7 && r2>0 ? -r2 : r2;
}
static inline long __syscall3(long n, long a, long b, long c)
@@ -68,16 +60,13 @@ static inline long __syscall3(long n, long a, long b, long c)
register long r6 __asm__("$6") = c;
register long r7 __asm__("$7");
register long r2 __asm__("$2");
+
__asm__ __volatile__ (
- "addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4), "r"(r5), "r"(r6)
- : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
- "$14", "$15", "$24", "$25", "hi", "lo", "memory");
- if (r7) return -r2;
- long ret = r2;
- if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b);
- return ret;
+ "daddu $2,$0,%2 ; syscall"
+ : "=&r"(r2), "=r"(r7)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
+ : SYSCALL_CLOBBERLIST);
+ return r7 && r2>0 ? -r2 : r2;
}
static inline long __syscall4(long n, long a, long b, long c, long d)
@@ -87,37 +76,55 @@ static inline long __syscall4(long n, long a, long b, long c, long d)
register long r6 __asm__("$6") = c;
register long r7 __asm__("$7") = d;
register long r2 __asm__("$2");
+
__asm__ __volatile__ (
- "addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4), "r"(r5), "r"(r6)
- : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
- "$14", "$15", "$24", "$25", "hi", "lo", "memory");
- if (r7) return -r2;
- long ret = r2;
- if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b);
- if (n == SYS_newfstatat) __stat_fix(c);
- return ret;
+ "daddu $2,$0,%2 ; syscall"
+ : "=&r"(r2), "+r"(r7)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
+ : SYSCALL_CLOBBERLIST);
+ return r7 && r2>0 ? -r2 : r2;
}
static inline long __syscall5(long n, long a, long b, long c, long d, long e)
{
- long r2 = (__syscall)(n, a, b, c, d, e);
- if (r2 > -4096UL) return r2;
- if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b);
- if (n == SYS_newfstatat) __stat_fix(c);
- return r2;
+ register long r4 __asm__("$4") = a;
+ register long r5 __asm__("$5") = b;
+ register long r6 __asm__("$6") = c;
+ register long r7 __asm__("$7") = d;
+ register long r8 __asm__("$8") = e;
+ register long r2 __asm__("$2");
+
+ __asm__ __volatile__ (
+ "daddu $2,$0,%2 ; syscall"
+ : "=&r"(r2), "+r"(r7)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6), "r"(r8)
+ : SYSCALL_CLOBBERLIST);
+ return r7 && r2>0 ? -r2 : r2;
}
static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
{
- long r2 = (__syscall)(n, a, b, c, d, e, f);
- if (r2 > -4096UL) return r2;
- if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b);
- if (n == SYS_newfstatat) __stat_fix(c);
- return r2;
+ register long r4 __asm__("$4") = a;
+ register long r5 __asm__("$5") = b;
+ register long r6 __asm__("$6") = c;
+ register long r7 __asm__("$7") = d;
+ register long r8 __asm__("$8") = e;
+ register long r9 __asm__("$9") = f;
+ register long r2 __asm__("$2");
+
+ __asm__ __volatile__ (
+ "daddu $2,$0,%2 ; syscall"
+ : "=&r"(r2), "+r"(r7)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6), "r"(r8), "r"(r9)
+ : SYSCALL_CLOBBERLIST);
+ return r7 && r2>0 ? -r2 : r2;
}
#define VDSO_USEFUL
-#define VDSO_CGT_SYM "__vdso_clock_gettime"
+#define VDSO_CGT32_SYM "__vdso_clock_gettime"
+#define VDSO_CGT32_VER "LINUX_2.6"
+#define VDSO_CGT_SYM "__vdso_clock_gettime64"
#define VDSO_CGT_VER "LINUX_2.6"
+
+#define SO_SNDTIMEO_OLD 0x1005
+#define SO_RCVTIMEO_OLD 0x1006