#include <stdio.h>#include <stdint.h>#include <stdlib.h>#include <fcntl.h>#include <unistd.h>#include <sys/types.h>#include <string.h>#include <errno.h>#include <sys/mman.h>#include "flash.h"#include "coreboot_tables.h"

Go to the source code of this file.
Defines | |
| #define | for_each_lbrec(head, rec) |
Functions | |
| static unsigned long | compute_checksum (void *addr, unsigned long length) |
| static int | count_lb_records (struct lb_header *head) |
| static struct lb_header * | find_lb_table (void *base, unsigned long start, unsigned long end) |
| static void | find_mainboard (struct lb_record *ptr, unsigned long addr) |
| static struct lb_record * | next_record (struct lb_record *rec) |
| static void | search_lb_records (struct lb_record *rec, struct lb_record *last, unsigned long addr) |
| int | coreboot_init (void) |
Variables | |
| char * | lb_part = NULL |
| char * | lb_vendor = NULL |
| #define for_each_lbrec | ( | head, | |||
| rec | ) |
Value:
for(rec = (struct lb_record *)(((char *)head) + sizeof(*head)); \ (((char *)rec) < (((char *)head) + sizeof(*head) + head->table_bytes)) && \ (rec->size >= 1) && \ ((((char *)rec) + rec->size) <= (((char *)head) + sizeof(*head) + head->table_bytes)); \ rec = (struct lb_record *)(((char *)rec) + rec->size))
Definition at line 72 of file cbtable.c.
Referenced by count_lb_records().
| static unsigned long compute_checksum | ( | void * | addr, | |
| unsigned long | length | |||
| ) | [static] |
Definition at line 38 of file cbtable.c.
References value.
Referenced by find_lb_table().

| int coreboot_init | ( | void | ) |
Definition at line 184 of file cbtable.c.
References addr, fd_mem, find_lb_table(), last, MEM_DEV, printf, printf_debug, and search_lb_records().
Referenced by main().


| static int count_lb_records | ( | struct lb_header * | head | ) | [static] |
Definition at line 79 of file cbtable.c.
References for_each_lbrec.
Referenced by find_lb_table().

| static struct lb_header* find_lb_table | ( | void * | base, | |
| unsigned long | start, | |||
| unsigned long | end | |||
| ) | [static, read] |
Definition at line 92 of file cbtable.c.
References addr, compute_checksum(), count_lb_records(), lb_header::header_bytes, memcmp(), printf_debug, lb_header::signature, lb_header::table_bytes, and lb_header::table_entries.
Referenced by coreboot_init(), and main().


| static void find_mainboard | ( | struct lb_record * | ptr, | |
| unsigned long | addr | |||
| ) | [static] |
Definition at line 135 of file cbtable.c.
References lb_part, lb_vendor, lb_mainboard::part_number_idx, printf, lb_mainboard::size, strdup(), lb_mainboard::strings, vendor, and lb_mainboard::vendor_idx.
Referenced by search_lb_records().


Definition at line 161 of file cbtable.c.
References lb_record::size.
Referenced by print_lb_records(), and search_lb_records().

| static void search_lb_records | ( | struct lb_record * | rec, | |
| struct lb_record * | last, | |||
| unsigned long | addr | |||
| ) | [static] |
Definition at line 166 of file cbtable.c.
References find_mainboard(), LB_TAG_MAINBOARD, next_record(), lb_record::size, and lb_record::tag.
Referenced by coreboot_init().


| char* lb_part = NULL |
Definition at line 36 of file cbtable.c.
Referenced by find_mainboard(), main(), print_supported_boards(), and show_id().
| char * lb_vendor = NULL |
Definition at line 36 of file cbtable.c.
Referenced by find_mainboard(), main(), print_supported_boards(), and show_id().
1.5.5