
From: Jeff Dike <jdike@addtoit.com>

Add a bunch of headers to include/asm-um to support x86_64.
Also move some arch-specific things from generic files to x86-specific ones.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/asm-um/archparam-i386.h   |    7 +++
 25-akpm/include/asm-um/archparam-x86_64.h |   62 ++++++++++++++++++++++++++++++
 25-akpm/include/asm-um/calling.h          |    9 ++++
 25-akpm/include/asm-um/dwarf2.h           |   11 +++++
 25-akpm/include/asm-um/elf.h              |    5 ++
 25-akpm/include/asm-um/fixmap.h           |    7 ---
 6 files changed, 94 insertions(+), 7 deletions(-)

diff -puN include/asm-um/archparam-i386.h~uml-x86-64-headers include/asm-um/archparam-i386.h
--- 25/include/asm-um/archparam-i386.h~uml-x86-64-headers	2005-01-09 23:44:11.116473528 -0800
+++ 25-akpm/include/asm-um/archparam-i386.h	2005-01-09 23:44:11.127471856 -0800
@@ -66,6 +66,13 @@ extern unsigned long __kernel_vsyscall;
 #define VSYSCALL_END vsyscall_end
 
 /*
+ * This is the range that is readable by user mode, and things
+ * acting like user mode such as get_user_pages.
+ */
+#define FIXADDR_USER_START      VSYSCALL_BASE
+#define FIXADDR_USER_END        VSYSCALL_END
+
+/*
  * Architecture-neutral AT_ values in 0-17, leave some room
  * for more of them, start the x86-specific ones at 32.
  */
diff -puN include/asm-um/archparam-x86_64.h~uml-x86-64-headers include/asm-um/archparam-x86_64.h
--- 25/include/asm-um/archparam-x86_64.h~uml-x86-64-headers	2005-01-09 23:44:11.117473376 -0800
+++ 25-akpm/include/asm-um/archparam-x86_64.h	2005-01-09 23:44:11.127471856 -0800
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2003 PathScale, Inc.
+ *
+ * Licensed under the GPL
+ */
+
+#ifndef __UM_ARCHPARAM_X86_64_H
+#define __UM_ARCHPARAM_X86_64_H
+
+#include <asm/user.h>
+
+#define ELF_PLATFORM "x86_64"
+
+#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
+
+typedef unsigned long elf_greg_t;
+typedef struct { } elf_fpregset_t;
+
+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+#define ELF_DATA        ELFDATA2LSB
+#define ELF_ARCH        EM_X86_64
+
+#define ELF_PLAT_INIT(regs, load_addr)    do { \
+	PT_REGS_RBX(regs) = 0; \
+	PT_REGS_RCX(regs) = 0; \
+	PT_REGS_RDX(regs) = 0; \
+	PT_REGS_RSI(regs) = 0; \
+	PT_REGS_RDI(regs) = 0; \
+	PT_REGS_RBP(regs) = 0; \
+	PT_REGS_RAX(regs) = 0; \
+	PT_REGS_R8(regs) = 0; \
+	PT_REGS_R9(regs) = 0; \
+	PT_REGS_R10(regs) = 0; \
+	PT_REGS_R11(regs) = 0; \
+	PT_REGS_R12(regs) = 0; \
+	PT_REGS_R13(regs) = 0; \
+	PT_REGS_R14(regs) = 0; \
+	PT_REGS_R15(regs) = 0; \
+} while (0)
+
+#ifdef TIF_IA32 /* XXX */
+        clear_thread_flag(TIF_IA32);
+#endif
+
+/* No user-accessible fixmap addresses, i.e. vsyscall */
+#define FIXADDR_USER_START	0
+#define FIXADDR_USER_END	0
+
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
diff -puN include/asm-um/calling.h~uml-x86-64-headers include/asm-um/calling.h
--- 25/include/asm-um/calling.h~uml-x86-64-headers	2005-01-09 23:44:11.119473072 -0800
+++ 25-akpm/include/asm-um/calling.h	2005-01-09 23:44:11.127471856 -0800
@@ -0,0 +1,9 @@
+# Copyright 2003 - 2004 Pathscale, Inc
+# Released under the GPL
+
+#ifndef __UM_CALLING_H /* XXX x86_64 */
+#define __UM_CALLING_H
+
+#include "asm/arch/calling.h"
+
+#endif
diff -puN include/asm-um/dwarf2.h~uml-x86-64-headers include/asm-um/dwarf2.h
--- 25/include/asm-um/dwarf2.h~uml-x86-64-headers	2005-01-09 23:44:11.120472920 -0800
+++ 25-akpm/include/asm-um/dwarf2.h	2005-01-09 23:44:11.128471704 -0800
@@ -0,0 +1,11 @@
+/* Copyright 2003 - 2004 Pathscale, Inc
+ * Released under the GPL
+ */
+
+/* Needed on x86_64 by thunk.S */
+#ifndef __UM_DWARF2_H
+#define __UM_DWARF2_H
+
+#include "asm/arch/dwarf2.h"
+
+#endif
diff -puN include/asm-um/elf.h~uml-x86-64-headers include/asm-um/elf.h
--- 25/include/asm-um/elf.h~uml-x86-64-headers	2005-01-09 23:44:11.121472768 -0800
+++ 25-akpm/include/asm-um/elf.h	2005-01-09 23:44:11.128471704 -0800
@@ -1,6 +1,7 @@
 #ifndef __UM_ELF_H
 #define __UM_ELF_H
 
+#include "linux/config.h"
 #include "asm/archparam.h"
 
 extern long elf_aux_hwcap;
@@ -12,7 +13,11 @@ extern long elf_aux_hwcap;
 
 #define elf_check_arch(x) (1)
 
+#ifdef CONFIG_64_BIT
+#define ELF_CLASS ELFCLASS64
+#else
 #define ELF_CLASS ELFCLASS32
+#endif
 
 #define USE_ELF_CORE_DUMP
 
diff -puN include/asm-um/fixmap.h~uml-x86-64-headers include/asm-um/fixmap.h
--- 25/include/asm-um/fixmap.h~uml-x86-64-headers	2005-01-09 23:44:11.123472464 -0800
+++ 25-akpm/include/asm-um/fixmap.h	2005-01-09 23:44:11.129471552 -0800
@@ -64,13 +64,6 @@ extern unsigned long get_kmem_end(void);
 #define __fix_to_virt(x)	(FIXADDR_TOP - ((x) << PAGE_SHIFT))
 #define __virt_to_fix(x)      ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
 
-/*
- * This is the range that is readable by user mode, and things
- * acting like user mode such as get_user_pages.
- */
-#define FIXADDR_USER_START	VSYSCALL_BASE
-#define FIXADDR_USER_END	VSYSCALL_END
-
 extern void __this_fixmap_does_not_exist(void);
 
 /*
_
