[coreboot] New patch to review for coreboot: 5c492e1 libpayload: Add get_option_from()

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Tue Sep 13 10:50:49 CEST 2011


Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/213

-gerrit

commit 5c492e1e4da04d8f348f92c40b8285d6420f5043
Author: Patrick Georgi <patrick.georgi at secunet.com>
Date:   Tue Jul 12 11:40:29 2011 +0200

    libpayload: Add get_option_from()
    
    This function allows reading the nvram configuration table from
    locations other than the cbtable.
    
    Change-Id: I56c9973a9ea45ad7bf0185b70d11c9ce5d0e0e1b
    Signed-off-by: Patrick Georgi <patrick.georgi at secunet.com>
---
 payloads/libpayload/drivers/options.c    |    9 +++++++--
 payloads/libpayload/include/libpayload.h |    1 +
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/payloads/libpayload/drivers/options.c b/payloads/libpayload/drivers/options.c
index 1c692f4..fdb4be3 100644
--- a/payloads/libpayload/drivers/options.c
+++ b/payloads/libpayload/drivers/options.c
@@ -93,9 +93,8 @@ static int get_cmos_value(u32 bitnum, u32 len, void *valptr)
 	return 0;
 }
 
-int get_option(void *dest, char *name)
+int get_option_from(struct cb_cmos_option_table *option_table, void *dest, char *name)
 {
-	struct cb_cmos_option_table *option_table = phys_to_virt(lib_sysinfo.option_table);
 	struct cb_cmos_entries *cmos_entry;
 	int len = strnlen(name, CMOS_MAX_NAME_LENGTH);
 
@@ -118,3 +117,9 @@ int get_option(void *dest, char *name)
 	printf("ERROR: No such CMOS option (%s)\n", name);
 	return 1;
 }
+
+int get_option(void *dest, char *name)
+{
+	struct cb_cmos_option_table *option_table = phys_to_virt(lib_sysinfo.option_table);
+	return get_option_from(option_table, dest, name);
+}
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 6ce7548..80eaaa4 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -194,6 +194,7 @@ void video_console_set_cursor(unsigned int cursorx, unsigned int cursory);
 
 /* drivers/option.c */
 void fix_options_checksum(void);
+int get_option_from(struct cb_cmos_option_table *option_table, void *dest, char *name);
 int get_option(void *dest, char *name);
 
 /**




More information about the coreboot mailing list