x86_64: move boot

2007-10-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9e9b4573e4411ac5fcfb6ba04ad360d3de6414ba
Commit: 9e9b4573e4411ac5fcfb6ba04ad360d3de6414ba
Parent: aadfb679c8eb9b83125833f03b5221889595b67c
Author: Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 11 11:17:15 2007 +0200
Committer:  Thomas Gleixner <[EMAIL PROTECTED]>
CommitDate: Thu Oct 11 11:17:15 2007 +0200

x86_64: move boot

Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 arch/x86/boot/compressed/Makefile  |2 +-
 arch/x86/boot/compressed/Makefile_64   |   30 +++
 arch/x86/boot/compressed/head_64.S |  311 +++
 arch/x86/boot/compressed/misc_64.c |  371 
 arch/x86/boot/compressed/vmlinux_64.lds|   44 
 arch/x86/boot/compressed/vmlinux_64.scr|   10 +
 arch/x86_64/boot/compressed/Makefile   |5 -
 arch/x86_64/boot/compressed/Makefile_64|   30 ---
 arch/x86_64/boot/compressed/head_64.S  |  311 ---
 arch/x86_64/boot/compressed/misc_64.c  |  371 
 arch/x86_64/boot/compressed/vmlinux_64.lds |   44 
 arch/x86_64/boot/compressed/vmlinux_64.scr |   10 -
 12 files changed, 767 insertions(+), 772 deletions(-)

diff --git a/arch/x86/boot/compressed/Makefile 
b/arch/x86/boot/compressed/Makefile
index 76ab5ca..52c1db8 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -1,5 +1,5 @@
 ifeq ($(CONFIG_X86_32),y)
 include ${srctree}/arch/x86/boot/compressed/Makefile_32
 else
-include ${srctree}/arch/x86_64/boot/compressed/Makefile_64
+include ${srctree}/arch/x86/boot/compressed/Makefile_64
 endif
diff --git a/arch/x86/boot/compressed/Makefile_64 
b/arch/x86/boot/compressed/Makefile_64
new file mode 100644
index 000..dc6b338
--- /dev/null
+++ b/arch/x86/boot/compressed/Makefile_64
@@ -0,0 +1,30 @@
+#
+# linux/arch/x86/boot/compressed/Makefile
+#
+# create a compressed vmlinux image from the original vmlinux
+#
+
+targets:= vmlinux vmlinux.bin vmlinux.bin.gz head_64.o 
misc_64.o piggy.o
+
+CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2  \
+ -fno-strict-aliasing -fPIC -mcmodel=small \
+  $(call cc-option, -ffreestanding) \
+  $(call cc-option, -fno-stack-protector)
+AFLAGS  := $(CFLAGS) -D__ASSEMBLY__
+LDFLAGS := -m elf_x86_64
+
+LDFLAGS_vmlinux := -T
+$(obj)/vmlinux: $(src)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o 
$(obj)/piggy.o FORCE
+   $(call if_changed,ld)
+   @:
+
+$(obj)/vmlinux.bin: vmlinux FORCE
+   $(call if_changed,objcopy)
+
+$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
+   $(call if_changed,gzip)
+
+LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T
+
+$(obj)/piggy.o: $(obj)/vmlinux_64.scr $(obj)/vmlinux.bin.gz FORCE
+   $(call if_changed,ld)
diff --git a/arch/x86/boot/compressed/head_64.S 
b/arch/x86/boot/compressed/head_64.S
new file mode 100644
index 000..cff3d1d
--- /dev/null
+++ b/arch/x86/boot/compressed/head_64.S
@@ -0,0 +1,311 @@
+/*
+ *  linux/boot/head.S
+ *
+ *  Copyright (C) 1991, 1992, 1993  Linus Torvalds
+ */
+
+/*
+ *  head.S contains the 32-bit startup code.
+ *
+ * NOTE!!! Startup happens at absolute address 0x1000, which is also where
+ * the page directory will exist. The startup code will be overwritten by
+ * the page directory. [According to comments etc elsewhere on a compressed
+ * kernel it will end up at 0x1000 + 1Mb I hope so as I assume this. - AC]
+ *
+ * Page 0 is deliberately kept safe, since System Management Mode code in 
+ * laptops may need to access the BIOS data stored there.  This is also
+ * useful for future device drivers that either access the BIOS via VM86 
+ * mode.
+ */
+
+/*
+ * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
+ */
+.code32
+.text
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+.section ".text.head"
+   .code32
+   .globl startup_32
+
+startup_32:
+   cld
+   cli
+   movl$(__KERNEL_DS), %eax
+   movl%eax, %ds
+   movl%eax, %es
+   movl%eax, %ss
+
+/* Calculate the delta between where we were compiled to run
+ * at and where we were actually loaded at.  This can only be done
+ * with a short local call on x86.  Nothing  else will tell us what
+ * address we are running at.  The reserved chunk of the real-mode
+ * data at 0x1e4 (defined as a scratch field) are used as the stack
+ * for this calculation. Only 4 bytes are needed.
+ */
+   leal(0x1e4+4)(%esi), %esp
+   call1f
+1: popl%ebp
+   subl$1b, %ebp
+
+/* setup a stack and make sure cpu supports long mode. */
+   movl$user_stack_end, %eax
+   addl%e

