diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-01-30 12:33:06 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 12:33:06 (GMT) |
commit | 076f9776f5d8d131b36955db8641aba3893c2c1b (patch) | |
tree | b85e705ecfe34400c6e1188fb470572956a232ab /arch/x86/kernel | |
parent | 8866cd9dc9d0bbadcf361a14e0cdfecb66473087 (diff) | |
download | linux-076f9776f5d8d131b36955db8641aba3893c2c1b.tar.xz |
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/x86/kernel')
-rw-r--r-- | arch/x86/kernel/head64.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/head_64.S | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 85c1e6bf..87e031d 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) /* Make NULL pointers segfault */ zap_identity_mappings(); - for (i = 0; i < IDT_ENTRIES; i++) + for (i = 0; i < IDT_ENTRIES; i++) { +#ifdef CONFIG_EARLY_PRINTK set_intr_gate(i, &early_idt_handlers[i]); +#else + set_intr_gate(i, early_idt_handler); +#endif + } load_idt((const struct desc_ptr *)&idt_descr); early_printk("Kernel alive\n"); diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 8b4c35c..1d5a7a3 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -267,6 +267,7 @@ init_rsp: bad_address: jmp bad_address +#ifdef CONFIG_EARLY_PRINTK .macro early_idt_tramp first, last .ifgt \last-\first early_idt_tramp \first, \last-1 @@ -281,8 +282,10 @@ early_idt_handlers: early_idt_tramp 64, 127 early_idt_tramp 128, 191 early_idt_tramp 192, 255 +#endif ENTRY(early_idt_handler) +#ifdef CONFIG_EARLY_PRINTK cmpl $2,early_recursion_flag(%rip) jz 1f incl early_recursion_flag(%rip) @@ -311,8 +314,11 @@ ENTRY(early_idt_handler) movq 8(%rsp),%rsi # get rip again call __print_symbol #endif +#endif /* EARLY_PRINTK */ 1: hlt jmp 1b + +#ifdef CONFIG_EARLY_PRINTK early_recursion_flag: .long 0 @@ -320,6 +326,7 @@ early_idt_msg: .asciz "PANIC: early exception %02lx rip %lx:%lx error %lx cr2 %lx\n" early_idt_ripmsg: .asciz "RIP %s\n" +#endif /* CONFIG_EARLY_PRINTK */ .balign PAGE_SIZE |