From 7d2339a491ce212d29cffb55a9f3f4b8be338ba4 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 20 Apr 2015 15:13:28 +0000 Subject: biosdecode: Add support for the new _SM3_ 64-bit entry point defined in SMBIOS specification version 3.0.0. --- biosdecode.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'biosdecode.c') diff --git a/biosdecode.c b/biosdecode.c index 9ac35dc..daceb02 100644 --- a/biosdecode.c +++ b/biosdecode.c @@ -2,7 +2,7 @@ * BIOS Decode * * Copyright (C) 2000-2002 Alan Cox - * Copyright (C) 2002-2008 Jean Delvare + * Copyright (C) 2002-2015 Jean Delvare * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,8 +25,8 @@ * are deemed to be part of the source code. * * References: - * - DMTF "System Management BIOS Reference Specification" - * Version 2.3.4 + * - DMTF "System Management BIOS (SMBIOS) Reference Specification" + * Version 3.0.0 * http://www.dmtf.org/standards/smbios * - Intel "Preboot Execution Environment (PXE) Specification" * Version 2.1 @@ -90,6 +90,26 @@ struct bios_entry { * SMBIOS */ +static size_t smbios3_length(const u8 *p) +{ + return p[0x06]; +} + +static int smbios3_decode(const u8 *p, size_t len) +{ + if (len < 0x18 || !checksum(p, p[0x06])) + return 0; + + printf("SMBIOS %u.%u.%u present.\n", + p[0x07], p[0x08], p[0x09]); + printf("\tStructure Table Maximum Length: %u bytes\n", + DWORD(p+0x0C)); + printf("\tStructure Table 64-bit Address: 0x%08X%08X\n", + QWORD(p + 0x10).h, QWORD(p + 0x10).l); + + return 1; +} + static size_t smbios_length(const u8 *p) { return p[0x05] == 0x1E ? 0x1F : p[0x05]; @@ -530,6 +550,7 @@ static int fjkeyinf_decode(const u8 *p, size_t len) */ static struct bios_entry bios_entries[] = { + { "_SM3_", 0, 0xF0000, 0xFFFFF, smbios3_length, smbios3_decode }, { "_SM_", 0, 0xF0000, 0xFFFFF, smbios_length, smbios_decode }, { "_DMI_", 0, 0xF0000, 0xFFFFF, dmi_length, dmi_decode }, { "_SYSID_", 0, 0xE0000, 0xFFFFF, sysid_length, sysid_decode }, -- cgit v1.2.1