summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/mips
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/mips')
-rw-r--r--libc/sysdeps/linux/mips/bits/kernel_stat.h4
-rw-r--r--libc/sysdeps/linux/mips/bits/resource.h21
-rw-r--r--libc/sysdeps/linux/mips/bits/sem.h13
-rw-r--r--libc/sysdeps/linux/mips/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/mips/crt1.S23
5 files changed, 57 insertions, 7 deletions
diff --git a/libc/sysdeps/linux/mips/bits/kernel_stat.h b/libc/sysdeps/linux/mips/bits/kernel_stat.h
index a2a6169a3..23a6ce61a 100644
--- a/libc/sysdeps/linux/mips/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/mips/bits/kernel_stat.h
@@ -14,7 +14,11 @@ typedef struct {
} __ktimespec_t;
#else
typedef struct {
+#if defined(__UCLIBC_USE_TIME64__)
+ __S32_TYPE tv_sec;
+#else
time_t tv_sec;
+#endif
unsigned long tv_nsec;
} __ktimespec_t;
#endif
diff --git a/libc/sysdeps/linux/mips/bits/resource.h b/libc/sysdeps/linux/mips/bits/resource.h
index b204aefd6..97487d274 100644
--- a/libc/sysdeps/linux/mips/bits/resource.h
+++ b/libc/sysdeps/linux/mips/bits/resource.h
@@ -99,7 +99,13 @@ enum __rlimit_resource
__RLIMIT_RTPRIO = 14,
#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
- __RLIMIT_NLIMITS = 15,
+ /* Maximum CPU time in µs that a process scheduled under a real-time
+ scheduling policy may consume without making a blocking system
+ call before being forcibly descheduled. */
+ __RLIMIT_RTTIME = 15,
+#define RLIMIT_RTTIME __RLIMIT_RTTIME
+
+ __RLIMIT_NLIMITS = 16,
__RLIM_NLIMITS = __RLIMIT_NLIMITS
#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
#define RLIM_NLIMITS __RLIM_NLIMITS
@@ -117,10 +123,10 @@ enum __rlimit_resource
# ifndef __USE_FILE_OFFSET64
# define RLIM_INFINITY ((long int)(~0UL >> 1))
# else
-# define RLIM_INFINITY 0x7fffffffffffffffULL
+# define RLIM_INFINITY 0xffffffffffffffffULL
# endif
# ifdef __USE_LARGEFILE64
-# define RLIM64_INFINITY 0x7fffffffffffffffULL
+# define RLIM64_INFINITY 0xffffffffffffffffULL
# endif
#endif
@@ -167,6 +173,15 @@ enum __rusage_who
/* All of its terminated child processes. */
RUSAGE_CHILDREN = -1
#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+
+#ifdef __USE_GNU
+ ,
+ /* The calling thread. */
+ RUSAGE_THREAD = 1
+# define RUSAGE_THREAD RUSAGE_THREAD
+ /* Name for the same functionality on Solaris. */
+# define RUSAGE_LWP RUSAGE_THREAD
+#endif
};
#define __need_timeval
diff --git a/libc/sysdeps/linux/mips/bits/sem.h b/libc/sysdeps/linux/mips/bits/sem.h
index 3e4e9682b..35eaa05c3 100644
--- a/libc/sysdeps/linux/mips/bits/sem.h
+++ b/libc/sysdeps/linux/mips/bits/sem.h
@@ -38,9 +38,20 @@
struct semid_ds
{
struct ipc_perm sem_perm; /* operation permission struct */
- __time_t sem_otime; /* last semop() time */
+#if defined(__UCLIBC_USE_TIME64__)
+ unsigned long int __sem_otime_internal_1; /* last semop() time */
+ unsigned long int __sem_otime_internal_2;
+ unsigned long int __sem_ctime_internal_1; /* last time changed by semctl() */
+ unsigned long int __sem_ctime_internal_2;
+#else
+ __time_t sem_otime; /* last semop() time */
__time_t sem_ctime; /* last time changed by semctl() */
+#endif
unsigned long int sem_nsems; /* number of semaphores in set */
+#if defined(__UCLIBC_USE_TIME64__)
+ __time_t sem_otime;
+ __time_t sem_ctime;
+#endif
unsigned long int __uclibc_unused1;
unsigned long int __uclibc_unused2;
};
diff --git a/libc/sysdeps/linux/mips/bits/uClibc_arch_features.h b/libc/sysdeps/linux/mips/bits/uClibc_arch_features.h
index 59d9f0807..bcdf124a4 100644
--- a/libc/sysdeps/linux/mips/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/mips/bits/uClibc_arch_features.h
@@ -12,9 +12,6 @@
/* can your target use syscall6() for mmap ? */
#define __UCLIBC_MMAP_HAS_6_ARGS__
-/* does your target use statx */
-#undef __UCLIBC_HAVE_STATX__
-
/* does your target align 64bit values in register pairs ? (32bit arches only) */
#if _MIPS_SIM == _ABIO32
#define __UCLIBC_SYSCALL_ALIGN_64BIT__
diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S
index 083615515..7c4db447c 100644
--- a/libc/sysdeps/linux/mips/crt1.S
+++ b/libc/sysdeps/linux/mips/crt1.S
@@ -78,6 +78,10 @@
.weak _init
.weak _fini
#endif
+#ifdef L_rcrt1
+ .type reloc_static_pie,@function
+ .hidden .L0
+#endif
.type main,@function
.type __uClibc_main,@function
.ent __start
@@ -90,6 +94,25 @@ __start:
PTR_LA $28, _gp /* Setup GP correctly if we're non-PIC. */
move $31, $0
#endif
+#ifdef L_rcrt1
+ PTR_LA $4, _DYNAMIC /* Place _DYNAMIC into the GOT */
+ REG_S $4, -0x7ff0($28) /* offset to GOT stolen from dl-startup */
+ jal .L0 /* Get the current $pc address */
+.L0:
+ PTR_SUBU $4, $31, $25 /* Calculate load addr */
+ move $31, $0 /* Clear ra */
+ and $29, -2 * SZREG /* Ensure stack is aligned */
+ PTR_ADDIU $29, (-2 * SZREG) /* Allocate 2 register spaces on stack */
+ REG_S $2, SZREG($29) /* Store atexit in case it exists */
+ PTR_LA $5, reloc_static_pie /* function calls before relocation
+ don't work unless we set $t9 manually */
+ PTR_ADDU $25, $4, $5 /* store reloc_static_pie in $t9 */
+ jalr $25 /* call reloc_static_pie */
+ nop /* delay slot, just in case */
+ REG_L $2, SZREG($29) /* cleanup stack */
+ PTR_ADDIU $29, $29, (2 * SZREG)
+
+#endif
PTR_LA $4, main /* main */
PTR_L $5, 0($29) /* argc */