Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/smbiostbl.c
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
/* The SMBIOS specification defines the date format to be mm/dd/yyyy */ | /* The SMBIOS specification defines the date format to be mm/dd/yyyy */ | ||||
#define FIRMWARE_RELEASE_DATE "11/10/2020" | #define FIRMWARE_RELEASE_DATE "11/10/2020" | ||||
/* BHYVE_ACPI_BASE - SMBIOS_BASE) */ | /* BHYVE_ACPI_BASE - SMBIOS_BASE) */ | ||||
#define SMBIOS_MAX_LENGTH (0xF2400 - 0xF1000) | #define SMBIOS_MAX_LENGTH (0xF2400 - 0xF1000) | ||||
#define SMBIOS_TYPE_BIOS 0 | #define SMBIOS_TYPE_BIOS 0 | ||||
#define SMBIOS_TYPE_SYSTEM 1 | #define SMBIOS_TYPE_SYSTEM 1 | ||||
#define SMBIOS_TYPE_BOARD 2 | |||||
#define SMBIOS_TYPE_CHASSIS 3 | #define SMBIOS_TYPE_CHASSIS 3 | ||||
#define SMBIOS_TYPE_PROCESSOR 4 | #define SMBIOS_TYPE_PROCESSOR 4 | ||||
#define SMBIOS_TYPE_MEMARRAY 16 | #define SMBIOS_TYPE_MEMARRAY 16 | ||||
#define SMBIOS_TYPE_MEMDEVICE 17 | #define SMBIOS_TYPE_MEMDEVICE 17 | ||||
#define SMBIOS_TYPE_MEMARRAYMAP 19 | #define SMBIOS_TYPE_MEMARRAYMAP 19 | ||||
#define SMBIOS_TYPE_BOOT 32 | #define SMBIOS_TYPE_BOOT 32 | ||||
#define SMBIOS_TYPE_EOT 127 | #define SMBIOS_TYPE_EOT 127 | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | struct smbios_table_type1 { | ||||
uint8_t serial; /* serial number string */ | uint8_t serial; /* serial number string */ | ||||
uint8_t uuid[16]; /* uuid byte array */ | uint8_t uuid[16]; /* uuid byte array */ | ||||
uint8_t wakeup; /* wake-up event */ | uint8_t wakeup; /* wake-up event */ | ||||
uint8_t sku; /* sku number string */ | uint8_t sku; /* sku number string */ | ||||
uint8_t family; /* family name string */ | uint8_t family; /* family name string */ | ||||
} __packed; | } __packed; | ||||
/* | /* | ||||
* Baseboard (or Module) Information | |||||
*/ | |||||
#define SMBIOS_BRF_HOSTING 0x1 | |||||
#define SMBIOS_BRT_MOTHERBOARD 0xa | |||||
struct smbios_table_type2 { | |||||
struct smbios_structure header; | |||||
uint8_t manufacturer; /* manufacturer string */ | |||||
uint8_t product; /* product name string */ | |||||
uint8_t version; /* version string */ | |||||
uint8_t serial; /* serial number string */ | |||||
uint8_t asset; /* asset tag string */ | |||||
uint8_t fflags; /* feature flags */ | |||||
uint8_t location; /* location in chassis */ | |||||
uint16_t chandle; /* chassis handle */ | |||||
uint8_t type; /* board type */ | |||||
uint8_t n_objs; /* number of contained object handles */ | |||||
} __packed; | |||||
/* | |||||
* System Enclosure or Chassis | * System Enclosure or Chassis | ||||
*/ | */ | ||||
#define SMBIOS_CHT_UNKNOWN 0x02 /* unknown */ | #define SMBIOS_CHT_UNKNOWN 0x02 /* unknown */ | ||||
#define SMBIOS_CHT_DESKTOP 0x03 /* desktop */ | |||||
#define SMBIOS_CHST_SAFE 0x03 /* safe */ | #define SMBIOS_CHST_SAFE 0x03 /* safe */ | ||||
#define SMBIOS_CHSC_NONE 0x03 /* none */ | #define SMBIOS_CHSC_NONE 0x03 /* none */ | ||||
struct smbios_table_type3 { | struct smbios_table_type3 { | ||||
struct smbios_structure header; | struct smbios_structure header; | ||||
uint8_t manufacturer; /* manufacturer string */ | uint8_t manufacturer; /* manufacturer string */ | ||||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | const char *smbios_type1_strings[] = { | ||||
"BHYVE", /* product name string */ | "BHYVE", /* product name string */ | ||||
"1.0", /* version string */ | "1.0", /* version string */ | ||||
"None", /* serial number string */ | "None", /* serial number string */ | ||||
"None", /* sku string */ | "None", /* sku string */ | ||||
"Virtual Machine", /* family name string */ | "Virtual Machine", /* family name string */ | ||||
NULL | NULL | ||||
}; | }; | ||||
struct smbios_table_type2 smbios_type2_template = { | |||||
{ SMBIOS_TYPE_BOARD, sizeof (struct smbios_table_type2), 0 }, | |||||
1, /* manufacturer string */ | |||||
2, /* product string */ | |||||
3, /* version string */ | |||||
4, /* serial number string */ | |||||
5, /* asset tag string */ | |||||
SMBIOS_BRF_HOSTING, /* feature flags */ | |||||
6, /* location string */ | |||||
SMBIOS_CHT_DESKTOP, /* chassis handle */ | |||||
SMBIOS_BRT_MOTHERBOARD, /* board type */ | |||||
0 | |||||
}; | |||||
const char *smbios_type2_strings[] = { | |||||
"FreeBSD", /* manufacturer string */ | |||||
"BHYVE", /* product name string */ | |||||
"1.0", /* version string */ | |||||
"None", /* serial number string */ | |||||
"None", /* asset tag string */ | |||||
"None", /* location string */ | |||||
NULL | |||||
}; | |||||
struct smbios_table_type3 smbios_type3_template = { | struct smbios_table_type3 smbios_type3_template = { | ||||
{ SMBIOS_TYPE_CHASSIS, sizeof (struct smbios_table_type3), 0 }, | { SMBIOS_TYPE_CHASSIS, sizeof (struct smbios_table_type3), 0 }, | ||||
1, /* manufacturer string */ | 1, /* manufacturer string */ | ||||
SMBIOS_CHT_UNKNOWN, | SMBIOS_CHT_UNKNOWN, | ||||
2, /* version string */ | 2, /* version string */ | ||||
3, /* serial number string */ | 3, /* serial number string */ | ||||
4, /* asset tag string */ | 4, /* asset tag string */ | ||||
SMBIOS_CHST_SAFE, | SMBIOS_CHST_SAFE, | ||||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | |||||
static struct smbios_template_entry smbios_template[] = { | static struct smbios_template_entry smbios_template[] = { | ||||
{ (struct smbios_structure *)&smbios_type0_template, | { (struct smbios_structure *)&smbios_type0_template, | ||||
smbios_type0_strings, | smbios_type0_strings, | ||||
smbios_generic_initializer }, | smbios_generic_initializer }, | ||||
{ (struct smbios_structure *)&smbios_type1_template, | { (struct smbios_structure *)&smbios_type1_template, | ||||
smbios_type1_strings, | smbios_type1_strings, | ||||
smbios_type1_initializer }, | smbios_type1_initializer }, | ||||
{ (struct smbios_structure *)&smbios_type2_template, | |||||
smbios_type2_strings, | |||||
smbios_generic_initializer }, | |||||
{ (struct smbios_structure *)&smbios_type3_template, | { (struct smbios_structure *)&smbios_type3_template, | ||||
smbios_type3_strings, | smbios_type3_strings, | ||||
smbios_generic_initializer }, | smbios_generic_initializer }, | ||||
{ (struct smbios_structure *)&smbios_type4_template, | { (struct smbios_structure *)&smbios_type4_template, | ||||
smbios_type4_strings, | smbios_type4_strings, | ||||
smbios_type4_initializer }, | smbios_type4_initializer }, | ||||
{ (struct smbios_structure *)&smbios_type16_template, | { (struct smbios_structure *)&smbios_type16_template, | ||||
NULL, | NULL, | ||||
▲ Show 20 Lines • Show All 340 Lines • Show Last 20 Lines |