summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r--libc/sysdeps/linux/arm/bits/syscalls.h57
-rw-r--r--libc/sysdeps/linux/arm/clone.S74
-rw-r--r--libc/sysdeps/linux/arm/sysdep.h36
-rw-r--r--libc/sysdeps/linux/common/bits/mathcalls.h18
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_fpmax.h4
-rw-r--r--libc/sysdeps/linux/common/fstatat64.c8
-rw-r--r--libc/sysdeps/linux/common/setregid.c2
-rw-r--r--libc/sysdeps/linux/common/setresgid.c4
-rw-r--r--libc/sysdeps/linux/common/setresuid.c4
-rw-r--r--libc/sysdeps/linux/common/setreuid.c2
-rw-r--r--libc/sysdeps/linux/common/sync_file_range.c3
-rw-r--r--libc/sysdeps/linux/common/utime.c1
-rw-r--r--libc/sysdeps/linux/common/xstatconv.c27
-rw-r--r--libc/sysdeps/linux/cris/sys/procfs.h6
-rw-r--r--libc/sysdeps/linux/cris/sysdep.S2
-rw-r--r--libc/sysdeps/linux/m68k/sys/reg.h88
-rw-r--r--libc/sysdeps/linux/microblaze/bits/uClibc_page.h2
-rw-r--r--libc/sysdeps/linux/mips/bits/kernel_stat.h36
-rw-r--r--libc/sysdeps/linux/xtensa/Makefile.arch5
-rw-r--r--libc/sysdeps/linux/xtensa/clone.S101
-rw-r--r--libc/sysdeps/linux/xtensa/fork.c8
-rw-r--r--libc/sysdeps/linux/xtensa/jmpbuf-unwind.h38
-rw-r--r--libc/sysdeps/linux/xtensa/sys/ptrace.h155
-rw-r--r--libc/sysdeps/linux/xtensa/sysdep.h39
-rw-r--r--libc/sysdeps/linux/xtensa/vfork.S104
25 files changed, 505 insertions, 319 deletions
diff --git a/libc/sysdeps/linux/arm/bits/syscalls.h b/libc/sysdeps/linux/arm/bits/syscalls.h
index 5544ca652..e447a7b2d 100644
--- a/libc/sysdeps/linux/arm/bits/syscalls.h
+++ b/libc/sysdeps/linux/arm/bits/syscalls.h
@@ -43,41 +43,7 @@
}) \
)
-#if !defined(__thumb__)
-#if defined(__ARM_EABI__)
-#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
-(__extension__ \
- ({unsigned int __internal_sys_result; \
- { \
- register int __a1 __asm__ ("r0"), _nr __asm__ ("r7"); \
- LOAD_ARGS_##nr (args) \
- _nr = (name); \
- __asm__ __volatile__ ("swi 0x0 @ syscall " #name \
- : "=r" (__a1) \
- : "r" (_nr) ASM_ARGS_##nr \
- : "memory"); \
- __internal_sys_result = __a1; \
- } \
- (int) __internal_sys_result; }) \
-)
-#else /* defined(__ARM_EABI__) */
-
-#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
-(__extension__ \
- ({ unsigned int __internal_sys_result; \
- { \
- register int __a1 __asm__ ("a1"); \
- LOAD_ARGS_##nr (args) \
- __asm__ __volatile__ ("swi %1 @ syscall " #name \
- : "=r" (__a1) \
- : "i" (name) ASM_ARGS_##nr \
- : "memory"); \
- __internal_sys_result = __a1; \
- } \
- (int) __internal_sys_result; }) \
-)
-#endif
-#else /* !defined(__thumb__) */
+#if defined(__thumb__)
/* We can't use push/pop inside the asm because that breaks
unwinding (ie. thread cancellation).
*/
@@ -101,7 +67,23 @@
} \
(int) __internal_sys_result; }) \
)
-#endif /*!defined(__thumb__)*/
+#else /* ARM */
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+(__extension__ \
+ ({unsigned int __internal_sys_result; \
+ { \
+ register int __a1 __asm__ ("r0"), _nr __asm__ ("r7"); \
+ LOAD_ARGS_##nr (args) \
+ _nr = (name); \
+ __asm__ __volatile__ ("swi 0x0 @ syscall " #name \
+ : "=r" (__a1) \
+ : "r" (_nr) ASM_ARGS_##nr \
+ : "memory"); \
+ __internal_sys_result = __a1; \
+ } \
+ (int) __internal_sys_result; }) \
+)
+#endif
#define INTERNAL_SYSCALL_ERROR_P(val, err) \
((unsigned int) (val) >= 0xfffff001u)
@@ -138,12 +120,13 @@
LOAD_ARGS_5 (a1, a2, a3, a4, a5) \
register int __v2 __asm__ ("v2") = __v2tmp;
#define ASM_ARGS_6 ASM_ARGS_5, "r" (__v2)
+#ifndef __thumb__
#define LOAD_ARGS_7(a1, a2, a3, a4, a5, a6, a7) \
int __v3tmp = (int) (a7); \
LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6) \
register int __v3 __asm__ ("v3") = __v3tmp;
#define ASM_ARGS_7 ASM_ARGS_6, "r" (__v3)
-
+#endif
#endif /* __ASSEMBLER__ */
#endif /* _BITS_SYSCALLS_H */
diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
index 63eca31c1..b4c7d8a02 100644
--- a/libc/sysdeps/linux/arm/clone.S
+++ b/libc/sysdeps/linux/arm/clone.S
@@ -19,6 +19,7 @@
/* clone() is even more special than fork() as it mucks with stacks
and invokes a function in the right context after its all over. */
+#include <sysdep.h>
#define _ERRNO_H
#include <features.h>
#include <bits/errno.h>
@@ -26,6 +27,13 @@
#include <bits/arm_asm.h>
#include <bits/arm_bx.h>
+#if defined __UCLIBC_HAS_THREADS__ && !defined __LINUXTHREADS_OLD__
+#include <sysdep-cancel.h>
+#endif
+
+#define CLONE_VM 0x00000100
+#define CLONE_THREAD 0x00010000
+
#if defined(__NR_clone)
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
@@ -52,23 +60,22 @@ __clone:
@ get flags
mov r0, r2
@ new sp is already in r1
- @ load remaining arguments off the stack
- stmfd sp!, {r4}
- ldr r2, [sp, #4]
- ldr r3, [sp, #8]
- ldr r4, [sp, #12]
DO_CALL (clone)
movs a1, a1
blt __error
- ldmnefd sp!, {r4}
beq 1f
bx lr
1:
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
+#if defined(__USE_BX__)
ldr r1, [sp]
bl 2f @ blx r1
+#else
+ mov lr, pc
+ ldr pc, [sp]
+#endif
@ and we are done, passing the return value through r0
bl HIDDEN_JUMPTARGET(_exit)
@@ -87,6 +94,8 @@ __error:
.pool
#else
__clone:
+.fnstart
+.cantunwind
@ sanity check args
cmp r0, #0
IT(te, ne)
@@ -95,28 +104,55 @@ __clone:
beq __error
@ insert the args onto the new stack
- sub r1, r1, #8
- str r3, [r1, #4]
- @ save the function pointer as the 0th element
- str r0, [r1]
+ str r3, [r1, #-4]!
+ str r0, [r1, #-4]!
@ do the system call
@ get flags
mov r0, r2
+#ifdef RESET_PID
+ mov ip, r2
+#endif
@ new sp is already in r1
- @ load remaining arguments off the stack
- stmfd sp!, {r4}
- ldr r2, [sp, #4]
- ldr r3, [sp, #8]
- ldr r4, [sp, #12]
- DO_CALL (clone)
- movs a1, a1
- IT(t, ne)
- ldmnefd sp!, {r4}
+ push {r4, r7}
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (r4, 0)
+ cfi_rel_offset (r7, 4)
+ ldr r2, [sp, #8]
+ ldr r3, [sp, #12]
+ ldr r4, [sp, #16]
+ ldr r7, =SYS_ify(clone)
+ swi 0x0
+ cfi_endproc
+ cmp r0, #0
+ beq 1f
+ pop {r4, r7}
blt __error
IT(t, ne)
BXC(ne, lr)
+ cfi_startproc
+.fnend
+PSEUDO_END (__clone)
+
+1:
+ .fnstart
+ .cantunwind
+#ifdef RESET_PID
+ tst ip, #CLONE_THREAD
+ bne 3f
+ GET_TLS (lr)
+ mov r1, r0
+ tst ip, #CLONE_VM
+ ldr r7, =SYS_ify(getpid)
+ ite ne
+ movne r0, #-1
+ swieq 0x0
+ NEGOFF_ADJ_BASE (r1, TID_OFFSET)
+ str r0, NEGOFF_OFF1 (r1, TID_OFFSET)
+ str r0, NEGOFF_OFF2 (r1, PID_OFFSET, TID_OFFSET)
+3:
+#endif
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
mov lr, pc
diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h
index 019dc3762..7f1e9c1a9 100644
--- a/libc/sysdeps/linux/arm/sysdep.h
+++ b/libc/sysdeps/linux/arm/sysdep.h
@@ -205,6 +205,42 @@ __local_syscall_error: \
sees the right arguments.
*/
+#if __ARM_ARCH > 6 || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__)
+# define ARCH_HAS_HARD_TP
+#endif
+
+# ifdef __thumb2__
+# define NEGOFF_ADJ_BASE(R, OFF) add R, R, $OFF
+# define NEGOFF_ADJ_BASE2(D, S, OFF) add D, S, $OFF
+# define NEGOFF_OFF1(R, OFF) [R]
+# define NEGOFF_OFF2(R, OFFA, OFFB) [R, $((OFFA) - (OFFB))]
+# else
+# define NEGOFF_ADJ_BASE(R, OFF)
+# define NEGOFF_ADJ_BASE2(D, S, OFF) mov D, S
+# define NEGOFF_OFF1(R, OFF) [R, $OFF]
+# define NEGOFF_OFF2(R, OFFA, OFFB) [R, $OFFA]
+# endif
+
+# ifdef ARCH_HAS_HARD_TP
+/* If the cpu has cp15 available, use it. */
+# define GET_TLS(TMP) mrc p15, 0, r0, c13, c0, 3
+# else
+/* At this generic level we have no tricks to pull. Call the ABI routine. */
+# define GET_TLS(TMP) \
+ push { r1, r2, r3, lr }; \
+ cfi_remember_state; \
+ cfi_adjust_cfa_offset (16); \
+ cfi_rel_offset (r1, 0); \
+ cfi_rel_offset (r2, 4); \
+ cfi_rel_offset (r3, 8); \
+ cfi_rel_offset (lr, 12); \
+ bl __aeabi_read_tp; \
+ pop { r1, r2, r3, lr }; \
+ cfi_restore_state
+# endif /* ARCH_HAS_HARD_TP */
+
+
+
#undef DO_CALL
#if defined(__ARM_EABI__)
diff --git a/libc/sysdeps/linux/common/bits/mathcalls.h b/libc/sysdeps/linux/common/bits/mathcalls.h
index 9bebb5190..3d7e34fa2 100644
--- a/libc/sysdeps/linux/common/bits/mathcalls.h
+++ b/libc/sysdeps/linux/common/bits/mathcalls.h
@@ -291,7 +291,9 @@ __END_NAMESPACE_C99
#ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* True gamma function. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (tgamma,, (_Mdouble_))
+# endif
__END_NAMESPACE_C99
#endif
@@ -322,7 +324,9 @@ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__))
libm_hidden_proto(nextafterl)
# endif
# if defined __USE_ISOC99 && !defined __LDBL_COMPAT
+# ifndef _Mdouble_is_float_
__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__))
+# endif
# endif
/* Return the remainder of integer divison X / Y with infinite precision. */
@@ -339,11 +343,15 @@ __MATHDECLI (int,ilogb,, (_Mdouble_ __x))
#ifdef __USE_ISOC99
/* Return X times (2 to the Nth power). */
+# ifndef _Mdouble_is_float_
__MATHCALLI (scalbln,, (_Mdouble_ __x, long int __n))
+# endif
/* Round X to integral value in floating-point format using current
rounding direction, but do not raise inexact exception. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (nearbyint,, (_Mdouble_ __x))
+# endif
/* Round X to nearest integral value, rounding halfway cases away from
zero. */
@@ -356,7 +364,9 @@ __MATHCALLX (trunc,, (_Mdouble_ __x), (__const__))
/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
and magnitude congruent `mod 2^n' to the magnitude of the integral
quotient x/y, with n >= 3. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo))
+# endif
/* Conversion functions. */
@@ -373,13 +383,19 @@ __MATHDECLI (long long int,llround,, (_Mdouble_ __x))
/* Return positive difference between X and Y. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (fdim,, (_Mdouble_ __x, _Mdouble_ __y))
+# endif
/* Return maximum numeric value from X and Y. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (fmax,, (_Mdouble_ __x, _Mdouble_ __y))
+# endif
/* Return minimum numeric value from X and Y. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (fmin,, (_Mdouble_ __x, _Mdouble_ __y))
+# endif
/* Classify given number. */
@@ -390,7 +406,9 @@ __MATHDECL_PRIV (int, signbit,, (_Mdouble_ __value), (__const__))
/* Multiply-add function computed as a ternary operation. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z))
+# endif
#endif /* Use ISO C99. */
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
diff --git a/libc/sysdeps/linux/common/bits/uClibc_fpmax.h b/libc/sysdeps/linux/common/bits/uClibc_fpmax.h
index bbea1ae9d..b7dcee1d3 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_fpmax.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_fpmax.h
@@ -68,10 +68,6 @@ typedef float __fpmax_t;
#ifndef DECIMAL_DIG
-#ifdef L___strtofpmax
-/* Emit warning only once. */
-#warning DECIMAL_DIG is not defined! If you are using gcc, it may not be defining __STDC_VERSION__ as it should.
-#endif
#if !defined(FLT_RADIX) || (FLT_RADIX != 2)
#error unable to compensate for missing DECIMAL_DIG!
#endif
diff --git a/libc/sysdeps/linux/common/fstatat64.c b/libc/sysdeps/linux/common/fstatat64.c
index 015f57d13..711521a6a 100644
--- a/libc/sysdeps/linux/common/fstatat64.c
+++ b/libc/sysdeps/linux/common/fstatat64.c
@@ -10,10 +10,18 @@
#include <bits/wordsize.h>
#include <sys/syscall.h>
+#if defined __mips__
+# include <sgidefs.h>
+#endif
+
/* 64bit ports tend to favor newfstatat() */
#if __WORDSIZE == 64 && defined __NR_newfstatat
# define __NR_fstatat64 __NR_newfstatat
#endif
+/* mips N32 ABI use newfstatat(), too */
+#if defined __mips__ && _MIPS_SIM == _ABIN32
+# define __NR_fstatat64 __NR_newfstatat
+#endif
#ifdef __NR_fstatat64
# include <sys/stat.h>
diff --git a/libc/sysdeps/linux/common/setregid.c b/libc/sysdeps/linux/common/setregid.c
index 15d590a68..aaa729379 100644
--- a/libc/sysdeps/linux/common/setregid.c
+++ b/libc/sysdeps/linux/common/setregid.c
@@ -37,4 +37,4 @@ int setregid(gid_t rgid, gid_t egid)
}
#endif
-libc_hidden_def(setregid)
+libc_hidden_weak(setregid)
diff --git a/libc/sysdeps/linux/common/setresgid.c b/libc/sysdeps/linux/common/setresgid.c
index 95decc29e..b6d1647db 100644
--- a/libc/sysdeps/linux/common/setresgid.c
+++ b/libc/sysdeps/linux/common/setresgid.c
@@ -16,7 +16,7 @@
# define __NR_setresgid __NR_setresgid32
_syscall3(int, setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid)
-libc_hidden_def(setresgid)
+libc_hidden_weak(setresgid)
#elif defined(__NR_setresgid)
@@ -34,7 +34,7 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
}
return (__syscall_setresgid(rgid, egid, sgid));
}
-libc_hidden_def(setresgid)
+libc_hidden_weak(setresgid)
#endif
diff --git a/libc/sysdeps/linux/common/setresuid.c b/libc/sysdeps/linux/common/setresuid.c
index 022ccfe64..a2a218332 100644
--- a/libc/sysdeps/linux/common/setresuid.c
+++ b/libc/sysdeps/linux/common/setresuid.c
@@ -16,7 +16,7 @@
# define __NR_setresuid __NR_setresuid32
_syscall3(int, setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
-libc_hidden_def(setresuid)
+libc_hidden_weak(setresuid)
#elif defined(__NR_setresuid)
@@ -34,7 +34,7 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid)
}
return (__syscall_setresuid(ruid, euid, suid));
}
-libc_hidden_def(setresuid)
+libc_hidden_weak(setresuid)
#endif
diff --git a/libc/sysdeps/linux/common/setreuid.c b/libc/sysdeps/linux/common/setreuid.c
index a9eea6dc4..583a987c0 100644
--- a/libc/sysdeps/linux/common/setreuid.c
+++ b/libc/sysdeps/linux/common/setreuid.c
@@ -37,4 +37,4 @@ int setreuid(uid_t ruid, uid_t euid)
}
#endif
-libc_hidden_def(setreuid)
+libc_hidden_weak(setreuid)
diff --git a/libc/sysdeps/linux/common/sync_file_range.c b/libc/sysdeps/linux/common/sync_file_range.c
index db797de62..52bc9d7af 100644
--- a/libc/sysdeps/linux/common/sync_file_range.c
+++ b/libc/sysdeps/linux/common/sync_file_range.c
@@ -24,6 +24,9 @@ static int __NC(sync_file_range)(int fd, off64_t offset, off64_t nbytes, unsigne
{
# if defined __powerpc__ && __WORDSIZE == 64
return INLINE_SYSCALL(sync_file_range, 4, fd, flags, offset, nbytes);
+# elif defined __arm__ && defined __thumb__
+ return INLINE_SYSCALL(sync_file_range, 6, fd,
+ OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags);
# elif (defined __mips__ && _MIPS_SIM == _ABIO32) || \
(defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) && !(defined(__powerpc__) || defined(__xtensa__)))
/* arch with 64-bit data in even reg alignment #2: [arcv2/others-in-future]
diff --git a/libc/sysdeps/linux/common/utime.c b/libc/sysdeps/linux/common/utime.c
index 886d23a49..a2ce8a5d5 100644
--- a/libc/sysdeps/linux/common/utime.c
+++ b/libc/sysdeps/linux/common/utime.c
@@ -54,6 +54,5 @@ int utime(const char *file, const struct utimbuf *times)
#if (defined __NR_utimensat && !defined __NR_utime) || \
defined __NR_utime || defined __NR_utimes
-link_warning(utime, "the use of OBSOLESCENT `utime' is discouraged, use `utimes'")
libc_hidden_def(utime)
#endif
diff --git a/libc/sysdeps/linux/common/xstatconv.c b/libc/sysdeps/linux/common/xstatconv.c
index 7edc42a81..a21579c41 100644
--- a/libc/sysdeps/linux/common/xstatconv.c
+++ b/libc/sysdeps/linux/common/xstatconv.c
@@ -37,9 +37,12 @@ void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
- buf->st_atim = kbuf->st_atim;
- buf->st_mtim = kbuf->st_mtim;
- buf->st_ctim = kbuf->st_ctim;
+ buf->st_atim.tv_sec = kbuf->st_atim.tv_sec;
+ buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec;
+ buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec;
+ buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec;
+ buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec;
+ buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec;
}
void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf)
@@ -56,9 +59,12 @@ void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf)
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
- buf->st_atim = kbuf->st_atim;
- buf->st_mtim = kbuf->st_mtim;
- buf->st_ctim = kbuf->st_ctim;
+ buf->st_atim.tv_sec = kbuf->st_atim.tv_sec;
+ buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec;
+ buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec;
+ buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec;
+ buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec;
+ buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec;
}
#ifdef __UCLIBC_HAS_LFS__
@@ -80,9 +86,12 @@ void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf)
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
- buf->st_atim = kbuf->st_atim;
- buf->st_mtim = kbuf->st_mtim;
- buf->st_ctim = kbuf->st_ctim;
+ buf->st_atim.tv_sec = kbuf->st_atim.tv_sec;
+ buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec;
+ buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec;
+ buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec;
+ buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec;
+ buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec;
}
#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/libc/sysdeps/linux/cris/sys/procfs.h b/libc/sysdeps/linux/cris/sys/procfs.h
index d4ee05134..65b57ba4e 100644
--- a/libc/sysdeps/linux/cris/sys/procfs.h
+++ b/libc/sysdeps/linux/cris/sys/procfs.h
@@ -28,10 +28,14 @@
#include <sys/types.h>
#include <sys/ucontext.h>
#include <sys/user.h>
-#include <asm/elf.h>
__BEGIN_DECLS
+typedef unsigned long elf_greg_t;
+
+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
struct elf_siginfo
{
int si_signo; /* Signal number. */
diff --git a/libc/sysdeps/linux/cris/sysdep.S b/libc/sysdeps/linux/cris/sysdep.S
index 8f25fb722..a23bb260f 100644
--- a/libc/sysdeps/linux/cris/sysdep.S
+++ b/libc/sysdeps/linux/cris/sysdep.S
@@ -35,7 +35,7 @@ ENTRY (__syscall_error)
/* Note that __syscall_error is only visible within this library,
and no-one passes it on as a pointer, so can assume that R0 (GOT
pointer) is correctly set up. */
- PLTCALL (HIDDEN_JUMPTARGET(__errno_location))
+ PLTCALL (__errno_location)
move [sp+],srp
move.d [sp+],r11
diff --git a/libc/sysdeps/linux/m68k/sys/reg.h b/libc/sysdeps/linux/m68k/sys/reg.h
deleted file mode 100644
index 984898100..000000000
--- a/libc/sysdeps/linux/m68k/sys/reg.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_REG_H
-#define _SYS_REG_H 1
-
-/* Index into an array of 4 byte integers returned from ptrace for
- location of the users' stored general purpose registers. */
-
-enum
-{
- PT_D1 = 0,
-#define PT_D1 PT_D1
- PT_D2 = 1,
-#define PT_D2 PT_D2
- PT_D3 = 2,
-#define PT_D3 PT_D3
- PT_D4 = 3,
-#define PT_D4 PT_D4
- PT_D5 = 4,
-#define PT_D5 PT_D5
- PT_D6 = 5,
-#define PT_D6 PT_D6
- PT_D7 = 6,
-#define PT_D7 PT_D7
- PT_A0 = 7,
-#define PT_A0 PT_A0
- PT_A1 = 8,
-#define PT_A1 PT_A1
- PT_A2 = 9,
-#define PT_A2 PT_A2
- PT_A3 = 10,
-#define PT_A3 PT_A3
- PT_A4 = 11,
-#define PT_A4 PT_A4
- PT_A5 = 12,
-#define PT_A5 PT_A5
- PT_A6 = 13,
-#define PT_A6 PT_A6
- PT_D0 = 14,
-#define PT_D0 PT_D0
- PT_USP = 15,
-#define PT_USP PT_USP
- PT_ORIG_D0 = 16,
-#define PT_ORIG_D0 PT_ORIG_D0
- PT_SR = 17,
-#define PT_SR PT_SR
- PT_PC = 18,
-#define PT_PC PT_PC
- PT_FP0 = 21,
-#define PT_FP0 PT_FP0
- PT_FP1 = 24,
-#define PT_FP1 PT_FP1
- PT_FP2 = 27,
-#define PT_FP2 PT_FP2
- PT_FP3 = 30,
-#define PT_FP3 PT_FP3
- PT_FP4 = 33,
-#define PT_FP4 PT_FP4
- PT_FP5 = 36,
-#define PT_FP5 PT_FP5
- PT_FP6 = 39,
-#define PT_FP6 PT_FP6
- PT_FP7 = 42,
-#define PT_FP7 PT_FP7
- PT_FPCR = 45,
-#define PT_FPCR PT_FPCR
- PT_FPSR = 46,
-#define PT_FPSR PT_FPSR
- PT_FPIAR = 47
-#define PT_FPIAR PT_FPIAR
-};
-
-#endif /* _SYS_REG_H */
diff --git a/libc/sysdeps/linux/microblaze/bits/uClibc_page.h b/libc/sysdeps/linux/microblaze/bits/uClibc_page.h
index 8069e6afb..9335d8eb7 100644
--- a/libc/sysdeps/linux/microblaze/bits/uClibc_page.h
+++ b/libc/sysdeps/linux/microblaze/bits/uClibc_page.h
@@ -20,7 +20,7 @@
#ifndef _UCLIBC_PAGE_H
#define _UCLIBC_PAGE_H
-#include <linux/autoconf.h>
+#include <generated/autoconf.h>
#if defined(CONFIG_MICROBLAZE_32K_PAGES)
#define PAGE_SHIFT 15
diff --git a/libc/sysdeps/linux/mips/bits/kernel_stat.h b/libc/sysdeps/linux/mips/bits/kernel_stat.h
index 655c089e0..a2a6169a3 100644
--- a/libc/sysdeps/linux/mips/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/mips/bits/kernel_stat.h
@@ -8,6 +8,18 @@
#include <sgidefs.h>
#if _MIPS_SIM == _MIPS_SIM_ABI64
+typedef struct {
+ unsigned int tv_sec;
+ unsigned int tv_nsec;
+} __ktimespec_t;
+#else
+typedef struct {
+ time_t tv_sec;
+ unsigned long tv_nsec;
+} __ktimespec_t;
+#endif
+
+#if _MIPS_SIM == _MIPS_SIM_ABI64
/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
struct kernel_stat {
__kernel_dev_t st_dev;
@@ -20,9 +32,9 @@ struct kernel_stat {
__kernel_dev_t st_rdev;
unsigned int st_pad2[3];
__kernel_off_t st_size;
- struct timespec st_atim;
- struct timespec st_mtim;
- struct timespec st_ctim;
+ __ktimespec_t st_atim;
+ __ktimespec_t st_mtim;
+ __ktimespec_t st_ctim;
unsigned int st_blksize;
unsigned int reserved3;
unsigned long st_blocks;
@@ -41,9 +53,9 @@ struct kernel_stat {
unsigned int st_rdev;
unsigned int st_pad2[3];
unsigned long long st_size;
- struct timespec st_atim;
- struct timespec st_mtim;
- struct timespec st_ctim;
+ __ktimespec_t st_atim;
+ __ktimespec_t st_mtim;
+ __ktimespec_t st_ctim;
unsigned int st_blksize;
unsigned int reserved3;
unsigned long long st_blocks;
@@ -62,9 +74,9 @@ struct kernel_stat {
long st_pad2[2];
__kernel_off_t st_size;
long st_pad3;
- struct timespec st_atim;
- struct timespec st_mtim;
- struct timespec st_ctim;
+ __ktimespec_t st_atim;
+ __ktimespec_t st_mtim;
+ __ktimespec_t st_ctim;
long st_blksize;
long st_blocks;
long st_pad4[14];
@@ -81,9 +93,9 @@ struct kernel_stat64 {
unsigned long st_rdev;
unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
long long st_size;
- struct timespec st_atim;
- struct timespec st_mtim;
- struct timespec st_ctim;
+ __ktimespec_t st_atim;
+ __ktimespec_t st_mtim;
+ __ktimespec_t st_ctim;
unsigned long st_blksize;
unsigned long st_pad2;
long long st_blocks;
diff --git a/libc/sysdeps/linux/xtensa/Makefile.arch b/libc/sysdeps/linux/xtensa/Makefile.arch
index 277a1e325..b9b6b87d5 100644
--- a/libc/sysdeps/linux/xtensa/Makefile.arch
+++ b/libc/sysdeps/linux/xtensa/Makefile.arch
@@ -5,7 +5,10 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC-y := brk.c fork.c sigaction.c __syscall_error.c
+CSRC-y := brk.c sigaction.c __syscall_error.c
SSRC-y := bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S \
sigrestorer.S syscall.S mmap.S windowspill.S __longjmp.S vfork.S
+
+CSRC-$(if $(UCLIBC_HAS_THREADS_NATIVE),,y) += fork.c
+SSRC-$(if $(UCLIBC_HAS_THREADS_NATIVE),,y) += clone.S
diff --git a/libc/sysdeps/linux/xtensa/clone.S b/libc/sysdeps/linux/xtensa/clone.S
index aa79aa736..34d68a875 100644
--- a/libc/sysdeps/linux/xtensa/clone.S
+++ b/libc/sysdeps/linux/xtensa/clone.S
@@ -1,34 +1,38 @@
-/* Copyright (C) 2001, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2005 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ Library General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* clone is even more special than fork as it mucks with stacks
- and invokes a function in the right context after it's all over. */
+ and invokes a function in the right context after its all over. */
-#include "sysdep.h"
-#include <sys/syscall.h>
+#include <features.h>
+#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
+#ifdef RESET_PID
+#include <tls.h>
+#endif
+#define __ASSEMBLY__
+#include <linux/sched.h&