summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schaefer <frank.schaefer@tek.com>2008-12-30 23:41:58 +0100
committerChristoph Hellwig <hch@brick.lst.de>2008-12-30 23:41:58 +0100
commit696a59bb58fcbf8c9fd15dea8dc19f7544a2490c (patch)
tree8fcfcaa8a3d5017a51d0680197e99ce8d5810b4b
parentd7c50a07c78436bd19be0a061ab0fdd9cf66c4c2 (diff)
downloadattr-696a59bb58fcbf8c9fd15dea8dc19f7544a2490c.tar.gz
libattr currently defines extended-attribute syscalls based on architecture
macros predefined by gcc. However, it gets the architecture macro for mips64 wrong, it fails to differentiate between n32 and n64 mips64 ABIs, and furthermore uses the wrong offsets from the base syscall value for *any* mips64 architecture. This patch attempts to fix the syscall definitions for mips64. Reviewed-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--libattr/syscalls.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/libattr/syscalls.c b/libattr/syscalls.c
index 6ab0ca3..6291c23 100644
--- a/libattr/syscalls.c
+++ b/libattr/syscalls.c
@@ -127,22 +127,26 @@
# define __NR_removexattr (__NR_SYSCALL_BASE+235)
# define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
# define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
-#elif defined (__mips64__)
+#elif defined (__mips64)
# define HAVE_XATTR_SYSCALLS 1
-# define __NR_Linux 5000
-# define __NR_setxattr (__NR_Linux + 217)
-# define __NR_lsetxattr (__NR_Linux + 218)
-# define __NR_fsetxattr (__NR_Linux + 219)
-# define __NR_getxattr (__NR_Linux + 220)
-# define __NR_lgetxattr (__NR_Linux + 221)
-# define __NR_fgetxattr (__NR_Linux + 222)
-# define __NR_listxattr (__NR_Linux + 223)
-# define __NR_llistxattr (__NR_Linux + 224)
-# define __NR_flistxattr (__NR_Linux + 225)
-# define __NR_removexattr (__NR_Linux + 226)
-# define __NR_lremovexattr (__NR_Linux + 227)
-# define __NR_fremovexattr (__NR_Linux + 228)
-#elif defined (__mips__)
+# ifdef __LP64__ /* mips64 using n64 ABI */
+# define __NR_Linux 5000
+# else /* mips64 using n32 ABI */
+# define __NR_Linux 6000
+# endif
+# define __NR_setxattr (__NR_Linux + 180)
+# define __NR_lsetxattr (__NR_Linux + 181)
+# define __NR_fsetxattr (__NR_Linux + 182)
+# define __NR_getxattr (__NR_Linux + 183)
+# define __NR_lgetxattr (__NR_Linux + 184)
+# define __NR_fgetxattr (__NR_Linux + 185)
+# define __NR_listxattr (__NR_Linux + 186)
+# define __NR_llistxattr (__NR_Linux + 187)
+# define __NR_flistxattr (__NR_Linux + 188)
+# define __NR_removexattr (__NR_Linux + 189)
+# define __NR_lremovexattr (__NR_Linux + 190)
+# define __NR_fremovexattr (__NR_Linux + 191)
+#elif defined (__mips__) /* mips32, or mips64 using o32 ABI */
# define HAVE_XATTR_SYSCALLS 1
# define __NR_Linux 4000
# define __NR_setxattr (__NR_Linux + 224)