x86_64: move boot

2007-10-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2a6c8d5a7e92a3e8db30fa0c5956a29c79d7e5a3
Commit: 2a6c8d5a7e92a3e8db30fa0c5956a29c79d7e5a3
Parent: 9e9b4573e4411ac5fcfb6ba04ad360d3de6414ba
Author: Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 11 11:17:16 2007 +0200
Committer:  Thomas Gleixner <[EMAIL PROTECTED]>
CommitDate: Thu Oct 11 11:17:16 2007 +0200

x86_64: move boot

Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 arch/x86_64/Makefile|7 +--
 arch/x86_64/boot/.gitignore |5 -
 arch/x86_64/boot/Makefile   |9 -
 3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index c10c823..11ef2c3 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -82,7 +82,7 @@ core-$(CONFIG_IA32_EMULATION) += arch/x86_64/ia32/
 drivers-$(CONFIG_PCI)  += arch/x86/pci/
 drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
 
-boot := arch/x86_64/boot
+boot := arch/x86/boot
 
 PHONY += bzImage bzlilo install archmrproper \
 fdimage fdimage144 fdimage288 isoimage archclean
@@ -90,10 +90,12 @@ PHONY += bzImage bzlilo install archmrproper \
 #Default target when executing "make"
 all: bzImage
 
-BOOTIMAGE := arch/x86_64/boot/bzImage
+BOOTIMAGE := arch/x86/boot/bzImage
 KBUILD_IMAGE  := $(BOOTIMAGE)
 
 bzImage: vmlinux
+   $(Q)mkdir -p $(objtree)/arch/x86_64/boot
+   $(Q)ln -fsn $(objtree)/arch/x86/boot/bzImage 
$(objtree)/arch/x86_64/boot/bzImage
$(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE)
 
 bzlilo: vmlinux
@@ -109,6 +111,7 @@ install:
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 
 
 archclean:
+   $(Q)rm -rf $(objtree)/arch/x86_64/boot
$(Q)$(MAKE) $(clean)=$(boot)
 
 define archhelp
diff --git a/arch/x86_64/boot/.gitignore b/arch/x86_64/boot/.gitignore
deleted file mode 100644
index 1846514..000
--- a/arch/x86_64/boot/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bootsect
-bzImage
-setup
-setup.bin
-setup.elf
diff --git a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile
deleted file mode 100644
index 0f7b6c2..000
--- a/arch/x86_64/boot/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# arch/x86_64/boot/Makefile
-#
-# The actual boot code is shared with i386 including the Makefile.
-# So tell kbuild that we fetch the code from i386 and include the
-# Makefile from i386 too.
-
-src := arch/x86/boot
-include $(src)/Makefile
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: move boot

2007-10-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aadfb679c8eb9b83125833f03b5221889595b67c
Commit: aadfb679c8eb9b83125833f03b5221889595b67c
Parent: f68c065491ceda1ad00f8dc493e274a79b8c2ba4
Author: Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 11 11:17:13 2007 +0200
Committer:  Thomas Gleixner <[EMAIL PROTECTED]>
CommitDate: Thu Oct 11 11:17:13 2007 +0200

x86_64: move boot

Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 arch/x86_64/boot/tools/.gitignore |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/x86_64/boot/tools/.gitignore 
b/arch/x86_64/boot/tools/.gitignore
deleted file mode 100644
index 378eac2..000
--- a/arch/x86_64/boot/tools/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-build
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html