summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-08-02 00:57:05 -0400
committerIan Moffett <ian@osmora.org>2025-08-02 00:57:05 -0400
commitf68f62622239833ef214930c33d45409a616babe (patch)
tree79ecb5b7c1469b90d2c74054532852f040ed5845 /sys/dev
parent3ebbbb8961aaf394a9cfd397e65af2362beb488c (diff)
kernel: dmi: Add dmi_cpu_version()
Add DMI helper to grab processor version string Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/dmi/dmi.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/dev/dmi/dmi.c b/sys/dev/dmi/dmi.c
index 84288cf..dc4b363 100644
--- a/sys/dev/dmi/dmi.c
+++ b/sys/dev/dmi/dmi.c
@@ -48,6 +48,7 @@
#define SYSINFO_PRODUCT 0x02
#define SYSINFO_FAMILY 0x03
#define PROCINFO_MANUFACT 0x02
+#define PROCINFO_VERSION 0x03
#define PROCINFO_PARTNO 0x06
static struct limine_smbios_request smbios_req = {
@@ -198,6 +199,24 @@ dmi_cpu_manufact(void)
return dmi_str_index(hdr, PROCINFO_MANUFACT);
}
+/*
+ * Return the CPU version string from the
+ * DMI/SMBIOS Processor Info structure
+ *
+ * Returns NULL if not found
+ */
+const char *
+dmi_cpu_version(void)
+{
+ struct dmi_shdr *hdr;
+
+ if ((hdr = dmi_shdr(DMI_PROCESSOR_INFO)) == NULL) {
+ return NULL;
+ }
+
+ return dmi_str_index(hdr, PROCINFO_VERSION);
+}
+
static int
dmi_init(void)
{