WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 04 of 15] hvmloader: setup APICs in a common function

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 04 of 15] hvmloader: setup APICs in a common function again
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Wed, 1 Jun 2011 10:39:59 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Wed, 01 Jun 2011 02:54:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1306921195@xxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1306921195@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306916889 -3600
# Node ID b76a45b26b062be8f376271b039698ef566ffab2
# Parent  8a7fb25fff1980aa4fcf963da1aa82d4dfd34bda
hvmloader: setup APICs in a common function again.

Previous refactoring was premature.

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

diff -r 8a7fb25fff19 -r b76a45b26b06 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h Wed Jun 01 09:28:01 2011 +0100
+++ b/tools/firmware/hvmloader/config.h Wed Jun 01 09:28:09 2011 +0100
@@ -26,7 +26,6 @@ struct bios_config {
     /* ACPI tables */
     unsigned int acpi_start;
 
-    void (*apic_setup)(void);
     void (*smp_setup)(void);
 
     uint32_t (*bios_high_setup)(void);
diff -r 8a7fb25fff19 -r b76a45b26b06 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Wed Jun 01 09:28:01 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c      Wed Jun 01 09:28:09 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 @@ static void cmos_write_memory_size(void)
     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 @@ int main(void)
 
     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 8a7fb25fff19 -r b76a45b26b06 tools/firmware/hvmloader/rombios.c
--- a/tools/firmware/hvmloader/rombios.c        Wed Jun 01 09:28:01 2011 +0100
+++ b/tools/firmware/hvmloader/rombios.c        Wed Jun 01 09:28:09 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 @@ static void rombios_setup_bios_info(uint
     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 @@ struct bios_config rombios_config =  {
 
     .acpi_start = ACPI_PHYSICAL_ADDRESS,
 
-    .apic_setup = rombios_apic_setup,
     .smp_setup = smp_initialise,
 
     .bios_high_setup = rombios_highbios_setup,
diff -r 8a7fb25fff19 -r b76a45b26b06 tools/firmware/hvmloader/seabios.c
--- a/tools/firmware/hvmloader/seabios.c        Wed Jun 01 09:28:01 2011 +0100
+++ b/tools/firmware/hvmloader/seabios.c        Wed Jun 01 09:28:09 2011 +0100
@@ -50,7 +50,6 @@ struct bios_config seabios_config = {
 
     .bios_info_setup = NULL,
 
-    .apic_setup = NULL,
     .smp_setup = NULL,
 
     .vm86_setup = NULL,

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

<Prev in Thread] Current Thread [Next in Thread>