From: Kevin O'Connor Date: Sat, 9 Jun 2012 17:08:02 +0000 (-0400) Subject: Minor - collect biostable copy code into new func copy_table(). X-Git-Tag: rel-1.7.1~33 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4d053ebe8119cdaf2a0c045104e8b4d2e35cfefa;p=seabios.git Minor - collect biostable copy code into new func copy_table(). Signed-off-by: Kevin O'Connor --- diff --git a/src/biostables.c b/src/biostables.c index 57a5c57..0a8c39a 100644 --- a/src/biostables.c +++ b/src/biostables.c @@ -11,7 +11,7 @@ #include "mptable.h" // MPTABLE_SIGNATURE #include "smbios.h" // struct smbios_entry_point -void +static void copy_pir(void *pos) { struct pir_header *p = pos; @@ -33,7 +33,7 @@ copy_pir(void *pos) PirOffset = (u32)newpos - BUILD_BIOS_ADDR; } -void +static void copy_mptable(void *pos) { struct mptable_floating_s *p = pos; @@ -57,7 +57,7 @@ copy_mptable(void *pos) memcpy((void*)newpos + length, (void*)p->physaddr, mpclength); } -void +static void copy_acpi_rsdp(void *pos) { if (RsdpAddr) @@ -83,7 +83,7 @@ copy_acpi_rsdp(void *pos) RsdpAddr = newpos; } -void +static void copy_smbios(void *pos) { if (SMBiosAddr) @@ -106,3 +106,12 @@ copy_smbios(void *pos) memcpy(newpos, pos, p->length); SMBiosAddr = newpos; } + +void +copy_table(void *pos) +{ + copy_pir(pos); + copy_mptable(pos); + copy_acpi_rsdp(pos); + copy_smbios(pos); +} diff --git a/src/coreboot.c b/src/coreboot.c index d93196f..9de99af 100644 --- a/src/coreboot.c +++ b/src/coreboot.c @@ -198,12 +198,8 @@ scan_tables(u32 start, u32 size) { void *p = (void*)ALIGN(start, 16); void *end = (void*)start + size; - for (; ptables; + void **tables = (void*)info->tables; int i; dprintf(1, "xen: copy BIOS tables...\n"); - for (i=0; itables_nr; i++) { - void *table = (void *)tables[i]; - copy_acpi_rsdp(table); - copy_mptable(table); - copy_pir(table); - copy_smbios(table); - } + for (i=0; itables_nr; i++) + copy_table(tables[i]); } void xen_setup(void)