tags 357468 + patch
severity 357468 important
retitle 357468 please support mips/mipsel
thanks

* Martin Michlmayr <[EMAIL PROTECTED]> [2006-03-17 14:55]:
> > syscall.c:66:2: error: #error "Add syscalls for your architecture or update 
> > kernel headers"
> > syscall.c: In function 'migrate_pages':
> > syscall.c:151: error: '__NR_migrate_pages' undeclared (first use in this 
> > function)
> > syscall.c:151: error: (Each undeclared identifier is reported only once

Here's a patch to support MIPS O32:

--- syscall.c~  2006-03-25 14:21:34.000000000 +0000
+++ syscall.c   2006-03-25 14:33:15.000000000 +0000
@@ -62,6 +62,17 @@
 #define __NR_set_mempolicy 261
 #define __NR_migrate_pages 280
 
+#elif defined(__mips__)
+
+/*
+ * Linux o32 style syscalls are in the range from 4000 to 4999.
+ */
+#define __NR_Linux 4000
+#define __NR_mbind (__NR_Linux + 268)
+#define __NR_get_mempolicy (__NR_Linux + 269)
+#define __NR_set_mempolicy (__NR_Linux + 270)
+#define __NR_migrate_pages (__NR_Linux + 287)
+
 #elif !defined(DEPS_RUN)
 #error "Add syscalls for your architecture or update kernel headers"
 #endif


But now I get:

| cc   numactl.o util.o shm.o bitops.o libnuma.so   -o numactl
| libnuma.so: undefined reference to `__tls_get_addr'

How do I find out where that gets pulled in from?  Nothing the source
references it directly.


Thiemo, I suppose supporting O32 is a start, but I guess a more
correct patch would be the following.  Can you confirm this?


--- syscall.c~  2006-03-25 14:21:34.000000000 +0000
+++ syscall.c   2006-03-25 14:32:12.000000000 +0000
@@ -62,6 +62,41 @@
 #define __NR_set_mempolicy 261
 #define __NR_migrate_pages 280
 
+#elif defined(__mips__)
+
+#if _MIPS_SIM == _ABIO32
+/*
+ * Linux o32 style syscalls are in the range from 4000 to 4999.
+ */
+#define __NR_Linux 4000
+#define __NR_mbind (__NR_Linux + 268)
+#define __NR_get_mempolicy (__NR_Linux + 269)
+#define __NR_set_mempolicy (__NR_Linux + 270)
+#define __NR_migrate_pages (__NR_Linux + 287)
+#endif
+
+#if _MIPS_SIM == _ABI64
+/*
+ * Linux 64-bit syscalls are in the range from 5000 to 5999.
+ */
+#define __NR_Linux 5000
+#define __NR_mbind (__NR_Linux + 227)
+#define __NR_get_mempolicy (__NR_Linux + 228)
+#define __NR_set_mempolicy (__NR_Linux + 229)
+#define __NR_migrate_pages (__NR_Linux + 246)
+#endif
+
+#if _MIPS_SIM == _NABI32
+/*
+ * Linux N32 syscalls are in the range from 6000 to 6999.
+ */
+#define __NR_Linux 6000
+#define __NR_mbind (__NR_Linux + 231)
+#define __NR_get_mempolicy (__NR_Linux + 232)
+#define __NR_set_mempolicy (__NR_Linux + 233)
+#define __NR_migrate_pages (__NR_Linux + 250)
+#endif
+
 #elif !defined(DEPS_RUN)
 #error "Add syscalls for your architecture or update kernel headers"
 #endif


-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to