diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:06 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:06 -0500 |
commit | 076f9776f5d8d131b36955db8641aba3893c2c1b (patch) | |
tree | b85e705ecfe34400c6e1188fb470572956a232ab /arch | |
parent | 8866cd9dc9d0bbadcf361a14e0cdfecb66473087 (diff) |
x86: make early printk selectable on 64-bit as well
Enable CONFIG_EMBEDDED to select CONFIG_EARLY_PRINTK on 64-bit as well.
saves ~2K:
text data bss dec hex filename
7290283 3672091 1907848 12870222 c4624e vmlinux.before
7288373 3671795 1907848 12868016 c459b0 vmlinux.after
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/Kconfig.debug | 2 | ||||
-rw-r--r-- | arch/x86/kernel/head64.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/head_64.S | 7 |
3 files changed, 14 insertions, 2 deletions
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 15854b53badc..88420af98140 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug | |||
@@ -6,7 +6,7 @@ config TRACE_IRQFLAGS_SUPPORT | |||
6 | source "lib/Kconfig.debug" | 6 | source "lib/Kconfig.debug" |
7 | 7 | ||
8 | config EARLY_PRINTK | 8 | config EARLY_PRINTK |
9 | bool "Early printk" if EMBEDDED && DEBUG_KERNEL && X86_32 | 9 | bool "Early printk" if EMBEDDED |
10 | default y | 10 | default y |
11 | help | 11 | help |
12 | Write kernel log output directly into the VGA buffer or to a serial | 12 | Write kernel log output directly into the VGA buffer or to a serial |
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 85c1e6bf8022..87e031d4abf1 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c | |||
@@ -58,8 +58,13 @@ void __init x86_64_start_kernel(char * real_mode_data) | |||
58 | /* Make NULL pointers segfault */ | 58 | /* Make NULL pointers segfault */ |
59 | zap_identity_mappings(); | 59 | zap_identity_mappings(); |
60 | 60 | ||
61 | for (i = 0; i < IDT_ENTRIES; i++) | 61 | for (i = 0; i < IDT_ENTRIES; i++) { |
62 | #ifdef CONFIG_EARLY_PRINTK | ||
62 | set_intr_gate(i, &early_idt_handlers[i]); | 63 | set_intr_gate(i, &early_idt_handlers[i]); |
64 | #else | ||
65 | set_intr_gate(i, early_idt_handler); | ||
66 | #endif | ||
67 | } | ||
63 | load_idt((const struct desc_ptr *)&idt_descr); | 68 | load_idt((const struct desc_ptr *)&idt_descr); |
64 | 69 | ||
65 | early_printk("Kernel alive\n"); | 70 | early_printk("Kernel alive\n"); |
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 8b4c35cb519a..1d5a7a361200 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S | |||
@@ -267,6 +267,7 @@ init_rsp: | |||
267 | bad_address: | 267 | bad_address: |
268 | jmp bad_address | 268 | jmp bad_address |
269 | 269 | ||
270 | #ifdef CONFIG_EARLY_PRINTK | ||
270 | .macro early_idt_tramp first, last | 271 | .macro early_idt_tramp first, last |
271 | .ifgt \last-\first | 272 | .ifgt \last-\first |
272 | early_idt_tramp \first, \last-1 | 273 | early_idt_tramp \first, \last-1 |
@@ -281,8 +282,10 @@ early_idt_handlers: | |||
281 | early_idt_tramp 64, 127 | 282 | early_idt_tramp 64, 127 |
282 | early_idt_tramp 128, 191 | 283 | early_idt_tramp 128, 191 |
283 | early_idt_tramp 192, 255 | 284 | early_idt_tramp 192, 255 |
285 | #endif | ||
284 | 286 | ||
285 | ENTRY(early_idt_handler) | 287 | ENTRY(early_idt_handler) |
288 | #ifdef CONFIG_EARLY_PRINTK | ||
286 | cmpl $2,early_recursion_flag(%rip) | 289 | cmpl $2,early_recursion_flag(%rip) |
287 | jz 1f | 290 | jz 1f |
288 | incl early_recursion_flag(%rip) | 291 | incl early_recursion_flag(%rip) |
@@ -311,8 +314,11 @@ ENTRY(early_idt_handler) | |||
311 | movq 8(%rsp),%rsi # get rip again | 314 | movq 8(%rsp),%rsi # get rip again |
312 | call __print_symbol | 315 | call __print_symbol |
313 | #endif | 316 | #endif |
317 | #endif /* EARLY_PRINTK */ | ||
314 | 1: hlt | 318 | 1: hlt |
315 | jmp 1b | 319 | jmp 1b |
320 | |||
321 | #ifdef CONFIG_EARLY_PRINTK | ||
316 | early_recursion_flag: | 322 | early_recursion_flag: |
317 | .long 0 | 323 | .long 0 |
318 | 324 | ||
@@ -320,6 +326,7 @@ early_idt_msg: | |||
320 | .asciz "PANIC: early exception %02lx rip %lx:%lx error %lx cr2 %lx\n" | 326 | .asciz "PANIC: early exception %02lx rip %lx:%lx error %lx cr2 %lx\n" |
321 | early_idt_ripmsg: | 327 | early_idt_ripmsg: |
322 | .asciz "RIP %s\n" | 328 | .asciz "RIP %s\n" |
329 | #endif /* CONFIG_EARLY_PRINTK */ | ||
323 | 330 | ||
324 | .balign PAGE_SIZE | 331 | .balign PAGE_SIZE |
325 | 332 | ||