xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 03 of 19] tools: hvmloader: pass ACPI_PHYSICAL_ADDRESS as a runtime parameter
Date: Tue, 12 Apr 2011 12:29:02 +0100	[thread overview]
Message-ID: <b29f772657190d609c4f.1302607742@localhost.localdomain> (raw)
In-Reply-To: <patchbomb.1302607739@localhost.localdomain>

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# 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@citrix.com>

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);
     }

  parent reply	other threads:[~2011-04-12 11:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 11:28 [PATCH 00 of 19] tools: SeaBIOS integration Ian Campbell
2011-04-12 11:29 ` [PATCH 01 of 19] tools: hvmloader: move ROMBIOS configuration into tools/firmware/rombios/ Ian Campbell
2011-04-12 11:29 ` [PATCH 02 of 19] tools: hvmloader: split e820 support into its own code module Ian Campbell
2011-04-12 11:29 ` Ian Campbell [this message]
2011-04-12 11:29 ` [PATCH 04 of 19] tools: hvmloader: pass SMBIOS location as a runtime parameter Ian Campbell
2011-04-12 11:29 ` [PATCH 05 of 19] tools: hvmloader: pass option ROM end address around as a parameter Ian Campbell
2011-04-12 11:29 ` [PATCH 06 of 19] tools: hvmloader: split scratch and hypercall addressing from ROMBIOS low heap Ian Campbell
2011-04-12 11:29 ` [PATCH 07 of 19] tools: hvmloader: refactor Makefile to move ROM filenames into variables Ian Campbell
2011-04-12 11:29 ` [PATCH 08 of 19] tools: hvmloader: remove rombios_sz, just use sizeof(rombios) Ian Campbell
2011-04-12 11:29 ` [PATCH 09 of 19] tools: hvmloader: rename roms.h to roms.inc Ian Campbell
2011-04-12 11:29 ` [PATCH 10 of 19] tools: hvmloader: Define $(OBJS) directly instead of via $(SRCS) Ian Campbell
2011-04-12 11:29 ` [PATCH 11 of 19] tools: hvmloader: add bios_config data structure Ian Campbell
2011-04-12 11:29 ` [PATCH 12 of 19] tools: hvmloader: Refactor APIC, PCI and SMP setup into struct bios_config Ian Campbell
2011-04-12 11:29 ` [PATCH 13 of 19] tools: hvmloader: refactor highbios and bios_info " Ian Campbell
2011-04-12 11:29 ` [PATCH 14 of 19] tools: hvmloader: Refactor VM86 and E820 " Ian Campbell
2011-04-12 11:29 ` [PATCH 15 of 19] tools: hvmloader: Refactor ACPI table " Ian Campbell
2011-04-12 11:29 ` [PATCH 16 of 19] tools: hvmloader: Refactor MP " Ian Campbell
2011-04-12 11:29 ` [PATCH 17 of 19] tools: libxl: hide selection of device-model, hvmloader and BIOS by default Ian Campbell
2011-04-14 18:09   ` Ian Jackson
2011-04-15  7:53     ` Ian Campbell
2011-04-12 11:29 ` [PATCH 18 of 19] tools: hvmloader: select BIOS through xenstore Ian Campbell
2011-04-12 11:29 ` [PATCH 19 of 19] tools: support SeaBIOS. Use by default when upstream qemu is configured Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b29f772657190d609c4f.1302607742@localhost.localdomain \
    --to=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).