Reverses the default config for MP tables
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 19 Jan 2011 20:47:53 +0000 (12:47 -0800)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:57 +0000 (17:35 -0700)
MP Tables are now turned off by default.  There's a minor bug with them
(more specifically with ioapic_init()), that is a low priority for now.
This way, people don't have to manually turn off the MP tables, which
are deprecated.

Makeconfig
Makelocal.template
kern/arch/i686/e1000.c
kern/arch/i686/init.c
kern/arch/i686/ne2k.c
kern/arch/i686/rl8168.c
kern/arch/i686/trap.c

index 854ceac..1730e86 100644 (file)
@@ -23,7 +23,7 @@ CONFIG_NOMTRRS:=                   -D__CONFIG_NOMTRRS__
 CONFIG_E1000_MMIO_HACK:=           -D__CONFIG_E1000_MMIO_HACK__
 CONFIG_E1000_ON_BOXBORO:=          -DE1000_MMIO_ADDR=0x9bb20000
 CONFIG_E1000_ON_S142:=             -DE1000_MMIO_ADDR=0xfbee0000
-CONFIG_DISABLE_MPTABLES:=          -D__CONFIG_DISABLE_MPTABLES__
+CONFIG_ENABLE_MPTABLES:=           -D__CONFIG_ENABLE_MPTABLES__
 CONFIG_MONITOR_ON_INT:=            -D__CONFIG_MONITOR_ON_INT__
 CONFIG_DISABLE_SMT:=               -D__CONFIG_DISABLE_SMT__
 CONFIG_BOXBORO:=                   -D__CONFIG_BOXBORO__
index a51c2b4..33a18b8 100644 (file)
@@ -18,7 +18,7 @@
 #KERN_CFLAGS += $(CONFIG_E1000_MMIO_HACK)
 #KERN_CFLAGS += $(CONFIG_E1000_ON_BOXBORO)
 #KERN_CFLAGS += $(CONFIG_E1000_ON_S142)
-#KERN_CFLAGS += $(CONFIG_DISABLE_MPTABLES)
+#KERN_CFLAGS += $(CONFIG_ENABLE_MPTABLES)
 #KERN_CFLAGS += $(CONFIG_MONITOR_ON_INT)
 #KERN_CFLAGS += $(CONFIG_DISABLE_SMT)
 #KERN_CFLAGS += $(CONFIG_BOXBORO)
index 0ec4c49..34eab27 100644 (file)
@@ -547,12 +547,13 @@ void e1000_setup_interrupts() {
        register_interrupt_handler(interrupt_handlers, KERNEL_IRQ_OFFSET + e1000_irq, e1000_interrupt_handler, 0);
 
        // Enable irqs for the e1000
-#ifdef __CONFIG_DISABLE_MPTABLES__
+#ifdef __CONFIG_ENABLE_MPTABLES__
+       /* TODO: this should be for any IOAPIC EOI, not just MPTABLES */
+       ioapic_route_irq(e1000_irq, E1000_IRQ_CPU);     
+#else 
        // This will route the interrupts automatically to CORE 0
        // Call send_kernel_message if you want to route them somewhere else
        enable_e1000_irq(NULL,0,0,0,0);
-#else 
-       ioapic_route_irq(e1000_irq, E1000_IRQ_CPU);     
 #endif
 
        return;
index 3f5b1a4..69c93a9 100644 (file)
@@ -20,7 +20,7 @@
 void arch_init()
 {
        pci_init();
-#ifndef __CONFIG_DISABLE_MPTABLES__
+#ifdef __CONFIG_ENABLE_MPTABLES__
        mptables_parse();
        ioapic_init(); // MUST BE AFTER PCI/ISA INIT!
        // TODO: move these back to regular init.  requires fixing the 
@@ -74,16 +74,16 @@ void arch_init()
        register_interrupt_handler(interrupt_handlers, 1 + PIC1_OFFSET, mon_int, 0);
        register_interrupt_handler(interrupt_handlers, 3 + PIC1_OFFSET, mon_int, 0);
        register_interrupt_handler(interrupt_handlers, 4 + PIC1_OFFSET, mon_int, 0);
-# ifdef __CONFIG_DISABLE_MPTABLES__
+# ifdef __CONFIG_ENABLE_MPTABLES__
+       ioapic_route_irq(1, 0);
+       ioapic_route_irq(3, 0);
+       ioapic_route_irq(4, 0);
+# else 
        pic_unmask_irq(1);      /* keyboard */
        pic_unmask_irq(3);      /* serial 2 or 4 */
        pic_unmask_irq(4);      /* serial 1 or 3 */
        unmask_lapic_lvt(LAPIC_LVT_LINT0);
-# else 
-       ioapic_route_irq(1, 0);
-       ioapic_route_irq(3, 0);
-       ioapic_route_irq(4, 0);
-# endif /* __CONFIG_DISABLE_MPTABLES__ */
+# endif /* __CONFIG_ENABLE_MPTABLES__ */
        enable_irq(); /* we want these interrupts to work in the kernel. */
 #endif /* __CONFIG_MONITOR_ON_INT__ */
 }
index 01db318..2c2005d 100644 (file)
@@ -175,12 +175,12 @@ void ne2k_setup_interrupts() {
        // Kernel based interrupt stuff
        register_interrupt_handler(interrupt_handlers, KERNEL_IRQ_OFFSET + ne2k_irq, ne2k_interrupt_handler, (void *)0);
        
-#ifdef __CONFIG_DISABLE_MPTABLES__
+#ifdef __CONFIG_ENABLE_MPTABLES__
+       ioapic_route_irq(ne2k_irq, 0);  
+#else
        pic_unmask_irq(ne2k_irq);
        unmask_lapic_lvt(LAPIC_LVT_LINT0);
        enable_irq();
-#else
-       ioapic_route_irq(ne2k_irq, 0);  
 #endif
        
        SET_PAGE_0();
index a13c00e..9b5450c 100644 (file)
@@ -310,12 +310,12 @@ void rl8168_setup_interrupts() {
        
        // Kernel based interrupt stuff
        register_interrupt_handler(interrupt_handlers, KERNEL_IRQ_OFFSET + rl8168_irq, rl8168_interrupt_handler, 0);
-#ifdef __CONFIG_DISABLE_MPTABLES__
+#ifdef __CONFIG_ENABLE_MPTABLES__
+       ioapic_route_irq(rl8168_irq, 1);        
+#else
        pic_unmask_irq(rl8168_irq);
        unmask_lapic_lvt(LAPIC_LVT_LINT0);
        enable_irq();
-#else
-       ioapic_route_irq(rl8168_irq, 1);        
 #endif
        
        return;
index 5c51f72..ce7a407 100644 (file)
@@ -330,7 +330,8 @@ void irq_handler(struct trapframe *tf)
        // For now, only 235-255 are available
        assert(tf->tf_trapno >= 32); // slows us down, but we should never have this
 
-#ifndef __CONFIG_DISABLE_MPTABLES__
+#ifdef __CONFIG_ENABLE_MPTABLES__
+       /* TODO: this should be for any IOAPIC EOI, not just MPTABLES */
        lapic_send_eoi();
 #else
        //Old PIC relatd code. Should be gone for good, but leaving it just incase.