nvramtool: Move code so it has access to the right data structures
Signed-off-by: Mathias Krause <mathias.krause@secunet.com> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6440 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
committed by
Patrick Georgi
parent
314dd0bee5
commit
155c379b74
@@ -83,6 +83,20 @@ void get_layout_from_cbfs_file(void)
|
|||||||
process_layout();
|
process_layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* get_layout_from_cmos_table
|
||||||
|
*
|
||||||
|
* Find the CMOS table which is stored within the coreboot table and set the
|
||||||
|
* global variable cmos_table to point to it.
|
||||||
|
****************************************************************************/
|
||||||
|
void get_layout_from_cmos_table(void)
|
||||||
|
{
|
||||||
|
get_lbtable();
|
||||||
|
cmos_table = (const struct cmos_option_table *)
|
||||||
|
find_lbrec(LB_TAG_CMOS_OPTION_TABLE);
|
||||||
|
process_layout();
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* process_cmos_table
|
* process_cmos_table
|
||||||
*
|
*
|
||||||
|
@@ -63,7 +63,6 @@ static const struct lb_header *lbtable_scan(unsigned long start,
|
|||||||
unsigned long end,
|
unsigned long end,
|
||||||
int *bad_header_count,
|
int *bad_header_count,
|
||||||
int *bad_table_count);
|
int *bad_table_count);
|
||||||
static const struct lb_record *find_lbrec(uint32_t tag);
|
|
||||||
static const char *lbrec_tag_to_str(uint32_t tag);
|
static const char *lbrec_tag_to_str(uint32_t tag);
|
||||||
static void memory_print_fn(const struct lb_record *rec);
|
static void memory_print_fn(const struct lb_record *rec);
|
||||||
static void mainboard_print_fn(const struct lb_record *rec);
|
static void mainboard_print_fn(const struct lb_record *rec);
|
||||||
@@ -215,11 +214,6 @@ static unsigned long low_phys_base = 0;
|
|||||||
/* Pointer to coreboot table. */
|
/* Pointer to coreboot table. */
|
||||||
static const struct lb_header *lbtable = NULL;
|
static const struct lb_header *lbtable = NULL;
|
||||||
|
|
||||||
/* The CMOS option table is located within the coreboot table. It tells us
|
|
||||||
* where the CMOS parameters are located in the nonvolatile RAM.
|
|
||||||
*/
|
|
||||||
static const struct cmos_option_table *cmos_table = NULL;
|
|
||||||
|
|
||||||
static const hexdump_format_t format =
|
static const hexdump_format_t format =
|
||||||
{ 12, 4, " ", " | ", " ", " | ", '.' };
|
{ 12, 4, " ", " | ", " ", " | ", '.' };
|
||||||
|
|
||||||
@@ -302,21 +296,6 @@ void get_lbtable(void)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* get_layout_from_cmos_table
|
|
||||||
*
|
|
||||||
* Find the CMOS table which is stored within the coreboot table and set the
|
|
||||||
* global variable cmos_table to point to it.
|
|
||||||
****************************************************************************/
|
|
||||||
void get_layout_from_cmos_table(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
get_lbtable();
|
|
||||||
cmos_table = (const struct cmos_option_table *)
|
|
||||||
find_lbrec(LB_TAG_CMOS_OPTION_TABLE);
|
|
||||||
process_layout();
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* dump_lbtable
|
* dump_lbtable
|
||||||
*
|
*
|
||||||
@@ -538,7 +517,7 @@ static const struct lb_header *lbtable_scan(unsigned long start,
|
|||||||
* Find the record in the coreboot table that matches 'tag'. Return pointer
|
* Find the record in the coreboot table that matches 'tag'. Return pointer
|
||||||
* to record on success or NULL if record not found.
|
* to record on success or NULL if record not found.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static const struct lb_record *find_lbrec(uint32_t tag)
|
const struct lb_record *find_lbrec(uint32_t tag)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
uint32_t bytes_processed;
|
uint32_t bytes_processed;
|
||||||
|
@@ -39,6 +39,7 @@ void get_layout_from_cbfs_file(void);
|
|||||||
void dump_lbtable(void);
|
void dump_lbtable(void);
|
||||||
void list_lbtable_choices(void);
|
void list_lbtable_choices(void);
|
||||||
void list_lbtable_item(const char item[]);
|
void list_lbtable_item(const char item[]);
|
||||||
|
const struct lb_record *find_lbrec(uint32_t tag);
|
||||||
|
|
||||||
void process_layout(void);
|
void process_layout(void);
|
||||||
#endif /* LBTABLE_H */
|
#endif /* LBTABLE_H */
|
||||||
|
Reference in New Issue
Block a user