85 if ( ( entry->
len < sizeof ( *entry ) ) ||
87 DBGC ( &
smbios,
"SMBIOS at %#08lx has bad length "
88 "%#02x\n", virt_to_phys ( entry ), entry->
len );
94 DBGC ( &
smbios,
"SMBIOS at %#08lx has bad checksum "
95 "%#02x\n", virt_to_phys ( entry ), sum );
100 DBGC ( &
smbios,
"Found SMBIOS v%d.%d entry point at %#08lx\n",
101 entry->
major, entry->
minor, virt_to_phys ( entry ) );
131 if ( ( entry->
len < sizeof ( *entry ) ) ||
133 DBGC ( &
smbios,
"SMBIOS at %#08lx has bad length "
134 "%#02x\n", virt_to_phys ( entry ), entry->
len );
140 DBGC ( &
smbios,
"SMBIOS3 at %#08lx has bad checksum "
141 "%#02x\n", virt_to_phys ( entry ), sum );
146 DBGC ( &
smbios,
"Found SMBIOS3 v%d.%d entry point at %#08lx\n",
147 entry->
major, entry->
minor, virt_to_phys ( entry ) );
184 unsigned int instance ) {
186 unsigned int count = 0;
188 size_t strings_offset;
189 size_t terminator_offset;
207 strings_offset = (
offset + structure->
len );
209 DBGC ( &
smbios,
"SMBIOS structure at offset %#zx "
210 "with length %#x extends beyond SMBIOS\n",
215 if ( ! terminator_offset ) {
216 DBGC ( &
smbios,
"SMBIOS structure at offset %#zx has "
217 "unterminated strings section\n",
offset );
220 strings_len = ( terminator_offset - strings_offset);
221 DBGC ( &
smbios,
"SMBIOS structure at offset %#zx has type %d, "
222 "length %#x, strings length %#zx\n",
offset,
223 structure->
type, structure->
len, strings_len );
232 ( instance-- == 0 ) ) {
237 offset = ( terminator_offset + 1 );
253 unsigned int index ) {
262 string = ( ( (
const void * ) structure ) + structure->
len );
263 for ( i =
index ; i-- ; ) {
273 string += (
len + 1 );
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
#define assert(condition)
Assert a condition at run-time.
uint16_t offset
Offset to command line.
uint32_t type
Operating system type.
uint32_t start
Starting offset.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define SMBIOS3_SIGNATURE
Signature for 64-bit SMBIOS entry point.
#define SMBIOS_SIGNATURE
Signature for 32-bit SMBIOS entry point.
int find_smbios(struct smbios *smbios)
#define SMBIOS_TYPE_END
SMBIOS end of table type.
Access to external ("user") memory.
const char * smbios_string(const struct smbios_header *structure, unsigned int index)
Get indexed string within SMBIOS structure.
static size_t find_strings_terminator(size_t offset)
Find SMBIOS strings terminator.
static uint8_t smbios_checksum(const void *start, size_t len)
Calculate SMBIOS entry point structure checksum.
const struct smbios_entry * find_smbios_entry(const void *start, size_t len)
Scan for SMBIOS 32-bit entry point structure.
void smbios_clear(void)
Clear SMBIOS entry point descriptor.
const struct smbios3_entry * find_smbios3_entry(const void *start, size_t len)
Scan for SMBIOS 64-bit entry point structure.
const struct smbios_header * smbios_structure(unsigned int type, unsigned int instance)
Find specific structure type within SMBIOS.
int smbios_version(void)
Get SMBIOS version.
size_t strlen(const char *src)
Get length of string.
SMBIOS 64-bit entry point.
uint8_t major
Major version.
uint8_t minor
Minor version.
uint32_t signature
Signature.
SMBIOS 32-bit entry point.
uint8_t minor
Minor version.
uint32_t signature
Signature.
uint8_t major
Major version.
SMBIOS entry point descriptor.
size_t len
Length of SMBIOS structures.
unsigned int count
Number of SMBIOS structures.
uint16_t version
SMBIOS version.
const void * address
Start of SMBIOS structures.