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