dmidecode-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dmidecode] [PATCH] biosdecode: Add support for 64-bit SMBIOS entry poin


From: Jean Delvare
Subject: [dmidecode] [PATCH] biosdecode: Add support for 64-bit SMBIOS entry point
Date: Thu, 16 Apr 2015 10:13:59 +0200

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(-)

--- dmidecode.orig/biosdecode.c 2015-04-16 09:58:36.109606610 +0200
+++ dmidecode/biosdecode.c      2015-04-16 10:00:19.180803593 +0200
@@ -2,7 +2,7 @@
  * BIOS Decode
  *
  *   Copyright (C) 2000-2002 Alan Cox <address@hidden>
- *   Copyright (C) 2002-2008 Jean Delvare <address@hidden>
+ *   Copyright (C) 2002-2015 Jean Delvare <address@hidden>
  *
  *   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,
  */
 
 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 },


-- 
Jean Delvare
SUSE L3 Support



reply via email to

[Prev in Thread] Current Thread [Next in Thread]