84 if ( ( entry->
len < sizeof ( *entry ) ) ||
86 DBGC ( &
smbios,
"SMBIOS at %#08lx has bad length " 87 "%#02x\n", virt_to_phys ( entry ), entry->
len );
93 DBGC ( &
smbios,
"SMBIOS at %#08lx has bad checksum " 94 "%#02x\n", virt_to_phys ( entry ), sum );
99 DBGC ( &
smbios,
"Found SMBIOS v%d.%d entry point at %#08lx\n",
100 entry->
major, entry->
minor, virt_to_phys ( entry ) );
130 if ( ( entry->
len < sizeof ( *entry ) ) ||
132 DBGC ( &
smbios,
"SMBIOS at %#08lx has bad length " 133 "%#02x\n", virt_to_phys ( entry ), entry->
len );
139 DBGC ( &
smbios,
"SMBIOS3 at %#08lx has bad checksum " 140 "%#02x\n", virt_to_phys ( entry ), sum );
145 DBGC ( &
smbios,
"Found SMBIOS3 v%d.%d entry point at %#08lx\n",
146 entry->
major, entry->
minor, virt_to_phys ( entry ) );
183 unsigned int instance ) {
185 unsigned int count = 0;
187 size_t strings_offset;
188 size_t terminator_offset;
206 strings_offset = (
offset + structure->
len );
208 DBGC ( &
smbios,
"SMBIOS structure at offset %#zx " 209 "with length %#x extends beyond SMBIOS\n",
214 if ( ! terminator_offset ) {
215 DBGC ( &
smbios,
"SMBIOS structure at offset %#zx has " 216 "unterminated strings section\n",
offset );
219 strings_len = ( terminator_offset - strings_offset);
220 DBGC ( &
smbios,
"SMBIOS structure at offset %#zx has type %d, " 221 "length %#x, strings length %#zx\n",
offset,
222 structure->
type, structure->
len, strings_len );
231 ( instance-- == 0 ) ) {
236 offset = ( terminator_offset + 1 );
252 unsigned int index ) {
261 string = ( ( (
const void * ) structure ) + structure->
len );
262 for ( i =
index ; i-- ; ) {
272 string += (
len + 1 );
uint32_t signature
Signature.
struct arbelprm_rc_send_wqe rc
#define SMBIOS_SIGNATURE
Signature for 32-bit SMBIOS entry point.
unsigned int count
Number of SMBIOS structures.
const char * smbios_string(const struct smbios_header *structure, unsigned int index)
Get indexed string within SMBIOS structure.
#define SMBIOS_TYPE_END
SMBIOS end of table type.
uint32_t type
Operating system type.
size_t len
Length of SMBIOS structures.
const struct smbios_header * smbios_structure(unsigned int type, unsigned int instance)
Find specific structure type within SMBIOS.
SMBIOS entry point descriptor.
#define SMBIOS3_SIGNATURE
Signature for 64-bit SMBIOS entry point.
int find_smbios(struct smbios *smbios)
uint16_t version
SMBIOS version.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void smbios_clear(void)
Clear SMBIOS entry point descriptor.
uint32_t start
Starting offset.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
Access to external ("user") memory.
uint32_t signature
Signature.
SMBIOS 32-bit entry point.
static unsigned int count
Number of entries.
int smbios_version(void)
Get SMBIOS version.
const void * address
Start of SMBIOS structures.
size_t strlen(const char *src)
Get length of string.
const struct smbios_entry * find_smbios_entry(const void *start, size_t len)
Scan for SMBIOS 32-bit entry point structure.
uint8_t minor
Minor version.
uint8_t minor
Minor version.
const struct smbios3_entry * find_smbios3_entry(const void *start, size_t len)
Scan for SMBIOS 64-bit entry point structure.
static uint8_t smbios_checksum(const void *start, size_t len)
Calculate SMBIOS entry point structure checksum.
uint16_t offset
Offset to command line.
uint8_t major
Major version.
#define NULL
NULL pointer (VOID *)
static size_t find_strings_terminator(size_t offset)
Find SMBIOS strings terminator.
uint8_t major
Major version.
SMBIOS 64-bit entry point.