Skip to content

Commit 77ab331

Browse files
committed
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)".
1 parent be989c7 commit 77ab331

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/detection/cpu/cpu_nbsd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
4444
{
4545
if (ffSysctlGetString("machdep.cpu_brand", &cpu->name) != NULL &&
4646
ffSysctlGetString("machdep.dmi.processor-version", &cpu->name) != NULL &&
47-
ffSysctlGetString("hw.cpu0.name", &cpu->name) != NULL)
47+
ffSysctlGetString("hw.cpu0.name", &cpu->name) != NULL &&
48+
ffSysctlGetString("hw.model", &cpu->name) != NULL)
49+
4850
{
4951
ffStrbufSetS(&cpu->name, "Unknown CPU");
5052
}

0 commit comments

Comments
 (0)