smbiostbl.c (2b9481465d6ee67ac62c160dbf79c3ec3348c611) smbiostbl.c (b0de25cb23668fa4535078d18a0618eee442c000)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2014 Tycho Nightingale <tycho.nightingale@pluribusnetworks.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 48 unchanged lines hidden (view full) ---

57/* The SMBIOS specification defines the date format to be mm/dd/yyyy */
58#define FIRMWARE_RELEASE_DATE "11/10/2020"
59
60/* BHYVE_ACPI_BASE - SMBIOS_BASE) */
61#define SMBIOS_MAX_LENGTH (0xF2400 - 0xF1000)
62
63#define SMBIOS_TYPE_BIOS 0
64#define SMBIOS_TYPE_SYSTEM 1
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2014 Tycho Nightingale <tycho.nightingale@pluribusnetworks.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 48 unchanged lines hidden (view full) ---

57/* The SMBIOS specification defines the date format to be mm/dd/yyyy */
58#define FIRMWARE_RELEASE_DATE "11/10/2020"
59
60/* BHYVE_ACPI_BASE - SMBIOS_BASE) */
61#define SMBIOS_MAX_LENGTH (0xF2400 - 0xF1000)
62
63#define SMBIOS_TYPE_BIOS 0
64#define SMBIOS_TYPE_SYSTEM 1
65#define SMBIOS_TYPE_BOARD 2
65#define SMBIOS_TYPE_CHASSIS 3
66#define SMBIOS_TYPE_PROCESSOR 4
67#define SMBIOS_TYPE_MEMARRAY 16
68#define SMBIOS_TYPE_MEMDEVICE 17
69#define SMBIOS_TYPE_MEMARRAYMAP 19
70#define SMBIOS_TYPE_BOOT 32
71#define SMBIOS_TYPE_EOT 127
72

--- 81 unchanged lines hidden (view full) ---

