diff options
author | Christian Gmeiner | 2020-11-03 15:34:51 +0100 |
---|---|---|
committer | Bin Meng | 2020-11-05 14:58:45 +0800 |
commit | 415eab0655a8bdfa07464e2b3f9724a198afc81f (patch) | |
tree | e1e86f4ddb31018eb69416446755725d3b811c31 /include/smbios.h | |
parent | 9d20db0483d54b507472fc33ee0c8a71d6c71c85 (diff) |
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>
Diffstat (limited to 'include/smbios.h')
-rw-r--r-- | include/smbios.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/smbios.h b/include/smbios.h index 97b9ddce237..44f49e9556b 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -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_ */ |