diff options
author | Jan Kiszka <jan.kiszka@web.de> | 2010-05-20 22:04:29 -0400 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2010-05-20 22:04:29 -0400 |
commit | 29c843912a0baa7fa63033fe28e1ca7e796686a5 (patch) | |
tree | 74fd41a45ea2a85666e395ce52769bf069238eea /arch/x86 | |
parent | 4402c153cb9c549cd21d6007ef0dfac50c8d148d (diff) |
x86, kgdb: early trap init for early debug
Allow the x86 arch to have early exception processing for the purpose
of debugging via the kgdb.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/traps.c | 14 |
3 files changed, 13 insertions, 4 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 5a51379dcbe4..7e5c6a60b8ee 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -789,6 +789,8 @@ static inline void wbinvd_halt(void) | |||
789 | extern void enable_sep_cpu(void); | 789 | extern void enable_sep_cpu(void); |
790 | extern int sysenter_setup(void); | 790 | extern int sysenter_setup(void); |
791 | 791 | ||
792 | extern void early_trap_init(void); | ||
793 | |||
792 | /* Defined in head.S */ | 794 | /* Defined in head.S */ |
793 | extern struct desc_ptr early_gdt_descr; | 795 | extern struct desc_ptr early_gdt_descr; |
794 | 796 | ||
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index c4851eff57b3..e8029896309a 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -725,6 +725,7 @@ void __init setup_arch(char **cmdline_p) | |||
725 | /* VMI may relocate the fixmap; do this before touching ioremap area */ | 725 | /* VMI may relocate the fixmap; do this before touching ioremap area */ |
726 | vmi_init(); | 726 | vmi_init(); |
727 | 727 | ||
728 | early_trap_init(); | ||
728 | early_cpu_init(); | 729 | early_cpu_init(); |
729 | early_ioremap_init(); | 730 | early_ioremap_init(); |
730 | 731 | ||
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 7eaad4c5110a..142d70c74b02 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -808,6 +808,16 @@ dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code) | |||
808 | } | 808 | } |
809 | #endif | 809 | #endif |
810 | 810 | ||
811 | /* Set of traps needed for early debugging. */ | ||
812 | void __init early_trap_init(void) | ||
813 | { | ||
814 | set_intr_gate_ist(1, &debug, DEBUG_STACK); | ||
815 | /* int3 can be called from all */ | ||
816 | set_system_intr_gate_ist(3, &int3, DEBUG_STACK); | ||
817 | set_intr_gate(14, &page_fault); | ||
818 | load_idt(&idt_descr); | ||
819 | } | ||
820 | |||
811 | void __init trap_init(void) | 821 | void __init trap_init(void) |
812 | { | 822 | { |
813 | int i; | 823 | int i; |
@@ -821,10 +831,7 @@ void __init trap_init(void) | |||
821 | #endif | 831 | #endif |
822 | 832 | ||
823 | set_intr_gate(0, ÷_error); | 833 | set_intr_gate(0, ÷_error); |
824 | set_intr_gate_ist(1, &debug, DEBUG_STACK); | ||
825 | set_intr_gate_ist(2, &nmi, NMI_STACK); | 834 | set_intr_gate_ist(2, &nmi, NMI_STACK); |
826 | /* int3 can be called from all */ | ||
827 | set_system_intr_gate_ist(3, &int3, DEBUG_STACK); | ||
828 | /* int4 can be called from all */ | 835 | /* int4 can be called from all */ |
829 | set_system_intr_gate(4, &overflow); | 836 | set_system_intr_gate(4, &overflow); |
830 | set_intr_gate(5, &bounds); | 837 | set_intr_gate(5, &bounds); |
@@ -840,7 +847,6 @@ void __init trap_init(void) | |||
840 | set_intr_gate(11, &segment_not_present); | 847 | set_intr_gate(11, &segment_not_present); |
841 | set_intr_gate_ist(12, &stack_segment, STACKFAULT_STACK); | 848 | set_intr_gate_ist(12, &stack_segment, STACKFAULT_STACK); |
842 | set_intr_gate(13, &general_protection); | 849 | set_intr_gate(13, &general_protection); |
843 | set_intr_gate(14, &page_fault); | ||
844 | set_intr_gate(15, &spurious_interrupt_bug); | 850 | set_intr_gate(15, &spurious_interrupt_bug); |
845 | set_intr_gate(16, &coprocessor_error); | 851 | set_intr_gate(16, &coprocessor_error); |
846 | set_intr_gate(17, &alignment_check); | 852 | set_intr_gate(17, &alignment_check); |