154 uint8_t serial; /* serial number string */
155 uint8_t uuid[16]; /* uuid byte array */
156 uint8_t wakeup; /* wake-up event */
157 uint8_t sku; /* sku number string */
158 uint8_t family; /* family name string */
159} __packed;
160
161/*
66#define SMBIOS_TYPE_CHASSIS 3
67#define SMBIOS_TYPE_PROCESSOR 4
68#define SMBIOS_TYPE_MEMARRAY 16
69#define SMBIOS_TYPE_MEMDEVICE 17
70#define SMBIOS_TYPE_MEMARRAYMAP 19
71#define SMBIOS_TYPE_BOOT 32
72#define SMBIOS_TYPE_EOT 127
73

--- 81 unchanged lines hidden (view full) ---

155 uint8_t serial; /* serial number string */
156 uint8_t uuid[16]; /* uuid byte array */
157 uint8_t wakeup; /* wake-up event */
158 uint8_t sku; /* sku number string */
159 uint8_t family; /* family name string */
160} __packed;
161
162/*
163 * Baseboard (or Module) Information
164 */
165#define SMBIOS_BRF_HOSTING 0x1
166#define SMBIOS_BRT_MOTHERBOARD 0xa
167
168struct smbios_table_type2 {
169 struct smbios_structure header;
170 uint8_t manufacturer; /* manufacturer string */
171 uint8_t product; /* product name string */
172 uint8_t version; /* version string */
173 uint8_t serial; /* serial number string */
174 uint8_t asset; /* asset tag string */
175 uint8_t fflags; /* feature flags */
176 uint8_t location; /* location in chassis */
177 uint16_t chandle; /* chassis handle */
178 uint8_t type; /* board type */
179 uint8_t n_objs; /* number of contained object handles */
180} __packed;
181
182/*
162 * System Enclosure or Chassis
163 */
164#define SMBIOS_CHT_UNKNOWN 0x02 /* unknown */
183 * System Enclosure or Chassis
184 */
185#define SMBIOS_CHT_UNKNOWN 0x02 /* unknown */
186#define SMBIOS_CHT_DESKTOP 0x03 /* desktop */
165
166#define SMBIOS_CHST_SAFE 0x03 /* safe */
167
168#define SMBIOS_CHSC_NONE 0x03 /* none */
169
170struct smbios_table_type3 {
171 struct smbios_structure header;
172 uint8_t manufacturer; /* manufacturer string */

--- 183 unchanged lines hidden (view full) ---

356 "BHYVE", /* product name string */
357 "1.0", /* version string */
358 "None", /* serial number string */
359 "None", /* sku string */
360 "Virtual Machine", /* family name string */
361 NULL
362};
363
187
188#define SMBIOS_CHST_SAFE 0x03 /* safe */
189
190#define SMBIOS_CHSC_NONE 0x03 /* none */
191
192struct smbios_table_type3 {
193 struct smbios_structure header;
194 uint8_t manufacturer; /* manufacturer string */

--- 183 unchanged lines hidden (view full) ---

378 "BHYVE", /* product name string */
379 "1.0", /* version string */
380 "None", /* serial number string */
381 "None", /* sku string */
382 "Virtual Machine", /* family name string */
383 NULL
384};
385
386struct smbios_table_type2 smbios_type2_template = {
387 { SMBIOS_TYPE_BOARD, sizeof (struct smbios_table_type2), 0 },
388 1, /* manufacturer string */
389 2, /* product string */
390 3, /* version string */
391 4, /* serial number string */
392 5, /* asset tag string */
393 SMBIOS_BRF_HOSTING, /* feature flags */
394 6, /* location string */
395 SMBIOS_CHT_DESKTOP, /* chassis handle */
396 SMBIOS_BRT_MOTHERBOARD, /* board type */
397 0
398};
399
400const char *smbios_type2_strings[] = {
401 "illumos", /* manufacturer string */
402 "BHYVE", /* product name string */
403 "1.0", /* version string */
404 "None", /* serial number string */
405 "None", /* asset tag string */
406 "None", /* location string */
407 NULL
408};
409
364struct smbios_table_type3 smbios_type3_template = {
365 { SMBIOS_TYPE_CHASSIS, sizeof (struct smbios_table_type3), 0 },
366 1, /* manufacturer string */
367 SMBIOS_CHT_UNKNOWN,
368 2, /* version string */
369 3, /* serial number string */
370 4, /* asset tag string */
371 SMBIOS_CHST_SAFE,

--- 142 unchanged lines hidden (view full) ---

514
515static struct smbios_template_entry smbios_template[] = {
516 { (struct smbios_structure *)&smbios_type0_template,
517 smbios_type0_strings,
518 smbios_generic_initializer },
519 { (struct smbios_structure *)&smbios_type1_template,
520 smbios_type1_strings,
521 smbios_type1_initializer },
410struct smbios_table_type3 smbios_type3_template = {
411 { SMBIOS_TYPE_CHASSIS, sizeof (struct smbios_table_type3), 0 },
412 1, /* manufacturer string */
413 SMBIOS_CHT_UNKNOWN,
414 2, /* version string */
415 3, /* serial number string */
416 4, /* asset tag string */
417 SMBIOS_CHST_SAFE,

--- 142 unchanged lines hidden (view full) ---

560
561static struct smbios_template_entry smbios_template[] = {
562 { (struct smbios_structure *)&smbios_type0_template,
563 smbios_type0_strings,
564 smbios_generic_initializer },
565 { (struct smbios_structure *)&smbios_type1_template,
566 smbios_type1_strings,
567 smbios_type1_initializer },
568 { (struct smbios_structure *)&smbios_type2_template,
569 smbios_type2_strings,
570 smbios_generic_initializer },
522 { (struct smbios_structure *)&smbios_type3_template,
523 smbios_type3_strings,
524 smbios_generic_initializer },
525 { (struct smbios_structure *)&smbios_type4_template,
526 smbios_type4_strings,
527 smbios_type4_initializer },
528 { (struct smbios_structure *)&smbios_type16_template,
529 NULL,

--- 446 unchanged lines hidden ---
571 { (struct smbios_structure *)&smbios_type3_template,
572 smbios_type3_strings,
573 smbios_generic_initializer },
574 { (struct smbios_structure *)&smbios_type4_template,
575 smbios_type4_strings,
576 smbios_type4_initializer },
577 { (struct smbios_structure *)&smbios_type16_template,
578 NULL,

--- 446 unchanged lines hidden ---