summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/arc')
-rw-r--r--libc/sysdeps/linux/arc/Makefile.arch3
-rwxr-xr-xlibc/sysdeps/linux/arc/bits/uClibc_arch_features.h3
-rwxr-xr-xlibc/sysdeps/linux/arc/bits/uClibc_page.h17
-rw-r--r--libc/sysdeps/linux/arc/sigaction.c28
-rw-r--r--libc/sysdeps/linux/arc/sigrestorer.S21
5 files changed, 30 insertions, 42 deletions
diff --git a/libc/sysdeps/linux/arc/Makefile.arch b/libc/sysdeps/linux/arc/Makefile.arch
index 656ea3518..1a52fc9bf 100644
--- a/libc/sysdeps/linux/arc/Makefile.arch
+++ b/libc/sysdeps/linux/arc/Makefile.arch
@@ -7,5 +7,4 @@
CSRC-y := syscall.c sigaction.c __syscall_error.c cacheflush.c
-SSRC-y := sigrestorer.S __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
- vfork.S clone.S
+SSRC-y := __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S vfork.S clone.S
diff --git a/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h b/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h
index 9313ee8f2..8af6eca4c 100755
--- a/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h
@@ -17,9 +17,6 @@
/* can your target use syscall6() for mmap ? */
#undef __UCLIBC_MMAP_HAS_6_ARGS__
-/* does your target use syscall4() for truncate64 ? (32bit arches only) */
-#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
-
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
diff --git a/libc/sysdeps/linux/arc/bits/uClibc_page.h b/libc/sysdeps/linux/arc/bits/uClibc_page.h
index 26cec54c9..b05c57501 100755
--- a/libc/sysdeps/linux/arc/bits/uClibc_page.h
+++ b/libc/sysdeps/linux/arc/bits/uClibc_page.h
@@ -9,16 +9,25 @@
/*
* ARC700/linux supports 4k, 8k, 16k pages (build time).
- * We rely on the kernel exported header (aka uapi headers since 3.8)
- * for PAGE_SIZE and friends. This avoids hand-editing here when building
- * toolchain.
*
* Although uClibc determines page size dynamically, from kernel's auxv which
* ARC Linux does pass, still the generic code needs a fall back
* _dl_pagesize = auxvt[AT_PAGESZ].a_un.a_val ? : PAGE_SIZE
*
*/
-#include <asm/page.h>
+
+#include <features.h>
+
+#if defined(__CONFIG_ARC_PAGE_SIZE_16K__)
+#define PAGE_SHIFT 14
+#elif defined(__CONFIG_ARC_PAGE_SIZE_4K__)
+#define PAGE_SHIFT 12
+#else
+#define PAGE_SHIFT 13
+#endif
+
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
/* TBD: fix this with runtime value for a PAGE_SIZE agnostic uClibc */
#define MMAP2_PAGE_SHIFT PAGE_SHIFT
diff --git a/libc/sysdeps/linux/arc/sigaction.c b/libc/sysdeps/linux/arc/sigaction.c
index 73c496d2a..4a4c9e2d0 100644
--- a/libc/sysdeps/linux/arc/sigaction.c
+++ b/libc/sysdeps/linux/arc/sigaction.c
@@ -10,8 +10,13 @@
#include <sys/syscall.h>
#include <bits/kernel_sigaction.h>
-extern void __default_rt_sa_restorer(void);
-//libc_hidden_proto(__default_rt_sa_restorer);
+/*
+ * Default sigretrun stub if user doesn't specify SA_RESTORER
+ */
+static void __default_rt_sa_restorer(void)
+{
+ INTERNAL_SYSCALL_NCS(__NR_rt_sigreturn, , 0);
+}
#define SA_RESTORER 0x04000000
@@ -22,23 +27,22 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
{
struct sigaction kact;
- /* !act means caller only wants to know @oact
- * Hence only otherwise, do SA_RESTORER stuff
- *
- * For the normal/default cases (user not providing SA_RESTORER) use
- * a real sigreturn stub to avoid kernel synthesizing one on user stack
- * at runtime, which needs PTE permissions update (hence TLB entry
- * update) and costly cache line flushes for code modification
+ /*
+ * SA_RESTORER is only relevant for act != NULL case
+ * (!act means caller only wants to know @oact)
*/
if (act && !(act->sa_flags & SA_RESTORER)) {
- memcpy(&kact, act, sizeof(kact));
kact.sa_restorer = __default_rt_sa_restorer;
- kact.sa_flags |= SA_RESTORER;
+ kact.sa_flags = act->sa_flags | SA_RESTORER;
+
+ kact.sa_handler = act->sa_handler;
+ kact.sa_mask = act->sa_mask;
act = &kact;
}
- return __syscall_rt_sigaction(sig, act, oact, sizeof(act->sa_mask));
+ return INLINE_SYSCALL(rt_sigaction, 4,
+ sig, act, oact, sizeof(act->sa_mask));
}
#ifndef LIBC_SIGACTION
diff --git a/libc/sysdeps/linux/arc/sigrestorer.S b/libc/sysdeps/linux/arc/sigrestorer.S
deleted file mode 100644
index 24531d89d..000000000
--- a/libc/sysdeps/linux/arc/sigrestorer.S
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
- *
- * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
- */
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/*
- * Provide a real sigreturn stub to avoid kernel synthesizing one
- * on user stack at runtime, which needs PTE permissions update
- * (hence TLB entry update) and costly cache line flushes for
- * code modification
- */
-
-ENTRY(__default_rt_sa_restorer)
- mov r8, __NR_rt_sigreturn
- ARC_TRAP_INSN
-END(__default_rt_sa_restorer)
-libc_hidden_def(__default_rt_sa_restorer)