Patchwork [V2,3/8] Add public get_rsdp function

login
register
mail settings
Submitter Stefan Berger
Date April 5, 2011, 1:29 a.m.
Message ID <20110405013013.310638565@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/89750/
State New
Headers show

Comments

Stefan Berger - April 5, 2011, 1:29 a.m.
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(-)

Patch

Index: seabios/src/acpi.c
===================================================================
--- seabios.orig/src/acpi.c
+++ seabios/src/acpi.c
@@ -706,11 +706,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 "