diff options
Diffstat (limited to 'arch/x86/boot')
| -rw-r--r-- | arch/x86/boot/Makefile | 1 | ||||
| -rw-r--r-- | arch/x86/boot/a20.c | 79 | ||||
| -rw-r--r-- | arch/x86/boot/boot.h | 3 | ||||
| -rw-r--r-- | arch/x86/boot/compressed/Makefile | 21 | ||||
| -rw-r--r-- | arch/x86/boot/compressed/head_32.S | 8 | ||||
| -rw-r--r-- | arch/x86/boot/compressed/head_64.S | 10 | ||||
| -rw-r--r-- | arch/x86/boot/compressed/misc.c | 118 | ||||
| -rw-r--r-- | arch/x86/boot/copy.S | 40 | ||||
| -rw-r--r-- | arch/x86/boot/header.S | 2 | ||||
| -rw-r--r-- | arch/x86/boot/main.c | 5 | ||||
| -rw-r--r-- | arch/x86/boot/pmjump.S | 16 | ||||
| -rw-r--r-- | arch/x86/boot/voyager.c | 40 |
12 files changed, 101 insertions, 242 deletions
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index cd48c7210016..c70eff69a1fb 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile | |||
| @@ -32,7 +32,6 @@ setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o | |||
| 32 | setup-y += header.o main.o mca.o memory.o pm.o pmjump.o | 32 | setup-y += header.o main.o mca.o memory.o pm.o pmjump.o |
| 33 | setup-y += printf.o string.o tty.o video.o video-mode.o version.o | 33 | setup-y += printf.o string.o tty.o video.o video-mode.o version.o |
| 34 | setup-$(CONFIG_X86_APM_BOOT) += apm.o | 34 | setup-$(CONFIG_X86_APM_BOOT) += apm.o |
| 35 | setup-$(CONFIG_X86_VOYAGER) += voyager.o | ||
| 36 | 35 | ||
| 37 | # The link order of the video-*.o modules can matter. In particular, | 36 | # The link order of the video-*.o modules can matter. In particular, |
| 38 | # video-vga.o *must* be listed first, followed by video-vesa.o. | 37 | # video-vga.o *must* be listed first, followed by video-vesa.o. |
diff --git a/arch/x86/boot/a20.c b/arch/x86/boot/a20.c index 4063d630deff..7c19ce8c2442 100644 --- a/arch/x86/boot/a20.c +++ b/arch/x86/boot/a20.c | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | * | 2 | * |
| 3 | * Copyright (C) 1991, 1992 Linus Torvalds | 3 | * Copyright (C) 1991, 1992 Linus Torvalds |
| 4 | * Copyright 2007-2008 rPath, Inc. - All Rights Reserved | 4 | * Copyright 2007-2008 rPath, Inc. - All Rights Reserved |
| 5 | * Copyright 2009 Intel Corporation | ||
| 5 | * | 6 | * |
| 6 | * This file is part of the Linux kernel, and is made available under | 7 | * This file is part of the Linux kernel, and is made available under |
| 7 | * the terms of the GNU General Public License version 2. | 8 | * the terms of the GNU General Public License version 2. |
| @@ -15,16 +16,23 @@ | |||
| 15 | #include "boot.h" | 16 | #include "boot.h" |
| 16 | 17 | ||
| 17 | #define MAX_8042_LOOPS 100000 | 18 | #define MAX_8042_LOOPS 100000 |
| 19 | #define MAX_8042_FF 32 | ||
| 18 | 20 | ||
| 19 | static int empty_8042(void) | 21 | static int empty_8042(void) |
| 20 | { | 22 | { |
| 21 | u8 status; | 23 | u8 status; |
| 22 | int loops = MAX_8042_LOOPS; | 24 | int loops = MAX_8042_LOOPS; |
| 25 | int ffs = MAX_8042_FF; | ||
| 23 | 26 | ||
| 24 | while (loops--) { | 27 | while (loops--) { |
| 25 | io_delay(); | 28 | io_delay(); |
| 26 | 29 | ||
| 27 | status = inb(0x64); | 30 | status = inb(0x64); |
| 31 | if (status == 0xff) { | ||
| 32 | /* FF is a plausible, but very unlikely status */ | ||
| 33 | if (!--ffs) | ||
| 34 | return -1; /* Assume no KBC present */ | ||
| 35 | } | ||
| 28 | if (status & 1) { | 36 | if (status & 1) { |
| 29 | /* Read and discard input data */ | 37 | /* Read and discard input data */ |
| 30 | io_delay(); | 38 | io_delay(); |
| @@ -118,44 +126,37 @@ static void enable_a20_fast(void) | |||
| 118 | 126 | ||
| 119 | int enable_a20(void) | 127 | int enable_a20(void) |
| 120 | { | 128 | { |
| 121 | #if defined(CONFIG_X86_ELAN) | ||
| 122 | /* Elan croaks if we try to touch the KBC */ | ||
| 123 | enable_a20_fast(); | ||
| 124 | while (!a20_test_long()) | ||
| 125 | ; | ||
| 126 | return 0; | ||
| 127 | #elif defined(CONFIG_X86_VOYAGER) | ||
| 128 | /* On Voyager, a20_test() is unsafe? */ | ||
| 129 | enable_a20_kbc(); | ||
| 130 | return 0; | ||
| 131 | #else | ||
| 132 | int loops = A20_ENABLE_LOOPS; | 129 | int loops = A20_ENABLE_LOOPS; |
| 133 | while (loops--) { | 130 | int kbc_err; |
| 134 | /* First, check to see if A20 is already enabled | 131 | |
| 135 | (legacy free, etc.) */ | 132 | while (loops--) { |
| 136 | if (a20_test_short()) | 133 | /* First, check to see if A20 is already enabled |
| 137 | return 0; | 134 | (legacy free, etc.) */ |
| 138 | 135 | if (a20_test_short()) | |
| 139 | /* Next, try the BIOS (INT 0x15, AX=0x2401) */ | 136 | return 0; |
| 140 | enable_a20_bios(); | 137 | |
| 141 | if (a20_test_short()) | 138 | /* Next, try the BIOS (INT 0x15, AX=0x2401) */ |
| 142 | return 0; | 139 | enable_a20_bios(); |
| 143 | 140 | if (a20_test_short()) | |
| 144 | /* Try enabling A20 through the keyboard controller */ | 141 | return 0; |
| 145 | empty_8042(); | 142 | |
| 146 | if (a20_test_short()) | 143 | /* Try enabling A20 through the keyboard controller */ |
| 147 | return 0; /* BIOS worked, but with delayed reaction */ | 144 | kbc_err = empty_8042(); |
| 148 | 145 | ||
| 149 | enable_a20_kbc(); | 146 | if (a20_test_short()) |
| 150 | if (a20_test_long()) | 147 | return 0; /* BIOS worked, but with delayed reaction */ |
| 151 | return 0; | 148 | |
| 152 | 149 | if (!kbc_err) { | |
| 153 | /* Finally, try enabling the "fast A20 gate" */ | 150 | enable_a20_kbc(); |
| 154 | enable_a20_fast(); | 151 | if (a20_test_long()) |
| 155 | if (a20_test_long()) | 152 | return 0; |
| 156 | return 0; | 153 | } |
| 157 | } | 154 | |
| 158 | 155 | /* Finally, try enabling the "fast A20 gate" */ | |
| 159 | return -1; | 156 | enable_a20_fast(); |
| 160 | #endif | 157 | if (a20_test_long()) |
| 158 | return 0; | ||
| 159 | } | ||
| 160 | |||
| 161 | return -1; | ||
| 161 | } | 162 | } |
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index cc0ef13fba7a..7b2692e897e5 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h | |||
| @@ -302,9 +302,6 @@ void probe_cards(int unsafe); | |||
| 302 | /* video-vesa.c */ | 302 | /* video-vesa.c */ |
| 303 | void vesa_store_edid(void); | 303 | void vesa_store_edid(void); |
| 304 | 304 | ||
| 305 | /* voyager.c */ | ||
| 306 | int query_voyager(void); | ||
| 307 | |||
| 308 | #endif /* __ASSEMBLY__ */ | 305 | #endif /* __ASSEMBLY__ */ |
| 309 | 306 | ||
| 310 | #endif /* BOOT_BOOT_H */ | 307 | #endif /* BOOT_BOOT_H */ |
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 1771c804e02f..3ca4c194b8e5 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | # create a compressed vmlinux image from the original vmlinux | 4 | # create a compressed vmlinux image from the original vmlinux |
| 5 | # | 5 | # |
| 6 | 6 | ||
| 7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz head_$(BITS).o misc.o piggy.o | 7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$(BITS).o misc.o piggy.o |
| 8 | 8 | ||
| 9 | KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 | 9 | KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 |
| 10 | KBUILD_CFLAGS += -fno-strict-aliasing -fPIC | 10 | KBUILD_CFLAGS += -fno-strict-aliasing -fPIC |
| @@ -47,18 +47,35 @@ ifeq ($(CONFIG_X86_32),y) | |||
| 47 | ifdef CONFIG_RELOCATABLE | 47 | ifdef CONFIG_RELOCATABLE |
| 48 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE | 48 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE |
| 49 | $(call if_changed,gzip) | 49 | $(call if_changed,gzip) |
| 50 | $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin.all FORCE | ||
| 51 | $(call if_changed,bzip2) | ||
| 52 | $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin.all FORCE | ||
| 53 | $(call if_changed,lzma) | ||
| 50 | else | 54 | else |
| 51 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | 55 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE |
| 52 | $(call if_changed,gzip) | 56 | $(call if_changed,gzip) |
| 57 | $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE | ||
| 58 | $(call if_changed,bzip2) | ||
| 59 | $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE | ||
| 60 | $(call if_changed,lzma) | ||
| 53 | endif | 61 | endif |
| 54 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T | 62 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T |
| 55 | 63 | ||
| 56 | else | 64 | else |
| 65 | |||
| 57 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | 66 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE |
| 58 | $(call if_changed,gzip) | 67 | $(call if_changed,gzip) |
| 68 | $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE | ||
| 69 | $(call if_changed,bzip2) | ||
| 70 | $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE | ||
| 71 | $(call if_changed,lzma) | ||
| 59 | 72 | ||
| 60 | LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T | 73 | LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T |
| 61 | endif | 74 | endif |
| 62 | 75 | ||
| 63 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE | 76 | suffix_$(CONFIG_KERNEL_GZIP) = gz |
| 77 | suffix_$(CONFIG_KERNEL_BZIP2) = bz2 | ||
| 78 | suffix_$(CONFIG_KERNEL_LZMA) = lzma | ||
| 79 | |||
| 80 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE | ||
| 64 | $(call if_changed,ld) | 81 | $(call if_changed,ld) |
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index 29c5fbf08392..3a8a866fb2e2 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S | |||
| @@ -25,14 +25,12 @@ | |||
| 25 | 25 | ||
| 26 | #include <linux/linkage.h> | 26 | #include <linux/linkage.h> |
| 27 | #include <asm/segment.h> | 27 | #include <asm/segment.h> |
| 28 | #include <asm/page.h> | 28 | #include <asm/page_types.h> |
| 29 | #include <asm/boot.h> | 29 | #include <asm/boot.h> |
| 30 | #include <asm/asm-offsets.h> | 30 | #include <asm/asm-offsets.h> |
| 31 | 31 | ||
| 32 | .section ".text.head","ax",@progbits | 32 | .section ".text.head","ax",@progbits |
| 33 | .globl startup_32 | 33 | ENTRY(startup_32) |
| 34 | |||
| 35 | startup_32: | ||
| 36 | cld | 34 | cld |
| 37 | /* test KEEP_SEGMENTS flag to see if the bootloader is asking | 35 | /* test KEEP_SEGMENTS flag to see if the bootloader is asking |
| 38 | * us to not reload segments */ | 36 | * us to not reload segments */ |
| @@ -113,6 +111,8 @@ startup_32: | |||
| 113 | */ | 111 | */ |
| 114 | leal relocated(%ebx), %eax | 112 | leal relocated(%ebx), %eax |
| 115 | jmp *%eax | 113 | jmp *%eax |
| 114 | ENDPROC(startup_32) | ||
| 115 | |||
| 116 | .section ".text" | 116 | .section ".text" |
| 117 | relocated: | 117 | relocated: |
| 118 | 118 | ||
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 1d5dff4123e1..ed4a82948002 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S | |||
| @@ -26,8 +26,8 @@ | |||
| 26 | 26 | ||
| 27 | #include <linux/linkage.h> | 27 | #include <linux/linkage.h> |
| 28 | #include <asm/segment.h> | 28 | #include <asm/segment.h> |
| 29 | #include <asm/pgtable.h> | 29 | #include <asm/pgtable_types.h> |
| 30 | #include <asm/page.h> | 30 | #include <asm/page_types.h> |
| 31 | #include <asm/boot.h> | 31 | #include <asm/boot.h> |
| 32 | #include <asm/msr.h> | 32 | #include <asm/msr.h> |
| 33 | #include <asm/processor-flags.h> | 33 | #include <asm/processor-flags.h> |
| @@ -35,9 +35,7 @@ | |||
| 35 | 35 | ||
| 36 | .section ".text.head" | 36 | .section ".text.head" |
| 37 | .code32 | 37 | .code32 |
| 38 | .globl startup_32 | 38 | ENTRY(startup_32) |
| 39 | |||
| 40 | startup_32: | ||
| 41 | cld | 39 | cld |
| 42 | /* test KEEP_SEGMENTS flag to see if the bootloader is asking | 40 | /* test KEEP_SEGMENTS flag to see if the bootloader is asking |
| 43 | * us to not reload segments */ | 41 | * us to not reload segments */ |
| @@ -176,6 +174,7 @@ startup_32: | |||
| 176 | 174 | ||
| 177 | /* Jump from 32bit compatibility mode into 64bit mode. */ | 175 | /* Jump from 32bit compatibility mode into 64bit mode. */ |
| 178 | lret | 176 | lret |
| 177 | ENDPROC(startup_32) | ||
| 179 | 178 | ||
| 180 | no_longmode: | 179 | no_longmode: |
| 181 | /* This isn't an x86-64 CPU so hang */ | 180 | /* This isn't an x86-64 CPU so hang */ |
| @@ -295,7 +294,6 @@ relocated: | |||
| 295 | call decompress_kernel | 294 | call decompress_kernel |
| 296 | popq %rsi | 295 | popq %rsi |
| 297 | 296 | ||
| 298 | |||
| 299 | /* | 297 | /* |
| 300 | * Jump to the decompressed kernel. | 298 | * Jump to the decompressed kernel. |
| 301 | */ | 299 | */ |
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c index da062216948a..e45be73684ff 100644 --- a/arch/x86/boot/compressed/misc.c +++ b/arch/x86/boot/compressed/misc.c | |||
| @@ -116,71 +116,13 @@ | |||
| 116 | /* | 116 | /* |
| 117 | * gzip declarations | 117 | * gzip declarations |
| 118 | */ | 118 | */ |
| 119 | |||
| 120 | #define OF(args) args | ||
| 121 | #define STATIC static | 119 | #define STATIC static |
| 122 | 120 | ||
| 123 | #undef memset | 121 | #undef memset |
| 124 | #undef memcpy | 122 | #undef memcpy |
| 125 | #define memzero(s, n) memset((s), 0, (n)) | 123 | #define memzero(s, n) memset((s), 0, (n)) |
| 126 | 124 | ||
| 127 | typedef unsigned char uch; | ||
| 128 | typedef unsigned short ush; | ||
| 129 | typedef unsigned long ulg; | ||
| 130 | |||
| 131 | /* | ||
| 132 | * Window size must be at least 32k, and a power of two. | ||
| 133 | * We don't actually have a window just a huge output buffer, | ||
| 134 | * so we report a 2G window size, as that should always be | ||
| 135 | * larger than our output buffer: | ||
| 136 | */ | ||
| 137 | #define WSIZE 0x80000000 | ||
| 138 | |||
| 139 | /* Input buffer: */ | ||
| 140 | static unsigned char *inbuf; | ||
| 141 | |||
| 142 | /* Sliding window buffer (and final output buffer): */ | ||
| 143 | static unsigned char *window; | ||
| 144 | |||
| 145 | /* Valid bytes in inbuf: */ | ||
| 146 | static unsigned insize; | ||
| 147 | |||
| 148 | /* Index of next byte to be processed in inbuf: */ | ||
| 149 | static unsigned inptr; | ||
| 150 | |||
| 151 | /* Bytes in output buffer: */ | ||
| 152 | static unsigned outcnt; | ||
| 153 | |||
| 154 | /* gzip flag byte */ | ||
| 155 | #define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */ | ||
| 156 | #define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gz file */ | ||
| 157 | #define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ | ||
| 158 | #define ORIG_NAM 0x08 /* bit 3 set: original file name present */ | ||
| 159 | #define COMMENT 0x10 /* bit 4 set: file comment present */ | ||
| 160 | #define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */ | ||
| 161 | #define RESERVED 0xC0 /* bit 6, 7: reserved */ | ||
| 162 | |||
| 163 | #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf()) | ||
| 164 | |||
| 165 | /* Diagnostic functions */ | ||
| 166 | #ifdef DEBUG | ||
| 167 | # define Assert(cond, msg) do { if (!(cond)) error(msg); } while (0) | ||
| 168 | # define Trace(x) do { fprintf x; } while (0) | ||
| 169 | # define Tracev(x) do { if (verbose) fprintf x ; } while (0) | ||
| 170 | # define Tracevv(x) do { if (verbose > 1) fprintf x ; } while (0) | ||
| 171 | # define Tracec(c, x) do { if (verbose && (c)) fprintf x ; } while (0) | ||
| 172 | # define Tracecv(c, x) do { if (verbose > 1 && (c)) fprintf x ; } while (0) | ||
| 173 | #else | ||
| 174 | # define Assert(cond, msg) | ||
| 175 | # define Trace(x) | ||
| 176 | # define Tracev(x) | ||
| 177 | # define Tracevv(x) | ||
| 178 | # define Tracec(c, x) | ||
| 179 | # define Tracecv(c, x) | ||
| 180 | #endif | ||
| 181 | 125 | ||
| 182 | static int fill_inbuf(void); | ||
| 183 | static void flush_window(void); | ||
| 184 | static void error(char *m); | 126 | static void error(char *m); |
| 185 | 127 | ||
| 186 | /* | 128 | /* |
| @@ -189,13 +131,8 @@ static void error(char *m); | |||
| 189 | static struct boot_params *real_mode; /* Pointer to real-mode data */ | 131 | static struct boot_params *real_mode; /* Pointer to real-mode data */ |
| 190 | static int quiet; | 132 | static int quiet; |
| 191 | 133 | ||
| 192 | extern unsigned char input_data[]; | ||
| 193 | extern int input_len; | ||
| 194 | |||
| 195 | static long bytes_out; | ||
| 196 | |||
| 197 | static void *memset(void *s, int c, unsigned n); | 134 | static void *memset(void *s, int c, unsigned n); |
| 198 | static void *memcpy(void *dest, const void *src, unsigned n); | 135 | void *memcpy(void *dest, const void *src, unsigned n); |
| 199 | 136 | ||
| 200 | static void __putstr(int, const char *); | 137 | static void __putstr(int, const char *); |
| 201 | #define putstr(__x) __putstr(0, __x) | 138 | #define putstr(__x) __putstr(0, __x) |
| @@ -213,7 +150,17 @@ static char *vidmem; | |||
| 213 | static int vidport; | 150 | static int vidport; |
| 214 | static int lines, cols; | 151 | static int lines, cols; |
| 215 | 152 | ||
| 216 | #include "../../../../lib/inflate.c" | 153 | #ifdef CONFIG_KERNEL_GZIP |
| 154 | #include "../../../../lib/decompress_inflate.c" | ||
| 155 | #endif | ||
| 156 | |||
| 157 | #ifdef CONFIG_KERNEL_BZIP2 | ||
| 158 | #include "../../../../lib/decompress_bunzip2.c" | ||
| 159 | #endif | ||
| 160 | |||
| 161 | #ifdef CONFIG_KERNEL_LZMA | ||
| 162 | #include "../../../../lib/decompress_unlzma.c" | ||
| 163 | #endif | ||
| 217 | 164 | ||
| 218 | static void scroll(void) | 165 | static void scroll(void) |
| 219 | { | 166 | { |
| @@ -282,7 +229,7 @@ static void *memset(void *s, int c, unsigned n) | |||
| 282 | return s; | 229 | return s; |
| 283 | } | 230 | } |
| 284 | 231 | ||
| 285 | static void *memcpy(void *dest, const void *src, unsigned n) | 232 | void *memcpy(void *dest, const void *src, unsigned n) |
| 286 | { | 233 | { |
| 287 | int i; | 234 | int i; |
| 288 | const char *s = src; | 235 | const char *s = src; |
| @@ -293,38 +240,6 @@ static void *memcpy(void *dest, const void *src, unsigned n) | |||
| 293 | return dest; | 240 | return dest; |
| 294 | } | 241 | } |
| 295 | 242 | ||
| 296 | /* =========================================================================== | ||
| 297 | * Fill the input buffer. This is called only when the buffer is empty | ||
| 298 | * and at least one byte is really needed. | ||
| 299 | */ | ||
| 300 | static int fill_inbuf(void) | ||
| 301 | { | ||
| 302 | error("ran out of input data"); | ||
| 303 | return 0; | ||
| 304 | } | ||
| 305 | |||
| 306 | /* =========================================================================== | ||
| 307 | * Write the output window window[0..outcnt-1] and update crc and bytes_out. | ||
| 308 | * (Used for the decompressed data only.) | ||
| 309 | */ | ||
| 310 | static void flush_window(void) | ||
| 311 | { | ||
| 312 | /* With my window equal to my output buffer | ||
| 313 | * I only need to compute the crc here. | ||
| 314 | */ | ||
| 315 | unsigned long c = crc; /* temporary variable */ | ||
| 316 | unsigned n; | ||
| 317 | unsigned char *in, ch; | ||
| 318 | |||
| 319 | in = window; | ||
| 320 | for (n = 0; n < outcnt; n++) { | ||
| 321 | ch = *in++; | ||
| 322 | c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8); | ||
| 323 | } | ||
| 324 | crc = c; | ||
| 325 | bytes_out += (unsigned long)outcnt; | ||
| 326 | outcnt = 0; | ||
| 327 | } | ||
| 328 | 243 | ||
| 329 | static void error(char *x) | 244 | static void error(char *x) |
| 330 | { | 245 | { |
| @@ -407,12 +322,8 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, | |||
| 407 | lines = real_mode->screen_info.orig_video_lines; | 322 | lines = real_mode->screen_info.orig_video_lines; |
| 408 | cols = real_mode->screen_info.orig_video_cols; | 323 | cols = real_mode->screen_info.orig_video_cols; |
| 409 | 324 | ||
| 410 | window = output; /* Output buffer (Normally at 1M) */ | ||
| 411 | free_mem_ptr = heap; /* Heap */ | 325 | free_mem_ptr = heap; /* Heap */ |
| 412 | free_mem_end_ptr = heap + BOOT_HEAP_SIZE; | 326 | free_mem_end_ptr = heap + BOOT_HEAP_SIZE; |
| 413 | inbuf = input_data; /* Input buffer */ | ||
| 414 | insize = input_len; | ||
| 415 | inptr = 0; | ||
| 416 | 327 | ||
| 417 | #ifdef CONFIG_X86_64 | 328 | #ifdef CONFIG_X86_64 |
| 418 | if ((unsigned long)output & (__KERNEL_ALIGN - 1)) | 329 | if ((unsigned long)output & (__KERNEL_ALIGN - 1)) |
| @@ -430,10 +341,9 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, | |||
| 430 | #endif | 341 | #endif |
| 431 | #endif | 342 | #endif |
| 432 | 343 | ||
| 433 | makecrc(); | ||
| 434 | if (!quiet) | 344 | if (!quiet) |
| 435 | putstr("\nDecompressing Linux... "); | 345 | putstr("\nDecompressing Linux... "); |
| 436 | gunzip(); | 346 | decompress(input_data, input_len, NULL, NULL, output, NULL, error); |
| 437 | parse_elf(output); | 347 | parse_elf(output); |
| 438 | if (!quiet) | 348 | if (!quiet) |
| 439 | putstr("done.\nBooting the kernel.\n"); | 349 | putstr("done.\nBooting the kernel.\n"); |
diff --git a/arch/x86/boot/copy.S b/arch/x86/boot/copy.S index ef50c84e8b4b..11f272c6f5e9 100644 --- a/arch/x86/boot/copy.S +++ b/arch/x86/boot/copy.S | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | * | 8 | * |
| 9 | * ----------------------------------------------------------------------- */ | 9 | * ----------------------------------------------------------------------- */ |
| 10 | 10 | ||
| 11 | #include <linux/linkage.h> | ||
| 12 | |||
| 11 | /* | 13 | /* |
| 12 | * Memory copy routines | 14 | * Memory copy routines |
| 13 | */ | 15 | */ |
| @@ -15,9 +17,7 @@ | |||
| 15 | .code16gcc | 17 | .code16gcc |
| 16 | .text | 18 | .text |
| 17 | 19 | ||
| 18 | .globl memcpy | 20 | GLOBAL(memcpy) |
| 19 | .type memcpy, @function | ||
| 20 | memcpy: | ||
| 21 | pushw %si | 21 | pushw %si |
| 22 | pushw %di | 22 | pushw %di |
| 23 | movw %ax, %di | 23 | movw %ax, %di |
| @@ -31,11 +31,9 @@ memcpy: | |||
| 31 | popw %di | 31 | popw %di |
| 32 | popw %si | 32 | popw %si |
| 33 | ret | 33 | ret |
| 34 | .size memcpy, .-memcpy | 34 | ENDPROC(memcpy) |
| 35 | 35 | ||
| 36 | .globl memset | 36 | GLOBAL(memset) |
| 37 | .type memset, @function | ||
| 38 | memset: | ||
| 39 | pushw %di | 37 | pushw %di |
| 40 | movw %ax, %di | 38 | movw %ax, %di |
| 41 | movzbl %dl, %eax | 39 | movzbl %dl, %eax |
| @@ -48,52 +46,42 @@ memset: | |||
| 48 | rep; stosb | 46 | rep; stosb |
| 49 | popw %di | 47 | popw %di |
| 50 | ret | 48 | ret |
| 51 | .size memset, .-memset | 49 | ENDPROC(memset) |
| 52 | 50 | ||
| 53 | .globl copy_from_fs | 51 | GLOBAL(copy_from_fs) |
| 54 | .type copy_from_fs, @function | ||
| 55 | copy_from_fs: | ||
| 56 | pushw %ds | 52 | pushw %ds |
| 57 | pushw %fs | 53 | pushw %fs |
| 58 | popw %ds | 54 | popw %ds |
| 59 | call memcpy | 55 | call memcpy |
| 60 | popw %ds | 56 | popw %ds |
| 61 | ret | 57 | ret |
| 62 | .size copy_from_fs, .-copy_from_fs | 58 | ENDPROC(copy_from_fs) |
| 63 | 59 | ||
| 64 | .globl copy_to_fs | 60 | GLOBAL(copy_to_fs) |
| 65 | .type copy_to_fs, @function | ||
| 66 | copy_to_fs: | ||
| 67 | pushw %es | 61 | pushw %es |
| 68 | pushw %fs | 62 | pushw %fs |
| 69 | popw %es | 63 | popw %es |
| 70 | call memcpy | 64 | call memcpy |
| 71 | popw %es | 65 | popw %es |
| 72 | ret | 66 | ret |
| 73 | .size copy_to_fs, .-copy_to_fs | 67 | ENDPROC(copy_to_fs) |
| 74 | 68 | ||
| 75 | #if 0 /* Not currently used, but can be enabled as needed */ | 69 | #if 0 /* Not currently used, but can be enabled as needed */ |
| 76 | 70 | GLOBAL(copy_from_gs) | |
| 77 | .globl copy_from_gs | ||
| 78 | .type copy_from_gs, @function | ||
| 79 | copy_from_gs: | ||
| 80 | pushw %ds | 71 | pushw %ds |
| 81 | pushw %gs | 72 | pushw %gs |
| 82 | popw %ds | 73 | popw %ds |
| 83 | call memcpy | 74 | call memcpy |
| 84 | popw %ds | 75 | popw %ds |
| 85 | ret | 76 | ret |
| 86 | .size copy_from_gs, .-copy_from_gs | 77 | ENDPROC(copy_from_gs) |
| 87 | .globl copy_to_gs | ||
| 88 | 78 | ||
| 89 | .type copy_to_gs, @function | 79 | GLOBAL(copy_to_gs) |
| 90 | copy_to_gs: | ||
| 91 | pushw %es | 80 | pushw %es |
| 92 | pushw %gs | 81 | pushw %gs |
| 93 | popw %es | 82 | popw %es |
| 94 | call memcpy | 83 | call memcpy |
| 95 | popw %es | 84 | popw %es |
| 96 | ret | 85 | ret |
| 97 | .size copy_to_gs, .-copy_to_gs | 86 | ENDPROC(copy_to_gs) |
| 98 | |||
| 99 | #endif | 87 | #endif |
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index b993062e9a5f..7ccff4884a23 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | #include <linux/utsrelease.h> | 19 | #include <linux/utsrelease.h> |
| 20 | #include <asm/boot.h> | 20 | #include <asm/boot.h> |
| 21 | #include <asm/e820.h> | 21 | #include <asm/e820.h> |
| 22 | #include <asm/page.h> | 22 | #include <asm/page_types.h> |
| 23 | #include <asm/setup.h> | 23 | #include <asm/setup.h> |
| 24 | #include "boot.h" | 24 | #include "boot.h" |
| 25 | #include "offsets.h" | 25 | #include "offsets.h" |
diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c index 197421db1af1..58f0415d3ae0 100644 --- a/arch/x86/boot/main.c +++ b/arch/x86/boot/main.c | |||
| @@ -149,11 +149,6 @@ void main(void) | |||
| 149 | /* Query MCA information */ | 149 | /* Query MCA information */ |
| 150 | query_mca(); | 150 | query_mca(); |
| 151 | 151 | ||
| 152 | /* Voyager */ | ||
| 153 | #ifdef CONFIG_X86_VOYAGER | ||
| 154 | query_voyager(); | ||
| 155 | #endif | ||
| 156 | |||
| 157 | /* Query Intel SpeedStep (IST) information */ | 152 | /* Query Intel SpeedStep (IST) information */ |
| 158 | query_ist(); | 153 | query_ist(); |
| 159 | 154 | ||
diff --git a/arch/x86/boot/pmjump.S b/arch/x86/boot/pmjump.S index 141b6e20ed31..019c17a75851 100644 --- a/arch/x86/boot/pmjump.S +++ b/arch/x86/boot/pmjump.S | |||
| @@ -15,18 +15,15 @@ | |||
| 15 | #include <asm/boot.h> | 15 | #include <asm/boot.h> |
| 16 | #include <asm/processor-flags.h> | 16 | #include <asm/processor-flags.h> |
| 17 | #include <asm/segment.h> | 17 | #include <asm/segment.h> |
| 18 | #include <linux/linkage.h> | ||
| 18 | 19 | ||
| 19 | .text | 20 | .text |
| 20 | |||
| 21 | .globl protected_mode_jump | ||
| 22 | .type protected_mode_jump, @function | ||
| 23 | |||
| 24 | .code16 | 21 | .code16 |
| 25 | 22 | ||
| 26 | /* | 23 | /* |
| 27 | * void protected_mode_jump(u32 entrypoint, u32 bootparams); | 24 | * void protected_mode_jump(u32 entrypoint, u32 bootparams); |
| 28 | */ | 25 | */ |
| 29 | protected_mode_jump: | 26 | GLOBAL(protected_mode_jump) |
| 30 | movl %edx, %esi # Pointer to boot_params table | 27 | movl %edx, %esi # Pointer to boot_params table |
| 31 | 28 | ||
| 32 | xorl %ebx, %ebx | 29 | xorl %ebx, %ebx |
| @@ -47,12 +44,10 @@ protected_mode_jump: | |||
| 47 | .byte 0x66, 0xea # ljmpl opcode | 44 | .byte 0x66, 0xea # ljmpl opcode |
| 48 | 2: .long in_pm32 # offset | 45 | 2: .long in_pm32 # offset |
| 49 | .word __BOOT_CS # segment | 46 | .word __BOOT_CS # segment |
| 50 | 47 | ENDPROC(protected_mode_jump) | |
| 51 | .size protected_mode_jump, .-protected_mode_jump | ||
| 52 | 48 | ||
| 53 | .code32 | 49 | .code32 |
| 54 | .type in_pm32, @function | 50 | GLOBAL(in_pm32) |
| 55 | in_pm32: | ||
| 56 | # Set up data segments for flat 32-bit mode | 51 | # Set up data segments for flat 32-bit mode |
| 57 | movl %ecx, %ds | 52 | movl %ecx, %ds |
| 58 | movl %ecx, %es | 53 | movl %ecx, %es |
| @@ -78,5 +73,4 @@ in_pm32: | |||
| 78 | lldt %cx | 73 | lldt %cx |
| 79 | 74 | ||
| 80 | jmpl *%eax # Jump to the 32-bit entrypoint | 75 | jmpl *%eax # Jump to the 32-bit entrypoint |
| 81 | 76 | ENDPROC(in_pm32) | |
| 82 | .size in_pm32, .-in_pm32 | ||
diff --git a/arch/x86/boot/voyager.c b/arch/x86/boot/voyager.c deleted file mode 100644 index 433909d61e5c..000000000000 --- a/arch/x86/boot/voyager.c +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 1 | /* -*- linux-c -*- ------------------------------------------------------- * | ||
| 2 | * | ||
| 3 | * Copyright (C) 1991, 1992 Linus Torvalds | ||
| 4 | * Copyright 2007 rPath, Inc. - All Rights Reserved | ||
| 5 | * | ||
| 6 | * This file is part of the Linux kernel, and is made available under | ||
| 7 | * the terms of the GNU General Public License version 2. | ||
| 8 | * | ||
| 9 | * ----------------------------------------------------------------------- */ | ||
| 10 | |||
| 11 | /* | ||
| 12 | * Get the Voyager config information | ||
| 13 | */ | ||
| 14 | |||
| 15 | #include "boot.h" | ||
| 16 | |||
| 17 | int query_voyager(void) | ||
| 18 | { | ||
| 19 | u8 err; | ||
| 20 | u16 es, di; | ||
| 21 | /* Abuse the apm_bios_info area for this */ | ||
| 22 | u8 *data_ptr = (u8 *)&boot_params.apm_bios_info; | ||
| 23 | |||
| 24 | data_ptr[0] = 0xff; /* Flag on config not found(?) */ | ||
| 25 | |||
| 26 | asm("pushw %%es ; " | ||
| 27 | "int $0x15 ; " | ||
| 28 | "setc %0 ; " | ||
| 29 | "movw %%es, %1 ; " | ||
| 30 | "popw %%es" | ||
| 31 | : "=q" (err), "=r" (es), "=D" (di) | ||
| 32 | : "a" (0xffc0)); | ||
| 33 | |||
| 34 | if (err) | ||
| 35 | return -1; /* Not Voyager */ | ||
| 36 | |||
| 37 | set_fs(es); | ||
| 38 | copy_from_fs(data_ptr, di, 7); /* Table is 7 bytes apparently */ | ||
| 39 | return 0; | ||
| 40 | } | ||
