This patch adds a global get_rsdp() function call and refactors find_resume_vector() to call it.
Signed-off-by: Stefan Berger stefanb@linux.vnet.ibm.com
--- src/acpi.c | 12 ++++++++++-- src/acpi.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-)
Index: seabios/src/acpi.c =================================================================== --- seabios.orig/src/acpi.c +++ seabios/src/acpi.c @@ -719,11 +719,19 @@ acpi_bios_init(void) dprintf(1, "ACPI tables: RSDP=%p RSDT=%p\n", rsdp, rsdt); }
-u32 -find_resume_vector(void) +struct rsdp_descriptor * +get_rsdp(void) { dprintf(4, "rsdp=%p\n", RsdpAddr); if (!RsdpAddr || RsdpAddr->signature != RSDP_SIGNATURE) + return 0; + return RsdpAddr; +} + +u32 +find_resume_vector(void) +{ + if (!get_rsdp()) return 0; struct rsdt_descriptor_rev1 *rsdt = (void*)RsdpAddr->rsdt_physical_address; dprintf(4, "rsdt=%p\n", rsdt); Index: seabios/src/acpi.h =================================================================== --- seabios.orig/src/acpi.h +++ seabios/src/acpi.h @@ -4,6 +4,7 @@ #include "types.h" // u32
void acpi_bios_init(void); +struct rsdp_descriptor *get_rsdp(); u32 find_resume_vector(void);
#define RSDP_SIGNATURE 0x2052545020445352LL // "RSD PTR "