Skip to content

Commit 7d2339a

Browse files
committed
biosdecode: Add support for the new _SM3_ 64-bit entry point defined in
SMBIOS specification version 3.0.0.
1 parent 7a3da0e commit 7d2339a

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2015-04-20 Jean Delvare <[email protected]>
2+
3+
* biosdecode.c: Add support for the _SM3_ entry point, as defined in
4+
the SMBIOS 3.0.0 specification.
5+
16
2014-11-14 Jean Delvare <[email protected]>
27

38
* man/dmidecode.8: Add a note about DMI strings available from sysfs

biosdecode.c

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* BIOS Decode
33
*
44
* Copyright (C) 2000-2002 Alan Cox <[email protected]>
5-
* Copyright (C) 2002-2008 Jean Delvare <[email protected]>
5+
* Copyright (C) 2002-2015 Jean Delvare <[email protected]>
66
*
77
* This program is free software; you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
@@ -25,8 +25,8 @@
2525
* are deemed to be part of the source code.
2626
*
2727
* References:
28-
* - DMTF "System Management BIOS Reference Specification"
29-
* Version 2.3.4
28+
* - DMTF "System Management BIOS (SMBIOS) Reference Specification"
29+
* Version 3.0.0
3030
* http://www.dmtf.org/standards/smbios
3131
* - Intel "Preboot Execution Environment (PXE) Specification"
3232
* Version 2.1
@@ -90,6 +90,26 @@ struct bios_entry {
9090
* SMBIOS
9191
*/
9292

93+
static size_t smbios3_length(const u8 *p)
94+
{
95+
return p[0x06];
96+
}
97+
98+
static int smbios3_decode(const u8 *p, size_t len)
99+
{
100+
if (len < 0x18 || !checksum(p, p[0x06]))
101+
return 0;
102+
103+
printf("SMBIOS %u.%u.%u present.\n",
104+
p[0x07], p[0x08], p[0x09]);
105+
printf("\tStructure Table Maximum Length: %u bytes\n",
106+
DWORD(p+0x0C));
107+
printf("\tStructure Table 64-bit Address: 0x%08X%08X\n",
108+
QWORD(p + 0x10).h, QWORD(p + 0x10).l);
109+
110+
return 1;
111+
}
112+
93113
static size_t smbios_length(const u8 *p)
94114
{
95115
return p[0x05] == 0x1E ? 0x1F : p[0x05];
@@ -530,6 +550,7 @@ static int fjkeyinf_decode(const u8 *p, size_t len)
530550
*/
531551

532552
static struct bios_entry bios_entries[] = {
553+
{ "_SM3_", 0, 0xF0000, 0xFFFFF, smbios3_length, smbios3_decode },
533554
{ "_SM_", 0, 0xF0000, 0xFFFFF, smbios_length, smbios_decode },
534555
{ "_DMI_", 0, 0xF0000, 0xFFFFF, dmi_length, dmi_decode },
535556
{ "_SYSID_", 0, 0xE0000, 0xFFFFF, sysid_length, sysid_decode },

0 commit comments

Comments
 (0)