#include <string.h>#include <sys/mman.h>#include "common.h"#include "coreboot_tables.h"#include "ip_checksum.h"#include "lbtable.h"#include "layout.h"#include "cmos_lowlevel.h"#include "hexdump.h"

Go to the source code of this file.
Data Structures | |
| struct | lbtable_choice_t |
| struct | mem_range_t |
Defines | |
| #define | NUM_LBTABLE_CHOICES 14 |
| #define | NUM_MEM_RANGES 2 |
| #define | vtophys(vaddr) |
| #define | phystov(paddr) |
Typedefs | |
| typedef void(* | lbtable_print_fn_t )(const struct lb_record *rec) |
Functions | |
| static struct lb_header * | lbtable_scan (unsigned long start, unsigned long end, int *bad_header_count, int *bad_table_count) |
| static void | process_cmos_table (void) |
| static void | get_cmos_checksum_info (void) |
| static void | try_convert_checksum_layout (cmos_checksum_layout_t *layout) |
| static void | try_add_cmos_table_enum (cmos_enum_t *cmos_enum) |
| static void | try_add_cmos_table_entry (cmos_entry_t *cmos_entry) |
| static struct lb_record * | find_lbrec (uint32_t tag) |
| static const char * | lbrec_tag_to_str (uint32_t tag) |
| static struct cmos_entries * | first_cmos_table_entry (void) |
| static struct cmos_entries * | next_cmos_table_entry (const struct cmos_entries *last) |
| static struct cmos_enums * | first_cmos_table_enum (void) |
| static struct cmos_enums * | next_cmos_table_enum (const struct cmos_enums *last) |
| static struct lb_record * | first_cmos_rec (uint32_t tag) |
| static struct lb_record * | next_cmos_rec (const struct lb_record *last, uint32_t tag) |
| static void | memory_print_fn (const struct lb_record *rec) |
| static void | mainboard_print_fn (const struct lb_record *rec) |
| static void | cmos_opt_table_print_fn (const struct lb_record *rec) |
| static void | print_option_record (const struct cmos_entries *cmos_entry) |
| static void | print_enum_record (const struct cmos_enums *cmos_enum) |
| static void | print_defaults_record (const struct cmos_defaults *cmos_defaults) |
| static void | print_unknown_record (const struct lb_record *cmos_item) |
| static void | option_checksum_print_fn (const struct lb_record *rec) |
| static void | string_print_fn (const struct lb_record *rec) |
| static void | uint64_to_hex_string (char str[], uint64_t n) |
| void | get_lbtable (void) |
| void | get_layout_from_cmos_table (void) |
| void | dump_lbtable (void) |
| void | list_lbtable_choices (void) |
| void | list_lbtable_item (const char item[]) |
Variables | |
| static const char | memory_desc [] |
| static const char | mainboard_desc [] |
| static const char | version_desc [] |
| static const char | extra_version_desc [] |
| static const char | build_desc [] |
| static const char | compile_time_desc [] |
| static const char | compile_by_desc [] |
| static const char | compile_host_desc [] |
| static const char | compile_domain_desc [] |
| static const char | compiler_desc [] |
| static const char | linker_desc [] |
| static const char | assembler_desc [] |
| static const char | cmos_opt_table_desc [] |
| static const char | option_checksum_desc [] |
| static const char | generic_nofound_msg [] |
| static const char | nofound_msg_cmos_opt_table [] |
| static const char | nofound_msg_option_checksum [] |
| static const lbtable_choice_t | lbtable_choices [NUM_LBTABLE_CHOICES] |
| static const mem_range_t | mem_ranges [NUM_MEM_RANGES] |
| static const size_t | BYTES_TO_MAP = (1024 * 1024) |
| static const void * | low_phys_mem |
| static struct lb_header * | lbtable = NULL |
| static struct cmos_option_table * | cmos_table = NULL |
| static const hexdump_format_t | format |
| #define NUM_LBTABLE_CHOICES 14 |
Definition at line 155 of file lbtable.c.
Referenced by list_lbtable_choices(), and list_lbtable_item().
| #define NUM_MEM_RANGES 2 |
| #define phystov | ( | paddr | ) |
Value:
(((unsigned long) low_phys_mem) + \ ((unsigned long) paddr))
Definition at line 274 of file lbtable.c.
Referenced by get_lbtable().
| #define vtophys | ( | vaddr | ) |
Value:
(((unsigned long) vaddr) - \ ((unsigned long) low_phys_mem))
Definition at line 263 of file lbtable.c.
Referenced by cmos_opt_table_print_fn(), dump_lbtable(), print_defaults_record(), print_enum_record(), print_option_record(), and print_unknown_record().
| typedef void(* lbtable_print_fn_t)(const struct lb_record *rec) |
| static void cmos_opt_table_print_fn | ( | const struct lb_record * | rec | ) | [static] |
Definition at line 1070 of file lbtable.c.
References cmos_option_table::header_length, LB_TAG_OPTION, LB_TAG_OPTION_DEFAULTS, LB_TAG_OPTION_ENUM, print_defaults_record(), print_enum_record(), print_option_record(), print_unknown_record(), printf, lb_record::size, cmos_option_table::size, lb_record::tag, cmos_option_table::tag, and vtophys.

