]> xenbits.xensource.com Git - xen.git/commitdiff
tools: hvmloader: pass ACPI_PHYSICAL_ADDRESS as a runtime parameter.
authorIan Campbell <ian.campbell@citrix.com>
Tue, 12 Apr 2011 12:37:03 +0000 (13:37 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 12 Apr 2011 12:37:03 +0000 (13:37 +0100)
Instead of hardcoding in a header.

Reduces the cross talk between ROMBIOS and hvmloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
tools/firmware/hvmloader/acpi/acpi2_0.h
tools/firmware/hvmloader/acpi/build.c
tools/firmware/hvmloader/hvmloader.c

index 9ea356b062364ebf1b4bf73629e42d84d97516cf..183b3cfc1b9df5bd251d4838237441df67fab8cf 100644 (file)
@@ -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_ */
index dc38c73e958efde3e126868cb9c9e07d4cbfb1dc..747aff69d41cd7d77eadb8ee75abadf72222f437 100644 (file)
@@ -242,7 +242,9 @@ static int construct_secondary_tables(uint8_t *buf, unsigned long *table_ptrs)
     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 *buf, int *low_sz, int *high_sz)
     /*
      * 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 *buf, int *low_sz, int *high_sz)
     *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);
 }
 
index 01e1da2a14e981581c03fc27d103dbb03dc31ea0..7d54b3c56742570b9f56d5e31a3309536c7909f7 100644 (file)
@@ -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);
     }