[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] hvmloader: setup APICs in a common function again.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306943009 -3600
# Node ID c47480f718c85bfd19c7d43e162a899584cc098c
# Parent  cf6c61f71ee3e49efcbd74cfd0ad39ad94e82b74
hvmloader: setup APICs in a common function again.

Previous refactoring was premature.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r cf6c61f71ee3 -r c47480f718c8 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h Wed Jun 01 16:42:39 2011 +0100
+++ b/tools/firmware/hvmloader/config.h Wed Jun 01 16:43:29 2011 +0100
@@ -26,7 +26,6 @@
     /* ACPI tables */
     unsigned int acpi_start;
 
-    void (*apic_setup)(void);
     void (*smp_setup)(void);
 
     uint32_t (*bios_high_setup)(void);
diff -r cf6c61f71ee3 -r c47480f718c8 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Wed Jun 01 16:42:39 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c      Wed Jun 01 16:43:29 2011 +0100
@@ -25,6 +25,7 @@
 #include "config.h"
 #include "pci_regs.h"
 #include "option_rom.h"
+#include "apic_regs.h"
 #include <xen/version.h>
 #include <xen/hvm/params.h>
 
@@ -332,6 +333,21 @@
     cmos_outb(0x35, (uint8_t)( alt_mem >> 8));
 }
 
+static void apic_setup(void)
+{
+    /* Set the IOAPIC ID to the static value used in the MP/ACPI tables. */
+    ioapic_write(0x00, IOAPIC_ID);
+
+    /* NMIs are delivered direct to the BSP. */
+    lapic_write(APIC_SPIV, APIC_SPIV_APIC_ENABLED | 0xFF);
+    lapic_write(APIC_LVT0, (APIC_MODE_EXTINT << 8) | APIC_LVT_MASKED);
+    lapic_write(APIC_LVT1, APIC_MODE_NMI << 8);
+
+    /* 8259A ExtInts are delivered through IOAPIC pin 0 (Virtual Wire Mode). */
+    ioapic_write(0x10, APIC_DM_EXTINT);
+    ioapic_write(0x11, SET_APIC_ID(LAPIC_ID(0)));
+}
+
 struct bios_info {
     const char *key;
     const struct bios_config *bios;
@@ -384,8 +400,7 @@
 
     printf("CPU speed is %u MHz\n", get_cpu_mhz());
 
-    if (bios->apic_setup)
-        bios->apic_setup();
+    apic_setup();
     pci_setup();
 
     if (bios->smp_setup)
diff -r cf6c61f71ee3 -r c47480f718c8 tools/firmware/hvmloader/rombios.c
--- a/tools/firmware/hvmloader/rombios.c        Wed Jun 01 16:42:39 2011 +0100
+++ b/tools/firmware/hvmloader/rombios.c        Wed Jun 01 16:43:29 2011 +0100
@@ -25,7 +25,6 @@
 #include "../rombios/config.h"
 
 #include "acpi/acpi2_0.h"
-#include "apic_regs.h"
 #include "pci_regs.h"
 #include "util.h"
 #include "hypercall.h"
@@ -82,21 +81,6 @@
     bios_info->bios32_entry = bioshigh;
 }
 
-static void rombios_apic_setup(void)
-{
-    /* Set the IOAPIC ID to the static value used in the MP/ACPI tables. */
-    ioapic_write(0x00, IOAPIC_ID);
-
-    /* NMIs are delivered direct to the BSP. */
-    lapic_write(APIC_SPIV, APIC_SPIV_APIC_ENABLED | 0xFF);
-    lapic_write(APIC_LVT0, (APIC_MODE_EXTINT << 8) | APIC_LVT_MASKED);
-    lapic_write(APIC_LVT1, APIC_MODE_NMI << 8);
-
-    /* 8259A ExtInts are delivered through IOAPIC pin 0 (Virtual Wire Mode). */
-    ioapic_write(0x10, APIC_DM_EXTINT);
-    ioapic_write(0x11, SET_APIC_ID(LAPIC_ID(0)));
-}
-
 /*
  * find_mp_table_start - searchs through BIOS memory for '___HVMMP' signature
  *
@@ -167,7 +151,6 @@
 
     .acpi_start = ACPI_PHYSICAL_ADDRESS,
 
-    .apic_setup = rombios_apic_setup,
     .smp_setup = smp_initialise,
 
     .bios_high_setup = rombios_highbios_setup,
diff -r cf6c61f71ee3 -r c47480f718c8 tools/firmware/hvmloader/seabios.c
--- a/tools/firmware/hvmloader/seabios.c        Wed Jun 01 16:42:39 2011 +0100
+++ b/tools/firmware/hvmloader/seabios.c        Wed Jun 01 16:43:29 2011 +0100
@@ -50,7 +50,6 @@
 
     .bios_info_setup = NULL,
 
-    .apic_setup = NULL,
     .smp_setup = NULL,
 
     .vm86_setup = NULL,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.