| void dump_lbtable | ( | void | ) |
Definition at line 364 of file lbtable.c.
References data, lb_header::header_bytes, lb_header::header_checksum, hexdump(), lbrec_tag_to_str(), printf, lb_header::signature, lb_record::size, lb_header::table_bytes, lb_header::table_checksum, lb_header::table_entries, lb_record::tag, and vtophys.
Referenced by op_lbtable_dump().


Definition at line 799 of file lbtable.c.
References lb_header::header_bytes, NULL, lb_record::size, lb_header::table_bytes, and lb_record::tag.
Referenced by get_cmos_checksum_info(), get_layout_from_cmos_table(), and list_lbtable_item().

Definition at line 941 of file lbtable.c.
References cmos_option_table::header_length, NULL, lb_record::size, cmos_option_table::size, and lb_record::tag.
Referenced by first_cmos_table_entry(), and first_cmos_table_enum().

| static struct cmos_entries * first_cmos_table_entry | ( | void | ) | [static, read] |
Definition at line 887 of file lbtable.c.
References first_cmos_rec(), and LB_TAG_OPTION.
Referenced by process_cmos_table().


| static struct cmos_enums * first_cmos_table_enum | ( | void | ) | [static, read] |
Definition at line 909 of file lbtable.c.
References first_cmos_rec(), and LB_TAG_OPTION_ENUM.
Referenced by process_cmos_table().


| static void get_cmos_checksum_info | ( | void | ) | [static] |
Definition at line 607 of file lbtable.c.
References cmos_entry_t::bit, cmos_checksum_layout_t::checksum_at, checksum_param_name, cmos_checksum_end, cmos_checksum_index, cmos_checksum_start, find_cmos_entry(), find_lbrec(), index, LB_TAG_OPTION_CHECKSUM, cmos_checksum::location, NULL, prog_name, cmos_checksum::range_end, cmos_checksum::range_start, cmos_checksum_layout_t::summed_area_end, cmos_checksum_layout_t::summed_area_start, try_convert_checksum_layout(), and verify_cmos_byte_index().
Referenced by get_layout_from_cmos_table().


| void get_layout_from_cmos_table | ( | void | ) |
Definition at line 339 of file lbtable.c.
References find_lbrec(), get_cmos_checksum_info(), get_lbtable(), LB_TAG_CMOS_OPTION_TABLE, NULL, process_cmos_table(), and prog_name.
Referenced by main().


| void get_lbtable | ( | void | ) |
Definition at line 282 of file lbtable.c.
References BYTES_TO_MAP, lbtable_scan(), low_phys_mem, NULL, NUM_MEM_RANGES, phystov, and prog_name.
Referenced by get_layout_from_cmos_table(), op_lbtable_dump(), and op_lbtable_show_info().


