summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/conf/NOTES2
-rw-r--r--sys/conf/files.amd641
-rw-r--r--sys/i386/bios/smbios.c26
3 files changed, 25 insertions, 4 deletions
diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES
index facd111..4ee9a90 100644
--- a/sys/amd64/conf/NOTES
+++ b/sys/amd64/conf/NOTES
@@ -299,6 +299,7 @@ options SAFE_RNDTEST # enable rndtest support
#
# cy: Cyclades serial driver
# digi: Digiboard driver
+# smbios: DMI/SMBIOS entry point
# Notes on the Specialix SI/XIO driver:
# The host card is memory, not IO mapped.
@@ -321,6 +322,7 @@ device digi_Xr
device pbio
hint.pbio.0.at="isa"
hint.pbio.0.port="0x360"
+device smbios
# sx device is i386 and pc98 only at the moment.
device sx
options SX_DEBUG
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index 467c9b7..4bfda27e 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -229,6 +229,7 @@ compat/ndis/subr_ntoskrnl.c optional ndisapi pci
compat/ndis/subr_pe.c optional ndisapi pci
compat/ndis/subr_usbd.c optional ndisapi pci
compat/ndis/winx64_wrap.S optional ndisapi pci
+i386/bios/smbios.c optional smbios
i386/cpufreq/powernow.c optional cpufreq
i386/cpufreq/est.c optional cpufreq
i386/cpufreq/p4tcc.c optional cpufreq
diff --git a/sys/i386/bios/smbios.c b/sys/i386/bios/smbios.c
index f9ceae2..c620b4c 100644
--- a/sys/i386/bios/smbios.c
+++ b/sys/i386/bios/smbios.c
@@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$");
#include <machine/pc/bios.h>
/*
+ * System Management BIOS Reference Specification, v2.4 Final
+ * http://www.dmtf.org/standards/published_documents/DSP0134.pdf
+ */
+
+/*
* SMBIOS Entry Point Structure
*/
struct smbios_eps {
@@ -55,9 +60,9 @@ struct smbios_eps {
u_int8_t SMBIOS_Major;
u_int8_t SMBIOS_Minor;
- u_int8_t Max_Size;
+ u_int16_t Max_Size;
u_int8_t Revision;
- u_int8_t Formatted_Area;
+ u_int8_t Formatted_Area[5];
u_int8_t Intermediate_Anchor[5]; /* '_DMI_' */
u_int8_t Intermediate_Checksum;
@@ -113,6 +118,19 @@ smbios_identify (driver_t *driver, device_t parent)
rid = 0;
length = ADDR2EPS(addr)->Length;
+ if (length != 0x1f) {
+ u_int8_t major, minor;
+
+ major = ADDR2EPS(addr)->SMBIOS_Major;
+ minor = ADDR2EPS(addr)->SMBIOS_Minor;
+
+ /* SMBIOS v2.1 implementation might use 0x1e. */
+ if (length == 0x1e && major == 2 && minor == 1)
+ length = 0x1f;
+ else
+ return;
+ }
+
child = BUS_ADD_CHILD(parent, 0, "smbios", -1);
device_set_driver(child, driver);
bus_set_resource(child, SYS_RES_MEMORY, rid, addr, length);
@@ -170,10 +188,10 @@ smbios_attach (device_t dev)
}
sc->eps = RES2EPS(sc->res);
- device_printf(dev, "Version: %d.%02d",
+ device_printf(dev, "Version: %u.%u",
sc->eps->SMBIOS_Major, sc->eps->SMBIOS_Minor);
if (bcd2bin(sc->eps->SMBIOS_BCD_Revision))
- printf(", Revision: %d.%02d",
+ printf(", BCD Revision: %u.%u",
bcd2bin(sc->eps->SMBIOS_BCD_Revision >> 4),
bcd2bin(sc->eps->SMBIOS_BCD_Revision & 0x0f));
printf("\n");
OpenPOWER on IntegriCloud