summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-01-19 10:02:23 +0000
committerMike Frysinger <vapier@gentoo.org>2006-01-19 10:02:23 +0000
commit537494b031b3df4d4861fd83c90302d8d2d9d821 (patch)
treeafd78f28cd113e340ecf5268a8db01e4b2da54dc /libc/sysdeps/linux/common
parentb83bc367b70aec3c94e85183844a465169cbd333 (diff)
move a bunch of arch-specific checks out of common files and into an arch specific header file to make porting/updates a lot easier
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_arch_features.h36
-rw-r--r--libc/sysdeps/linux/common/create_module.c7
-rw-r--r--libc/sysdeps/linux/common/ftruncate64.c4
-rw-r--r--libc/sysdeps/linux/common/truncate64.c4
4 files changed, 42 insertions, 9 deletions
diff --git a/libc/sysdeps/linux/common/bits/uClibc_arch_features.h b/libc/sysdeps/linux/common/bits/uClibc_arch_features.h
new file mode 100644
index 000000000..5e513bff0
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/uClibc_arch_features.h
@@ -0,0 +1,36 @@
+/*
+ * Track misc arch-specific features that aren't config options
+ */
+
+#ifndef _BITS_UCLIBC_ARCH_FEATURES_H
+#define _BITS_UCLIBC_ARCH_FEATURES_H
+
+#error "You should copy this to your arch/bits/ dir and customize"
+
+/* instruction used when calling abort() to kill yourself */
+/*#define __UCLIBC_ABORT_INSTRUCTION__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* 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__
+
+/* does your target prefix all symbols with an _ ? */
+#define __UCLIBC_NO_UNDERSCORES__
+
+/* does your target have an asm .set ? */
+#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
+
+/* shouldn't need to change these ... */
+#define __UCLIBC_ASM_GLOBAL_DIRECTIVE__
+#define __UCLIBC_ASM_TYPE_DIRECTIVE_PREFIX__
+#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
+#define __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
+#define __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c
index 7bd38a39c..461ba5bc5 100644
--- a/libc/sysdeps/linux/common/create_module.c
+++ b/libc/sysdeps/linux/common/create_module.c
@@ -13,11 +13,8 @@
#ifdef __NR_create_module
-#if defined(__i386__) || defined(__m68k__) || defined(__arm__) || defined(__thumb__) || defined(__cris__) || defined(__i960__)
+#if defined(__UCLIBC_BROKEN_CREATE_MODULE__)
# define __NR___create_module __NR_create_module
-# ifdef __STR_NR_create_module
-# define __STR_NR___create_module __STR_NR_create_module
-# endif
static inline _syscall2(long, __create_module, const char *, name, size_t, size);
/* By checking the value of errno, we know if we have been fooled
* by the syscall2 macro making a very high address look like a
@@ -33,7 +30,7 @@ unsigned long create_module(const char *name, size_t size)
}
return ret;
}
-#elif defined(__alpha__)
+#elif defined(__UCLIBC_SLIGHTLY_BROKEN_CREATE_MODULE__)
# define __NR___create_module __NR_create_module
/* Alpha doesn't have the same problem, exactly, but a bug in older
kernels fails to clear the error flag. Clear it here explicitly. */
diff --git a/libc/sysdeps/linux/common/ftruncate64.c b/libc/sysdeps/linux/common/ftruncate64.c
index ff732d432..cea9bc1bc 100644
--- a/libc/sysdeps/linux/common/ftruncate64.c
+++ b/libc/sysdeps/linux/common/ftruncate64.c
@@ -35,7 +35,7 @@ _syscall2(int, ftruncate64, int, fd, __off64_t, length);
# ifndef INLINE_SYSCALL
# define INLINE_SYSCALL(name, nr, args...) __syscall_ftruncate64 (args)
# define __NR___syscall_ftruncate64 __NR_ftruncate64
-# if defined(__powerpc__) || defined(__mips__)
+# if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__)
static inline _syscall4(int, __syscall_ftruncate64, int, fd, uint32_t, pad,
unsigned long, high_length, unsigned long, low_length);
# else
@@ -49,7 +49,7 @@ int ftruncate64 (int fd, __off64_t length)
{
uint32_t low = length & 0xffffffff;
uint32_t high = length >> 32;
-# if defined(__powerpc__) || defined(__mips__)
+# if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__)
return INLINE_SYSCALL(ftruncate64,
4, fd, 0, __LONG_LONG_PAIR (high, low));
# else
diff --git a/libc/sysdeps/linux/common/truncate64.c b/libc/sysdeps/linux/common/truncate64.c
index 59324fd3e..e227900c5 100644
--- a/libc/sysdeps/linux/common/truncate64.c
+++ b/libc/sysdeps/linux/common/truncate64.c
@@ -32,7 +32,7 @@ _syscall2(int, truncate64, const char *, path, __off64_t, length);
#ifndef INLINE_SYSCALL
#define INLINE_SYSCALL(name, nr, args...) __syscall_truncate64 (args)
#define __NR___syscall_truncate64 __NR_truncate64
-#if defined(__powerpc__) || defined(__mips__)
+#if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__)
static inline _syscall4(int, __syscall_truncate64, const char *, path,
uint32_t, pad, unsigned long, high_length, unsigned long, low_length);
#else
@@ -47,7 +47,7 @@ int truncate64 (const char * path, __off64_t length)
{
uint32_t low = length & 0xffffffff;
uint32_t high = length >> 32;
-#if defined(__powerpc__) || defined(__mips__)
+#if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__)
return INLINE_SYSCALL(truncate64, 4, path, 0,
__LONG_LONG_PAIR (high, low));
#else