From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyR0v-0002v8-Qv for qemu-devel@nongnu.org; Sun, 14 Jul 2013 14:27:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyR0u-0000QZ-To for qemu-devel@nongnu.org; Sun, 14 Jul 2013 14:27:17 -0400 Received: from mail-qa0-f50.google.com ([209.85.216.50]:42756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyR0u-0000QV-QG for qemu-devel@nongnu.org; Sun, 14 Jul 2013 14:27:16 -0400 Received: by mail-qa0-f50.google.com with SMTP id l18so1214227qak.2 for ; Sun, 14 Jul 2013 11:27:16 -0700 (PDT) Date: Sun, 14 Jul 2013 14:27:14 -0400 From: Kevin O'Connor Message-ID: <20130714182714.GC7607@morn.localdomain> References: <1373211589-8097-1-git-send-email-mst@redhat.com> <1373211589-8097-5-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1373211589-8097-5-git-send-email-mst@redhat.com> Subject: Re: [Qemu-devel] [SeaBIOS] [PATCH v2 4/5] acpi: load and link tables from /etc/acpi/ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: seabios@seabios.org, qemu-devel@nongnu.org On Sun, Jul 07, 2013 at 06:42:43PM +0300, Michael S. Tsirkin wrote: > Load files in /etc/acpi/, link them using > a linker script and use for acpi tables, including the RSDP. > Presense of RSDP in this directory completely disables > generating and loading legacy acpi tables. > > Signed-off-by: Michael S. Tsirkin > --- > src/acpi.c | 39 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > > diff --git a/src/acpi.c b/src/acpi.c > index a81f0cb..07d311a 100644 > --- a/src/acpi.c > +++ b/src/acpi.c > @@ -27,6 +27,7 @@ > #include "config.h" // CONFIG_* > #include "paravirt.h" // RamSize > #include "dev-q35.h" > +#include "linker.h" > > #include "acpi-dsdt.hex" > > @@ -599,6 +600,34 @@ static const struct pci_device_id acpi_find_tbl[] = { > > struct rsdp_descriptor *RsdpAddr; > > +/* Look for RSDP signature in files loaded in FSEG */ > +struct rsdp_descriptor * > +acpi_find_rsdp_rom(void) > +{ > + struct romfile_s *file = NULL; > + struct rsdp_descriptor *rsdp = NULL; > + for (;;) { > + file = romfile_findprefix("", file); > + if (!file) > + break; > + > + if (!file->data || !pmm_test_fseg(file->data) || > + file->size < sizeof(rsdp->signature)) > + continue; > + > + void *data; > + > + for (data = file->data; > + data + sizeof(*rsdp) <= file->data + file->size; > + data++) { > + rsdp = data; > + if (rsdp->signature == cpu_to_le64(RSDP_SIGNATURE)) > + return rsdp; > + } > + } > + return NULL; > +} > + > #define MAX_ACPI_TABLES 20 > void > acpi_setup(void) > @@ -608,6 +637,16 @@ acpi_setup(void) > > dprintf(3, "init ACPI tables\n"); > > + linker_loader_execute("/etc/linker-script"); > + > + RsdpAddr = acpi_find_rsdp_rom(); > + > + if (RsdpAddr) { > + return; > + } I don't understand this. Why not use the presence of "/etc/linker-script" to determine if ACPI should be produced. Also, /etc/linker-script is not very informative - how about something like "/etc/biostables". -Kevin