| static const char * lbrec_tag_to_str | ( | uint32_t | tag | ) | [static] |
Definition at line 824 of file lbtable.c.
References LB_TAG_ASSEMBLER, LB_TAG_BUILD, LB_TAG_CMOS_OPTION_TABLE, LB_TAG_COMPILE_BY, LB_TAG_COMPILE_DOMAIN, LB_TAG_COMPILE_HOST, LB_TAG_COMPILE_TIME, LB_TAG_COMPILER, LB_TAG_EXTRA_VERSION, LB_TAG_HWRPB, LB_TAG_LINKER, LB_TAG_MAINBOARD, LB_TAG_MEMORY, LB_TAG_OPTION_CHECKSUM, LB_TAG_UNUSED, and LB_TAG_VERSION.
Referenced by dump_lbtable().

| static struct lb_header * lbtable_scan | ( | unsigned long | start, | |
| unsigned long | end, | |||
| int * | bad_header_count, | |||
| int * | bad_table_count | |||
| ) | [static, read] |
Definition at line 491 of file lbtable.c.
References compute_ip_checksum(), NULL, lb_header::signature, table(), lb_header::table_bytes, and lb_header::table_checksum.
Referenced by get_lbtable().


| void list_lbtable_choices | ( | void | ) |
Definition at line 424 of file lbtable.c.
References name, NUM_LBTABLE_CHOICES, and printf.
Referenced by op_lbtable_show_info().

| void list_lbtable_item | ( | const char | item[] | ) |
Definition at line 443 of file lbtable.c.
References find_lbrec(), name, NULL, NUM_LBTABLE_CHOICES, lbtable_choice_t::print_fn, prog_name, strcmp(), and lb_record::tag.
Referenced by op_lbtable_show_info().


| static void mainboard_print_fn | ( | const struct lb_record * | rec | ) | [static] |
Definition at line 1055 of file lbtable.c.
References lb_mainboard::part_number_idx, printf, lb_mainboard::strings, and lb_mainboard::vendor_idx.
| static void memory_print_fn | ( | const struct lb_record * | rec | ) | [static] |
Definition at line 995 of file lbtable.c.
References LB_MEM_RAM, LB_MEM_RESERVED, LB_MEM_TABLE, lb_memory::map, printf, lb_memory::size, lb_memory_range::size, lb_memory_range::start, uint64_to_hex_string(), and unpack_lb64().

| static struct lb_record * next_cmos_rec | ( | const struct lb_record * | last, | |
| uint32_t | tag | |||
| ) | [static, read] |
Definition at line 968 of file lbtable.c.
References cmos_option_table::header_length, NULL, lb_record::size, cmos_option_table::size, and lb_record::tag.
Referenced by next_cmos_table_entry(), and next_cmos_table_enum().

| static struct cmos_entries * next_cmos_table_entry | ( | const struct cmos_entries * | last | ) | [static, read] |
Definition at line 897 of file lbtable.c.
References LB_TAG_OPTION, and next_cmos_rec().
Referenced by process_cmos_table().


| static struct cmos_enums * next_cmos_table_enum | ( | const struct cmos_enums * | last | ) | [static, read] |
Definition at line 920 of file lbtable.c.
References LB_TAG_OPTION_ENUM, and next_cmos_rec().
Referenced by process_cmos_table().


| static void option_checksum_print_fn | ( | const struct lb_record * | rec | ) | [static] |
Definition at line 1232 of file lbtable.c.
References CHECKSUM_PCBIOS, cmos_checksum::location, printf, cmos_checksum::range_end, cmos_checksum::range_start, and cmos_checksum::type.
| static void print_defaults_record | ( | const struct cmos_defaults * | cmos_defaults | ) | [static] |
Definition at line 1193 of file lbtable.c.
References CMOS_IMAGE_BUFFER_SIZE, cmos_defaults::default_set, hexdump(), cmos_defaults::name, cmos_defaults::name_length, printf, cmos_defaults::size, cmos_defaults::tag, and vtophys.
Referenced by cmos_opt_table_print_fn().


| static void print_enum_record | ( | const struct cmos_enums * | cmos_enum | ) | [static] |
Definition at line 1176 of file lbtable.c.
References cmos_enums::config_id, printf, cmos_enums::size, cmos_enums::tag, cmos_enums::text, cmos_enums::value, and vtophys.
Referenced by cmos_opt_table_print_fn().

| static void print_option_record | ( | const struct cmos_entries * | cmos_entry | ) | [static] |
Definition at line 1134 of file lbtable.c.
References cmos_entries::bit, cmos_entries::config, cmos_entries::config_id, cmos_entries::length, cmos_entries::name, printf, cmos_entries::size, strcpy(), cmos_entries::tag, and vtophys.
Referenced by cmos_opt_table_print_fn().


