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

[Xen-devel] [PATCH 03 of 19] tools: hvmloader: pass ACPI_PHYSICAL_ADDRESS as a runtime parameter



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1302598830 -3600
# Node ID b29f772657190d609c4f5df250f1ec1c9e87a972
# Parent  17184d148ff5b507710561cd62cb2987fb531c47
tools: hvmloader: pass ACPI_PHYSICAL_ADDRESS as a runtime parameter.

Instead of hardcoding in a header.

Reduces the cross talk between ROMBIOS and hvmloader.

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

diff -r 17184d148ff5 -r b29f77265719 tools/firmware/hvmloader/acpi/acpi2_0.h
--- a/tools/firmware/hvmloader/acpi/acpi2_0.h   Tue Apr 12 09:57:27 2011 +0100
+++ b/tools/firmware/hvmloader/acpi/acpi2_0.h   Tue Apr 12 10:00:30 2011 +0100
@@ -382,7 +382,7 @@ struct acpi_20_madt_intsrcovr {
 
 #pragma pack ()
 
-void acpi_build_tables(void);
+void acpi_build_tables(unsigned int physical);
 extern uint32_t madt_csum_addr, madt_lapic0_addr;
 
 #endif /* _ACPI_2_0_H_ */
diff -r 17184d148ff5 -r b29f77265719 tools/firmware/hvmloader/acpi/build.c
--- a/tools/firmware/hvmloader/acpi/build.c     Tue Apr 12 09:57:27 2011 +0100
+++ b/tools/firmware/hvmloader/acpi/build.c     Tue Apr 12 10:00:30 2011 +0100
@@ -242,7 +242,9 @@ static int construct_secondary_tables(ui
     return align16(offset);
 }
 
-static void __acpi_build_tables(uint8_t *buf, int *low_sz, int *high_sz)
+static void __acpi_build_tables(unsigned int physical,
+                                uint8_t *buf,
+                                int *low_sz, int *high_sz)
 {
     struct acpi_20_rsdp *rsdp;
     struct acpi_20_rsdt *rsdt;
@@ -335,11 +337,11 @@ static void __acpi_build_tables(uint8_t 
     /*
      * Fill in low-memory data structures: bios_info_table and RSDP.
      */
-
-    buf = (uint8_t *)ACPI_PHYSICAL_ADDRESS;
+    buf = (uint8_t *)physical;
     offset = 0;
 
     rsdp = (struct acpi_20_rsdp *)&buf[offset];
+
     memcpy(rsdp, &Rsdp, sizeof(struct acpi_20_rsdp));
     offset += align16(sizeof(struct acpi_20_rsdp));
     rsdp->rsdt_address = (unsigned long)rsdt;
@@ -354,24 +356,23 @@ static void __acpi_build_tables(uint8_t 
     *low_sz = offset;
 }
 
-void acpi_build_tables(void)
+void acpi_build_tables(unsigned int physical)
 {
     int high_sz, low_sz;
     uint8_t *buf;
 
     /* Find out size of high-memory ACPI data area. */
     buf = (uint8_t *)&_end;
-    __acpi_build_tables(buf, &low_sz, &high_sz);
+    __acpi_build_tables(physical, buf, &low_sz, &high_sz);
     memset(buf, 0, high_sz);
 
     /* Allocate data area and set up ACPI tables there. */
     buf = mem_alloc(high_sz, 0);
-    __acpi_build_tables(buf, &low_sz, &high_sz);
+    __acpi_build_tables(physical, buf, &low_sz, &high_sz);
 
-    printf(" - Lo data: %08lx-%08lx\n"
+    printf(" - Lo data: %08x-%08x\n"
            " - Hi data: %08lx-%08lx\n",
-           (unsigned long)ACPI_PHYSICAL_ADDRESS,
-           (unsigned long)ACPI_PHYSICAL_ADDRESS + low_sz - 1,
+           physical, physical + low_sz - 1,
            (unsigned long)buf, (unsigned long)buf + high_sz - 1);
 }
 
diff -r 17184d148ff5 -r b29f77265719 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Tue Apr 12 09:57:27 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c      Tue Apr 12 10:00:30 2011 +0100
@@ -652,7 +652,7 @@ int main(void)
         };
 
         printf("Loading ACPI ...\n");
-        acpi_build_tables();
+        acpi_build_tables(ACPI_PHYSICAL_ADDRESS);
         hypercall_hvm_op(HVMOP_set_param, &p);
     }
 

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


 


Rackspace

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