summaryrefslogtreecommitdiff
path: root/arch/or1k
diff options
context:
space:
mode:
Diffstat (limited to 'arch/or1k')
-rw-r--r--arch/or1k/arch.mak1
-rw-r--r--arch/or1k/bits/alltypes.h.in16
-rw-r--r--arch/or1k/bits/endian.h1
-rw-r--r--arch/or1k/bits/ipc.h13
-rw-r--r--arch/or1k/bits/ipcstat.h1
-rw-r--r--arch/or1k/bits/limits.h7
-rw-r--r--arch/or1k/bits/msg.h15
-rw-r--r--arch/or1k/bits/posix.h2
-rw-r--r--arch/or1k/bits/reg.h3
-rw-r--r--arch/or1k/bits/sem.h13
-rw-r--r--arch/or1k/bits/shm.h31
-rw-r--r--arch/or1k/bits/signal.h1
-rw-r--r--arch/or1k/bits/stat.h10
-rw-r--r--arch/or1k/bits/stdint.h20
-rw-r--r--arch/or1k/bits/syscall.h.in69
-rw-r--r--arch/or1k/kstat.h21
-rw-r--r--arch/or1k/pthread_arch.h10
-rw-r--r--arch/or1k/syscall_arch.h9
18 files changed, 150 insertions, 93 deletions
diff --git a/arch/or1k/arch.mak b/arch/or1k/arch.mak
new file mode 100644
index 00000000..aa4d05ce
--- /dev/null
+++ b/arch/or1k/arch.mak
@@ -0,0 +1 @@
+COMPAT_SRC_DIRS = compat/time32
diff --git a/arch/or1k/bits/alltypes.h.in b/arch/or1k/bits/alltypes.h.in
index 667963c7..7d3e291a 100644
--- a/arch/or1k/bits/alltypes.h.in
+++ b/arch/or1k/bits/alltypes.h.in
@@ -1,9 +1,10 @@
+#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
TYPEDEF unsigned wchar_t;
@@ -13,14 +14,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/or1k/bits/endian.h b/arch/or1k/bits/endian.h
deleted file mode 100644
index ef074b77..00000000
--- a/arch/or1k/bits/endian.h
+++ /dev/null
@@ -1 +0,0 @@
-#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/arch/or1k/bits/ipc.h b/arch/or1k/bits/ipc.h
deleted file mode 100644
index 3d894e30..00000000
--- a/arch/or1k/bits/ipc.h
+++ /dev/null
@@ -1,13 +0,0 @@
-struct ipc_perm {
- key_t __ipc_perm_key;
- uid_t uid;
- gid_t gid;
- uid_t cuid;
- gid_t cgid;
- mode_t mode;
- int __ipc_perm_seq;
- long __pad1;
- long __pad2;
-};
-
-#define IPC_64 0
diff --git a/arch/or1k/bits/ipcstat.h b/arch/or1k/bits/ipcstat.h
new file mode 100644
index 00000000..4f4fcb0c
--- /dev/null
+++ b/arch/or1k/bits/ipcstat.h
@@ -0,0 +1 @@
+#define IPC_STAT 0x102
diff --git a/arch/or1k/bits/limits.h b/arch/or1k/bits/limits.h
index 3a811c99..fac47aad 100644
--- a/arch/or1k/bits/limits.h
+++ b/arch/or1k/bits/limits.h
@@ -1,8 +1 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define PAGESIZE 8192
-#define LONG_BIT 32
-#endif
-
-#define LONG_MAX 0x7fffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/arch/or1k/bits/msg.h b/arch/or1k/bits/msg.h
index bc8436c4..7bbbb2bf 100644
--- a/arch/or1k/bits/msg.h
+++ b/arch/or1k/bits/msg.h
@@ -1,15 +1,18 @@
struct msqid_ds {
struct ipc_perm msg_perm;
- 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;
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/or1k/bits/posix.h b/arch/or1k/bits/posix.h
deleted file mode 100644
index 30a38714..00000000
--- a/arch/or1k/bits/posix.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define _POSIX_V6_ILP32_OFFBIG 1
-#define _POSIX_V7_ILP32_OFFBIG 1
diff --git a/arch/or1k/bits/reg.h b/arch/or1k/bits/reg.h
deleted file mode 100644
index 0c7bffca..00000000
--- a/arch/or1k/bits/reg.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#undef __WORDSIZE
-#define __WORDSIZE 32
-/* FIXME */
diff --git a/arch/or1k/bits/sem.h b/arch/or1k/bits/sem.h
new file mode 100644
index 00000000..d88338e6
--- /dev/null
+++ b/arch/or1k/bits/sem.h
@@ -0,0 +1,13 @@
+struct semid_ds {
+ struct ipc_perm sem_perm;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_ctime_lo;
+ unsigned long __sem_ctime_hi;
+ char __sem_nsems_pad[sizeof(long)-sizeof(short)];
+ unsigned short sem_nsems;
+ long __unused3;
+ long __unused4;
+ time_t sem_otime;
+ time_t sem_ctime;
+};
diff --git a/arch/or1k/bits/shm.h b/arch/or1k/bits/shm.h
new file mode 100644
index 00000000..725fb469
--- /dev/null
+++ b/arch/or1k/bits/shm.h
@@ -0,0 +1,31 @@
+#define SHMLBA 4096
+
+struct shmid_ds {
+ struct ipc_perm shm_perm;
+ size_t shm_segsz;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_atime_hi;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_dtime_hi;
+ unsigned long __shm_ctime_lo;
+ unsigned long __shm_ctime_hi;
+ pid_t shm_cpid;
+ pid_t shm_lpid;
+ unsigned long shm_nattch;
+ unsigned long __pad1;
+ unsigned long __pad2;
+ unsigned long __pad3;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
+};
+
+struct shminfo {
+ unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
+};
+
+struct shm_info {
+ int __used_ids;
+ unsigned long shm_tot, shm_rss, shm_swp;
+ unsigned long __swap_attempts, __swap_successes;
+};
diff --git a/arch/or1k/bits/signal.h b/arch/or1k/bits/signal.h
index be576d1d..c45be676 100644
--- a/arch/or1k/bits/signal.h
+++ b/arch/or1k/bits/signal.h
@@ -43,7 +43,6 @@ typedef struct __ucontext {
#define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000
-#define SA_RESTORER 0x04000000
#endif
diff --git a/arch/or1k/bits/stat.h b/arch/or1k/bits/stat.h
index ce6a6bd0..cde3fd02 100644
--- a/arch/or1k/bits/stat.h
+++ b/arch/or1k/bits/stat.h
@@ -14,8 +14,12 @@ struct stat {
blksize_t st_blksize;
int __st_blksize_padding;
blkcnt_t st_blocks;
- 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;
unsigned __unused[2];
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
};
diff --git a/arch/or1k/bits/stdint.h b/arch/or1k/bits/stdint.h
deleted file mode 100644
index d1b27121..00000000
--- a/arch/or1k/bits/stdint.h
+++ /dev/null
@@ -1,20 +0,0 @@
-typedef int32_t int_fast16_t;
-typedef int32_t int_fast32_t;
-typedef uint32_t uint_fast16_t;
-typedef uint32_t uint_fast32_t;
-
-#define INT_FAST16_MIN INT32_MIN
-#define INT_FAST32_MIN INT32_MIN
-
-#define INT_FAST16_MAX INT32_MAX
-#define INT_FAST32_MAX INT32_MAX
-
-#define UINT_FAST16_MAX UINT32_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-
-#define INTPTR_MIN INT32_MIN
-#define INTPTR_MAX INT32_MAX
-#define UINTPTR_MAX UINT32_MAX
-#define PTRDIFF_MIN INT32_MIN
-#define PTRDIFF_MAX INT32_MAX
-#define SIZE_MAX UINT32_MAX
diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in
index 76ba2c6e..00812bf8 100644
--- a/arch/or1k/bits/syscall.h.in
+++ b/arch/or1k/bits/syscall.h.in
@@ -85,8 +85,8 @@
#define __NR_fdatasync 83
#define __NR_sync_file_range 84
#define __NR_timerfd_create 85
-#define __NR_timerfd_settime 86
-#define __NR_timerfd_gettime 87
+#define __NR_timerfd_settime32 86
+#define __NR_timerfd_gettime32 87
#define __NR_utimensat 88
#define __NR_acct 89
#define __NR_capget 90
@@ -107,14 +107,14 @@
#define __NR_init_module 105
#define __NR_delete_module 106
#define __NR_timer_create 107
-#define __NR_timer_gettime 108
+#define __NR_timer_gettime32 108
#define __NR_timer_getoverrun 109
-#define __NR_timer_settime 110
+#define __NR_timer_settime32 110
#define __NR_timer_delete 111
-#define __NR_clock_settime 112
-#define __NR_clock_gettime 113
-#define __NR_clock_getres 114
-#define __NR_clock_nanosleep 115
+#define __NR_clock_settime32 112
+#define __NR_clock_gettime32 113
+#define __NR_clock_getres_time32 114
+#define __NR_clock_nanosleep_time32 115
#define __NR_syslog 116
#define __NR_ptrace 117
#define __NR_sched_setparam 118
@@ -168,8 +168,8 @@
#define __NR_umask 166
#define __NR_prctl 167
#define __NR_getcpu 168
-#define __NR_gettimeofday 169
-#define __NR_settimeofday 170
+#define __NR_gettimeofday_time32 169
+#define __NR_settimeofday_time32 170
#define __NR_adjtimex 171
#define __NR_getpid 172
#define __NR_getppid 173
@@ -277,4 +277,53 @@
#define __NR_pkey_free 290
#define __NR_statx 291
#define __NR_io_pgetevents 292
+#define __NR_rseq 293
+#define __NR_kexec_file_load 294
+#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/or1k/kstat.h b/arch/or1k/kstat.h
new file mode 100644
index 00000000..c1449579
--- /dev/null
+++ b/arch/or1k/kstat.h
@@ -0,0 +1,21 @@
+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;
+ long long __st_rdev_padding;
+ off_t st_size;
+ blksize_t st_blksize;
+ int __st_blksize_padding;
+ 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/or1k/pthread_arch.h b/arch/or1k/pthread_arch.h
index 1b806f89..f75ea7e4 100644
--- a/arch/or1k/pthread_arch.h
+++ b/arch/or1k/pthread_arch.h
@@ -1,18 +1,16 @@
-/* or1k use variant I, but with the twist that tp points to the end of TCB */
-static inline struct pthread *__pthread_self()
+static inline uintptr_t __get_tp()
{
#ifdef __clang__
- char *tp;
+ uintptr_t tp;
__asm__ ("l.ori %0, r10, 0" : "=r" (tp) );
#else
- register char *tp __asm__("r10");
+ register uintptr_t tp __asm__("r10");
__asm__ ("" : "=r" (tp) );
#endif
- return (struct pthread *) (tp - sizeof(struct pthread));
+ return tp;
}
#define TLS_ABOVE_TP
#define GAP_ABOVE_TP 0
-#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
#define MC_PC regs.pc
diff --git a/arch/or1k/syscall_arch.h b/arch/or1k/syscall_arch.h
index caff7ece..21738ce0 100644
--- a/arch/or1k/syscall_arch.h
+++ b/arch/or1k/syscall_arch.h
@@ -5,8 +5,6 @@
#define SYSCALL_MMAP2_UNIT 8192ULL
-#ifndef __clang__
-
static __inline long __syscall0(long n)
{
register unsigned long r11 __asm__("r11") = n;
@@ -114,9 +112,4 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
return r11;
}
-#else
-
-#undef SYSCALL_NO_INLINE
-#define SYSCALL_NO_INLINE
-
-#endif
+#define IPC_64 0