1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 01:02:19 +02:00

smbios: add parsing API

Add a very simple API to be able to access SMBIOS strings
like vendor, model and bios version.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Christian Gmeiner
2020-11-03 15:34:51 +01:00
committed by Bin Meng
parent 9d20db0483
commit 415eab0655
4 changed files with 129 additions and 0 deletions

View File

@@ -237,4 +237,31 @@ typedef int (*smbios_write_type)(ulong *addr, int handle);
*/
ulong write_smbios_table(ulong addr);
/**
* smbios_entry() - Get a valid struct smbios_entry pointer
*
* @address: address where smbios tables is located
* @size: size of smbios table
* @return: NULL or a valid pointer to a struct smbios_entry
*/
const struct smbios_entry *smbios_entry(u64 address, u32 size);
/**
* smbios_header() - Search for SMBIOS header type
*
* @entry: pointer to a struct smbios_entry
* @type: SMBIOS type
* @return: NULL or a valid pointer to a struct smbios_header
*/
const struct smbios_header *smbios_header(const struct smbios_entry *entry, int type);
/**
* smbios_string() - Return string from SMBIOS
*
* @header: pointer to struct smbios_header
* @index: string index
* @return: NULL or a valid const char pointer
*/
const char *smbios_string(const struct smbios_header *header, int index);
#endif /* _SMBIOS_H_ */