]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/um/sys-x86_64/user-offsets.c
uml: don't use glibc asm/user.h
[karo-tx-linux.git] / arch / um / sys-x86_64 / user-offsets.c
index 5a585bfbb8c2148101f1195be7b70cdf6f054e5b..f1ef2a8dfbc69b06b51b709f270a728589588f1e 100644 (file)
@@ -1,17 +1,12 @@
 #include <stdio.h>
 #include <stddef.h>
 #include <signal.h>
+#include <sys/poll.h>
+#include <sys/mman.h>
+#include <sys/user.h>
 #define __FRAME_OFFSETS
 #include <asm/ptrace.h>
 #include <asm/types.h>
-/* For some reason, x86_64 defines u64 and u32 only in <pci/types.h>, which I
- * refuse to include here, even though they're used throughout the headers.
- * These are used in asm/user.h, and that include can't be avoided because of
- * the sizeof(struct user_regs_struct) below.
- */
-typedef __u64 u64;
-typedef __u32 u32;
-#include <asm/user.h>
 
 #define DEFINE(sym, val) \
         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -56,8 +51,7 @@ void foo(void)
        OFFSET(HOST_SC_SS, sigcontext, ss);
 #endif
 
-       DEFINE_LONGS(HOST_FRAME_SIZE, FRAME_SIZE);
-       DEFINE(HOST_FP_SIZE, 0);
+       DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long));
        DEFINE(HOST_XFP_SIZE, 0);
        DEFINE_LONGS(HOST_RBX, RBX);
        DEFINE_LONGS(HOST_RCX, RCX);
@@ -88,4 +82,13 @@ void foo(void)
        DEFINE_LONGS(HOST_IP, RIP);
        DEFINE_LONGS(HOST_SP, RSP);
        DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
+
+       /* XXX Duplicated between i386 and x86_64 */
+       DEFINE(UM_POLLIN, POLLIN);
+       DEFINE(UM_POLLPRI, POLLPRI);
+       DEFINE(UM_POLLOUT, POLLOUT);
+
+       DEFINE(UM_PROT_READ, PROT_READ);
+       DEFINE(UM_PROT_WRITE, PROT_WRITE);
+       DEFINE(UM_PROT_EXEC, PROT_EXEC);
 }