| static void print_unknown_record | ( | const struct lb_record * | cmos_item | ) | [static] |
Definition at line 1213 of file lbtable.c.
References data, hexdump(), printf, lb_record::size, lb_record::tag, and vtophys.
Referenced by cmos_opt_table_print_fn().


| static void process_cmos_table | ( | void | ) | [static] |
Definition at line 549 of file lbtable.c.
References cmos_entries::bit, cmos_entry_t::bit, CMOS_ENTRY_ENUM, CMOS_ENTRY_HEX, CMOS_ENTRY_RESERVED, CMOS_ENTRY_STRING, CMOS_MAX_NAME_LENGTH, CMOS_MAX_TEXT_LENGTH, cmos_entry_t::config, cmos_entries::config, cmos_entries::config_id, cmos_entry_t::config_id, cmos_enums::config_id, cmos_enum_t::config_id, first_cmos_table_entry(), first_cmos_table_enum(), cmos_entries::length, cmos_entry_t::length, cmos_entries::name, cmos_entry_t::name, next_cmos_table_entry(), next_cmos_table_enum(), NULL, prog_name, strncpy(), cmos_enums::text, cmos_enum_t::text, try_add_cmos_table_entry(), try_add_cmos_table_enum(), cmos_enums::value, and cmos_enum_t::value.
Referenced by get_layout_from_cmos_table().


| static void string_print_fn | ( | const struct lb_record * | rec | ) | [static] |
| static void try_add_cmos_table_entry | ( | cmos_entry_t * | cmos_entry | ) | [static] |
Definition at line 754 of file lbtable.c.
References add_cmos_entry(), BUG, CMOS_AREA_OUT_OF_RANGE, CMOS_AREA_TOO_WIDE, LAYOUT_ENTRY_BAD_LENGTH, LAYOUT_ENTRY_OVERLAP, cmos_entry_t::name, OK, and prog_name.
Referenced by process_cmos_table().


| static void try_add_cmos_table_enum | ( | cmos_enum_t * | cmos_enum | ) | [static] |
Definition at line 731 of file lbtable.c.
References add_cmos_enum(), BUG, LAYOUT_DUPLICATE_ENUM, OK, prog_name, and cmos_enum_t::text.
Referenced by process_cmos_table().


| static void try_convert_checksum_layout | ( | cmos_checksum_layout_t * | layout | ) | [static] |
Definition at line 670 of file lbtable.c.
References BUG, checksum_layout_to_bytes(), LAYOUT_CHECKSUM_LOCATION_NOT_ALIGNED, LAYOUT_CHECKSUM_LOCATION_OUT_OF_RANGE, LAYOUT_CHECKSUM_OVERLAPS_SUMMED_AREA, LAYOUT_INVALID_SUMMED_AREA, LAYOUT_SUMMED_AREA_END_NOT_ALIGNED, LAYOUT_SUMMED_AREA_OUT_OF_RANGE, LAYOUT_SUMMED_AREA_START_NOT_ALIGNED, OK, and prog_name.
Referenced by get_cmos_checksum_info().


| static void uint64_to_hex_string | ( | char | str[], | |
| uint64_t | n | |||
| ) | [static] |
Definition at line 1264 of file lbtable.c.
References sprintf().
Referenced by memory_print_fn().


const char assembler_desc[] [static] |
const char build_desc[] [static] |
const size_t BYTES_TO_MAP = (1024 * 1024) [static] |
const char cmos_opt_table_desc[] [static] |
struct cmos_option_table* cmos_table = NULL [static] |
const char compile_by_desc[] [static] |
const char compile_domain_desc[] [static] |
const char compile_host_desc[] [static] |
const char compile_time_desc[] [static] |
const char compiler_desc[] [static] |
const char extra_version_desc[] [static] |
const hexdump_format_t format [static] |
const char generic_nofound_msg[] [static] |
const lbtable_choice_t lbtable_choices[NUM_LBTABLE_CHOICES] [static] |
const char linker_desc[] [static] |
const void* low_phys_mem [static] |