summaryrefslogtreecommitdiff
path: root/usr/src/cmd/smbios/smbios.c
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-05-01 11:36:33 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-05-01 11:36:33 +0000
commit363d63cac68cdd10faf2dc4f7b4685713a4706af (patch)
tree2623fbf36694640e6015b4570f47f217b4df8ccd /usr/src/cmd/smbios/smbios.c
parent54a7e5761a35624975c2f384a98b3235bf625094 (diff)
parentef9416a894c90df5d46b888dbe2908c7f00fd409 (diff)
downloadillumos-joyent-363d63cac68cdd10faf2dc4f7b4685713a4706af.tar.gz
[illumos-gate merge]
commit ef9416a894c90df5d46b888dbe2908c7f00fd409 12296 unix: access_mask_check() warn: bitwise AND condition is false here commit 9f9cceb6f1158940244c35cecdbc93f9a386a4b8 12662 smbios(1M) interprets jedec IDs incorrectly 12664 fix smbios memory technology operating mode capabilities commit f343451914d0efaf2d6fc84d8818a16246b223dc 12635 Allow for '-o feature@<feature>=disabled' on the command line
Diffstat (limited to 'usr/src/cmd/smbios/smbios.c')
-rw-r--r--usr/src/cmd/smbios/smbios.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/usr/src/cmd/smbios/smbios.c b/usr/src/cmd/smbios/smbios.c
index 1d3e14e372..9c6d058182 100644
--- a/usr/src/cmd/smbios/smbios.c
+++ b/usr/src/cmd/smbios/smbios.c
@@ -177,13 +177,23 @@ jedec_print(FILE *fp, const char *desc, uint_t id)
const char *name;
uint_t cont, vendor;
- vendor = id & 0xff;
- cont = (id >> 8) & 0xff;
+ /*
+ * SMBIOS encodes data in the way that the underlying memory standard
+ * does. In this case, the upper byte indicates the vendor that we care
+ * about while the lower byte indicates the number of continuations that
+ * are needed. libjedec indexes this based on zero (e.g. table 1 is zero
+ * continuations), which is how the spec encodes it. We add one so that
+ * we can match how the spec describes it.
+ */
+ vendor = id >> 8;
+ cont = id & 0x7f;
name = libjedec_vendor_string(cont, vendor);
if (name == NULL) {
- oprintf(fp, " %s: 0x%x\n", desc, id);
+ oprintf(fp, " %s: Bank: 0x%x Vendor: 0x%x\n", desc, cont + 1,
+ vendor);
} else {
- oprintf(fp, " %s: 0x%x (%s)\n", desc, id, name);
+ oprintf(fp, " %s: Bank: 0x%x Vendor: 0x%x (%s)\n", desc,
+ cont + 1, vendor, name);
}
}
@@ -1014,7 +1024,7 @@ print_memdevice(smbios_hdl_t *shp, id_t id, FILE *fp)
}
if (md.smbmd_opcap_flags != 0) {
- flag_printf(fp, " Operating Mode Capabilities",
+ flag_printf(fp, "Operating Mode Capabilities",
md.smbmd_opcap_flags, sizeof (md.smbmd_opcap_flags) * NBBY,
smbios_memdevice_op_capab_name,
smbios_memdevice_op_capab_desc);