summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2012-09-28 11:59:32 +0000
committerjhb <jhb@FreeBSD.org>2012-09-28 11:59:32 +0000
commitf643d4c50acbb3d6c4a9aa07dc0ae5c1c5e1e1ac (patch)
treec950d3dbe6e28fe65f089b61ff9eb6e8d1c3d72a /sys/amd64/include
parent9546d5704f623014fe246f3504b52075ae5a96ef (diff)
downloadFreeBSD-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/amd64/include')
-rw-r--r--sys/amd64/include/pc/bios.h52
1 files changed, 42 insertions, 10 deletions
diff --git a/sys/amd64/include/pc/bios.h b/sys/amd64/include/pc/bios.h
index 364f86c..e7d568e 100644
--- a/sys/amd64/include/pc/bios.h
+++ b/sys/amd64/include/pc/bios.h
@@ -30,16 +30,9 @@
#ifndef _MACHINE_PC_BIOS_H_
#define _MACHINE_PC_BIOS_H_
-extern u_int32_t bios_sigsearch(u_int32_t start, u_char *sig, int siglen,
- int paralen, int sigofs);
-
-#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE)
-#define BIOS_VADDRTOPADDR(x) ((x) - KERNBASE)
-
/*
* Int 15:E820 'SMAP' structure
*/
-
#define SMAP_SIG 0x534D4150 /* 'SMAP' */
#define SMAP_TYPE_MEMORY 1
@@ -58,22 +51,61 @@ struct bios_smap {
u_int32_t type;
} __packed;
+/*
+ * System Management BIOS
+ */
+#define SMBIOS_START 0xf0000
+#define SMBIOS_STEP 0x10
+#define SMBIOS_OFF 0
+#define SMBIOS_LEN 4
+#define SMBIOS_SIG "_SM_"
+
+struct smbios_eps {
+ uint8_t anchor_string[4]; /* '_SM_' */
+ uint8_t checksum;
+ uint8_t length;
+ uint8_t major_version;
+ uint8_t minor_version;
+ uint16_t maximum_structure_size;
+ uint8_t entry_point_revision;
+ uint8_t formatted_area[5];
+ uint8_t intermediate_anchor_string[5]; /* '_DMI_' */
+ uint8_t intermediate_checksum;
+ uint16_t structure_table_length;
+ uint32_t structure_table_address;
+ uint16_t number_structures;
+ uint8_t BCD_revision;
+};
+
+struct smbios_structure_header {
+ uint8_t type;
+ uint8_t length;
+ uint16_t handle;
+};
+
+#ifdef _KERNEL
+#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE)
+#define BIOS_VADDRTOPADDR(x) ((x) - KERNBASE)
+
struct bios_oem_signature {
char * anchor; /* search anchor string in BIOS memory */
size_t offset; /* offset from anchor (may be negative) */
size_t totlen; /* total length of BIOS string to copy */
} __packed;
+
struct bios_oem_range {
u_int from; /* shouldn't be below 0xe0000 */
u_int to; /* shouldn't be above 0xfffff */
} __packed;
+
struct bios_oem {
struct bios_oem_range range;
struct bios_oem_signature signature[];
} __packed;
-extern int
-bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen);
-
+int bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen);
+uint32_t bios_sigsearch(uint32_t start, u_char *sig, int siglen, int paralen,
+ int sigofs);
+#endif
#endif /* _MACHINE_PC_BIOS_H_ */
OpenPOWER on IntegriCloud