diff options
author | jhb <jhb@FreeBSD.org> | 2012-09-28 11:59:32 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2012-09-28 11:59:32 +0000 |
commit | f643d4c50acbb3d6c4a9aa07dc0ae5c1c5e1e1ac (patch) | |
tree | c950d3dbe6e28fe65f089b61ff9eb6e8d1c3d72a /sys/x86/bios | |
parent | 9546d5704f623014fe246f3504b52075ae5a96ef (diff) | |
download | FreeBSD-src-f643d4c50acbb3d6c4a9aa07dc0ae5c1c5e1e1ac.zip FreeBSD-src-f643d4c50acbb3d6c4a9aa07dc0ae5c1c5e1e1ac.tar.gz |
- Re-shuffle the <machine/pc/bios.h> headers to move all kernel-specific
bits under #ifdef _KERNEL but leave definitions for various structures
defined by standards ($PIR table, SMAP entries, etc.) available to
userland.
- Consolidate duplicate SMBIOS table structure definitions in ipmi(4)
and smbios(4) in <machine/pc/bios.h> and make them available to
userland.
MFC after: 2 weeks
Diffstat (limited to 'sys/x86/bios')
-rw-r--r-- | sys/x86/bios/smbios.c | 46 |
1 files changed, 8 insertions, 38 deletions
diff --git a/sys/x86/bios/smbios.c b/sys/x86/bios/smbios.c index f38d985..198bfc8 100644 --- a/sys/x86/bios/smbios.c +++ b/sys/x86/bios/smbios.c @@ -50,30 +50,6 @@ __FBSDID("$FreeBSD$"); * http://www.dmtf.org/standards/published_documents/DSP0134.pdf */ -/* - * SMBIOS Entry Point Structure - */ -struct smbios_eps { - u_int8_t Anchor[4]; /* '_SM_' */ - u_int8_t Checksum; - u_int8_t Length; - - u_int8_t SMBIOS_Major; - u_int8_t SMBIOS_Minor; - u_int16_t Max_Size; - u_int8_t Revision; - u_int8_t Formatted_Area[5]; - - u_int8_t Intermediate_Anchor[5]; /* '_DMI_' */ - u_int8_t Intermediate_Checksum; - - u_int16_t Structure_Table_Length; - u_int32_t Structure_Table_Address; - u_int16_t Structure_Count; - - u_int8_t SMBIOS_BCD_Revision; -} __packed; - struct smbios_softc { device_t dev; struct resource * res; @@ -82,12 +58,6 @@ struct smbios_softc { struct smbios_eps * eps; }; -#define SMBIOS_START 0xf0000 -#define SMBIOS_STEP 0x10 -#define SMBIOS_OFF 0 -#define SMBIOS_LEN 4 -#define SMBIOS_SIG "_SM_" - #define RES2EPS(res) ((struct smbios_eps *)rman_get_virtual(res)) #define ADDR2EPS(addr) ((struct smbios_eps *)BIOS_PADDRTOVADDR(addr)) @@ -116,13 +86,13 @@ smbios_identify (driver_t *driver, device_t parent) SMBIOS_STEP, SMBIOS_OFF); if (addr != 0) { rid = 0; - length = ADDR2EPS(addr)->Length; + length = ADDR2EPS(addr)->length; if (length != 0x1f) { u_int8_t major, minor; - major = ADDR2EPS(addr)->SMBIOS_Major; - minor = ADDR2EPS(addr)->SMBIOS_Minor; + major = ADDR2EPS(addr)->major_version; + minor = ADDR2EPS(addr)->minor_version; /* SMBIOS v2.1 implementation might use 0x1e. */ if (length == 0x1e && major == 2 && minor == 1) @@ -189,11 +159,11 @@ smbios_attach (device_t dev) sc->eps = RES2EPS(sc->res); device_printf(dev, "Version: %u.%u", - sc->eps->SMBIOS_Major, sc->eps->SMBIOS_Minor); - if (bcd2bin(sc->eps->SMBIOS_BCD_Revision)) + sc->eps->major_version, sc->eps->minor_version); + if (bcd2bin(sc->eps->BCD_revision)) printf(", BCD Revision: %u.%u", - bcd2bin(sc->eps->SMBIOS_BCD_Revision >> 4), - bcd2bin(sc->eps->SMBIOS_BCD_Revision & 0x0f)); + bcd2bin(sc->eps->BCD_revision >> 4), + bcd2bin(sc->eps->BCD_revision & 0x0f)); printf("\n"); return (0); @@ -269,7 +239,7 @@ smbios_cksum (struct smbios_eps *e) ptr = (u_int8_t *)e; cksum = 0; - for (i = 0; i < e->Length; i++) { + for (i = 0; i < e->length; i++) { cksum += ptr[i]; } |