From 2d97f625fdd8c8e64e316feeb712431b33ee1a41 Mon Sep 17 00:00:00 2001 From: techflashYT Date: Tue, 10 Jun 2025 18:53:16 -0700 Subject: [PATCH 1/2] CPU (NetBSD): properly support PowerPC Some devices store their CPU name in hw.model, so check that as well before giving up. Tested on NetBSD 10.1 evbppc/wii, and allows it to detect the CPU as "750 (Revision 2.0)". --- src/detection/cpu/cpu_nbsd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/detection/cpu/cpu_nbsd.c b/src/detection/cpu/cpu_nbsd.c index 0486e213c0..be0f3df22f 100644 --- a/src/detection/cpu/cpu_nbsd.c +++ b/src/detection/cpu/cpu_nbsd.c @@ -51,7 +51,9 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu) { if (ffSysctlGetString("machdep.cpu_brand", &cpu->name) != NULL && ffSysctlGetString("machdep.dmi.processor-version", &cpu->name) != NULL && - ffSysctlGetString("hw.cpu0.name", &cpu->name) != NULL) + ffSysctlGetString("hw.cpu0.name", &cpu->name) != NULL && + ffSysctlGetString("hw.model", &cpu->name) != NULL) + { ffStrbufSetS(&cpu->name, "Unknown CPU"); } From e724b790460b84f8ca2478311ab1893ddbc6e060 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 11 Jun 2025 00:13:25 -0500 Subject: [PATCH 2/2] Update cpu_nbsd.c --- src/detection/cpu/cpu_nbsd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/detection/cpu/cpu_nbsd.c b/src/detection/cpu/cpu_nbsd.c index be0f3df22f..1bac531f71 100644 --- a/src/detection/cpu/cpu_nbsd.c +++ b/src/detection/cpu/cpu_nbsd.c @@ -53,7 +53,6 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu) ffSysctlGetString("machdep.dmi.processor-version", &cpu->name) != NULL && ffSysctlGetString("hw.cpu0.name", &cpu->name) != NULL && ffSysctlGetString("hw.model", &cpu->name) != NULL) - { ffStrbufSetS(&cpu->name, "Unknown CPU"); }