Fix smbios(4) and add support for amd64

Approved by:	anholt (mentor)
This commit is contained in:
Jung-uk Kim 2005-07-21 00:18:28 +00:00
parent ac0ba90dc8
commit a52daa5fd2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148217
3 changed files with 25 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -45,6 +45,11 @@ __FBSDID("$FreeBSD$");
#include <machine/md_var.h>
#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
*/
@ -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");