diff options
Diffstat (limited to 'arch/x86/boot')
-rw-r--r-- | arch/x86/boot/Makefile | 18 | ||||
-rw-r--r-- | arch/x86/boot/compressed/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/boot/compressed/head_64.S | 8 | ||||
-rw-r--r-- | arch/x86/boot/cpu.c | 26 | ||||
-rw-r--r-- | arch/x86/boot/mkcpustr.c | 49 |
5 files changed, 88 insertions, 14 deletions
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index 349b81a39c40..f88458e83ef0 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile | |||
@@ -26,7 +26,7 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA | |||
26 | #RAMDISK := -DRAMDISK=512 | 26 | #RAMDISK := -DRAMDISK=512 |
27 | 27 | ||
28 | targets := vmlinux.bin setup.bin setup.elf zImage bzImage | 28 | targets := vmlinux.bin setup.bin setup.elf zImage bzImage |
29 | subdir- := compressed | 29 | subdir- := compressed |
30 | 30 | ||
31 | setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o | 31 | 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 |
@@ -43,9 +43,17 @@ setup-y += video-vesa.o | |||
43 | setup-y += video-bios.o | 43 | setup-y += video-bios.o |
44 | 44 | ||
45 | targets += $(setup-y) | 45 | targets += $(setup-y) |
46 | hostprogs-y := tools/build | 46 | hostprogs-y := mkcpustr tools/build |
47 | 47 | ||
48 | HOSTCFLAGS_build.o := $(LINUXINCLUDE) | 48 | HOST_EXTRACFLAGS += $(LINUXINCLUDE) |
49 | |||
50 | $(obj)/cpu.o: $(obj)/cpustr.h | ||
51 | |||
52 | quiet_cmd_cpustr = CPUSTR $@ | ||
53 | cmd_cpustr = $(obj)/mkcpustr > $@ | ||
54 | targets += cpustr.h | ||
55 | $(obj)/cpustr.h: $(obj)/mkcpustr FORCE | ||
56 | $(call if_changed,cpustr) | ||
49 | 57 | ||
50 | # --------------------------------------------------------------------------- | 58 | # --------------------------------------------------------------------------- |
51 | 59 | ||
@@ -80,6 +88,7 @@ $(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \ | |||
80 | $(call if_changed,image) | 88 | $(call if_changed,image) |
81 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' | 89 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' |
82 | 90 | ||
91 | OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S | ||
83 | $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE | 92 | $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE |
84 | $(call if_changed,objcopy) | 93 | $(call if_changed,objcopy) |
85 | 94 | ||
@@ -90,7 +99,6 @@ $(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE | |||
90 | $(call if_changed,ld) | 99 | $(call if_changed,ld) |
91 | 100 | ||
92 | OBJCOPYFLAGS_setup.bin := -O binary | 101 | OBJCOPYFLAGS_setup.bin := -O binary |
93 | |||
94 | $(obj)/setup.bin: $(obj)/setup.elf FORCE | 102 | $(obj)/setup.bin: $(obj)/setup.elf FORCE |
95 | $(call if_changed,objcopy) | 103 | $(call if_changed,objcopy) |
96 | 104 | ||
@@ -98,7 +106,7 @@ $(obj)/compressed/vmlinux: FORCE | |||
98 | $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ | 106 | $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ |
99 | 107 | ||
100 | # Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel | 108 | # Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel |
101 | FDARGS = | 109 | FDARGS = |
102 | # Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel | 110 | # Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel |
103 | FDINITRD = | 111 | FDINITRD = |
104 | 112 | ||
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index fe24ceabd909..d2b9f3bb87c0 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile | |||
@@ -22,6 +22,7 @@ $(obj)/vmlinux: $(src)/vmlinux_$(BITS).lds $(obj)/head_$(BITS).o $(obj)/misc.o $ | |||
22 | $(call if_changed,ld) | 22 | $(call if_changed,ld) |
23 | @: | 23 | @: |
24 | 24 | ||
25 | OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S | ||
25 | $(obj)/vmlinux.bin: vmlinux FORCE | 26 | $(obj)/vmlinux.bin: vmlinux FORCE |
26 | $(call if_changed,objcopy) | 27 | $(call if_changed,objcopy) |
27 | 28 | ||
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 1ccb38a7f0d2..e8657b98c902 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S | |||
@@ -80,8 +80,8 @@ startup_32: | |||
80 | 80 | ||
81 | #ifdef CONFIG_RELOCATABLE | 81 | #ifdef CONFIG_RELOCATABLE |
82 | movl %ebp, %ebx | 82 | movl %ebp, %ebx |
83 | addl $(LARGE_PAGE_SIZE -1), %ebx | 83 | addl $(PMD_PAGE_SIZE -1), %ebx |
84 | andl $LARGE_PAGE_MASK, %ebx | 84 | andl $PMD_PAGE_MASK, %ebx |
85 | #else | 85 | #else |
86 | movl $CONFIG_PHYSICAL_START, %ebx | 86 | movl $CONFIG_PHYSICAL_START, %ebx |
87 | #endif | 87 | #endif |
@@ -220,8 +220,8 @@ ENTRY(startup_64) | |||
220 | /* Start with the delta to where the kernel will run at. */ | 220 | /* Start with the delta to where the kernel will run at. */ |
221 | #ifdef CONFIG_RELOCATABLE | 221 | #ifdef CONFIG_RELOCATABLE |
222 | leaq startup_32(%rip) /* - $startup_32 */, %rbp | 222 | leaq startup_32(%rip) /* - $startup_32 */, %rbp |
223 | addq $(LARGE_PAGE_SIZE - 1), %rbp | 223 | addq $(PMD_PAGE_SIZE - 1), %rbp |
224 | andq $LARGE_PAGE_MASK, %rbp | 224 | andq $PMD_PAGE_MASK, %rbp |
225 | movq %rbp, %rbx | 225 | movq %rbp, %rbx |
226 | #else | 226 | #else |
227 | movq $CONFIG_PHYSICAL_START, %rbp | 227 | movq $CONFIG_PHYSICAL_START, %rbp |
diff --git a/arch/x86/boot/cpu.c b/arch/x86/boot/cpu.c index 2a5c32da5852..00e19edd852c 100644 --- a/arch/x86/boot/cpu.c +++ b/arch/x86/boot/cpu.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* -*- linux-c -*- ------------------------------------------------------- * | 1 | /* -*- linux-c -*- ------------------------------------------------------- * |
2 | * | 2 | * |
3 | * Copyright (C) 1991, 1992 Linus Torvalds | 3 | * Copyright (C) 1991, 1992 Linus Torvalds |
4 | * Copyright 2007 rPath, Inc. - All Rights Reserved | 4 | * Copyright 2007-2008 rPath, Inc. - All Rights Reserved |
5 | * | 5 | * |
6 | * This file is part of the Linux kernel, and is made available under | 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. | 7 | * the terms of the GNU General Public License version 2. |
@@ -9,7 +9,7 @@ | |||
9 | * ----------------------------------------------------------------------- */ | 9 | * ----------------------------------------------------------------------- */ |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * arch/i386/boot/cpu.c | 12 | * arch/x86/boot/cpu.c |
13 | * | 13 | * |
14 | * Check for obligatory CPU features and abort if the features are not | 14 | * Check for obligatory CPU features and abort if the features are not |
15 | * present. | 15 | * present. |
@@ -19,6 +19,8 @@ | |||
19 | #include "bitops.h" | 19 | #include "bitops.h" |
20 | #include <asm/cpufeature.h> | 20 | #include <asm/cpufeature.h> |
21 | 21 | ||
22 | #include "cpustr.h" | ||
23 | |||
22 | static char *cpu_name(int level) | 24 | static char *cpu_name(int level) |
23 | { | 25 | { |
24 | static char buf[6]; | 26 | static char buf[6]; |
@@ -35,6 +37,7 @@ int validate_cpu(void) | |||
35 | { | 37 | { |
36 | u32 *err_flags; | 38 | u32 *err_flags; |
37 | int cpu_level, req_level; | 39 | int cpu_level, req_level; |
40 | const unsigned char *msg_strs; | ||
38 | 41 | ||
39 | check_cpu(&cpu_level, &req_level, &err_flags); | 42 | check_cpu(&cpu_level, &req_level, &err_flags); |
40 | 43 | ||
@@ -51,13 +54,26 @@ int validate_cpu(void) | |||
51 | puts("This kernel requires the following features " | 54 | puts("This kernel requires the following features " |
52 | "not present on the CPU:\n"); | 55 | "not present on the CPU:\n"); |
53 | 56 | ||
57 | msg_strs = (const unsigned char *)x86_cap_strs; | ||
58 | |||
54 | for (i = 0; i < NCAPINTS; i++) { | 59 | for (i = 0; i < NCAPINTS; i++) { |
55 | u32 e = err_flags[i]; | 60 | u32 e = err_flags[i]; |
56 | 61 | ||
57 | for (j = 0; j < 32; j++) { | 62 | for (j = 0; j < 32; j++) { |
58 | if (e & 1) | 63 | int n = (i << 5)+j; |
59 | printf("%d:%d ", i, j); | 64 | if (*msg_strs < n) { |
60 | 65 | /* Skip to the next string */ | |
66 | do { | ||
67 | msg_strs++; | ||
68 | } while (*msg_strs); | ||
69 | msg_strs++; | ||
70 | } | ||
71 | if (e & 1) { | ||
72 | if (*msg_strs == n && msg_strs[1]) | ||
73 | printf("%s ", msg_strs+1); | ||
74 | else | ||
75 | printf("%d:%d ", i, j); | ||
76 | } | ||
61 | e >>= 1; | 77 | e >>= 1; |
62 | } | 78 | } |
63 | } | 79 | } |
diff --git a/arch/x86/boot/mkcpustr.c b/arch/x86/boot/mkcpustr.c new file mode 100644 index 000000000000..bbe76953bae9 --- /dev/null +++ b/arch/x86/boot/mkcpustr.c | |||
@@ -0,0 +1,49 @@ | |||
1 | /* ----------------------------------------------------------------------- * | ||
2 | * | ||
3 | * Copyright 2008 rPath, Inc. - All Rights Reserved | ||
4 | * | ||
5 | * This file is part of the Linux kernel, and is made available under | ||
6 | * the terms of the GNU General Public License version 2 or (at your | ||
7 | * option) any later version; incorporated herein by reference. | ||
8 | * | ||
9 | * ----------------------------------------------------------------------- */ | ||
10 | |||
11 | /* | ||
12 | * This is a host program to preprocess the CPU strings into a | ||
13 | * compact format suitable for the setup code. | ||
14 | */ | ||
15 | |||
16 | #include <stdio.h> | ||
17 | |||
18 | #include "../kernel/cpu/feature_names.c" | ||
19 | |||
20 | #if NCAPFLAGS > 8 | ||
21 | # error "Need to adjust the boot code handling of CPUID strings" | ||
22 | #endif | ||
23 | |||
24 | int main(void) | ||
25 | { | ||
26 | int i; | ||
27 | const char *str; | ||
28 | |||
29 | printf("static const char x86_cap_strs[] = \n"); | ||
30 | |||
31 | for (i = 0; i < NCAPINTS*32; i++) { | ||
32 | str = x86_cap_flags[i]; | ||
33 | |||
34 | if (i == NCAPINTS*32-1) { | ||
35 | /* The last entry must be unconditional; this | ||
36 | also consumes the compiler-added null character */ | ||
37 | if (!str) | ||
38 | str = ""; | ||
39 | printf("\t\"\\x%02x\"\"%s\"\n", i, str); | ||
40 | } else if (str) { | ||
41 | printf("#if REQUIRED_MASK%d & (1 << %d)\n" | ||
42 | "\t\"\\x%02x\"\"%s\\0\"\n" | ||
43 | "#endif\n", | ||
44 | i >> 5, i & 31, i, str); | ||
45 | } | ||
46 | } | ||
47 | printf("\t;\n"); | ||
48 | return 0; | ||
49 | } | ||