From 324d0fbe94fc48a121cf4cfdb0f3e07a659f5ad4 Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Sun, 25 Aug 2024 16:48:41 +0100 Subject: [PATCH] [v1.06][PPC] Add support for Espresso (#231) --- src/ppc/ppc.c | 8 ++++++-- src/ppc/uarch.c | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ppc/ppc.c b/src/ppc/ppc.c index 4758d27..3aa430a 100644 --- a/src/ppc/ppc.c +++ b/src/ppc/ppc.c @@ -81,9 +81,13 @@ struct topology* get_topology_info(struct cache* cach) { if(!fill_package_ids_from_sys(package_ids, topo->total_cores)) { printWarn("fill_package_ids_from_sys failed, output may be incomplete/invalid"); for(int i=0; i < topo->total_cores; i++) package_ids[i] = 0; - // fill_package_ids_from_sys failed, use a - // more sophisticated wat to find the number of sockets + // fill_package_ids_from_sys failed, use udev to try + // to find the number of sockets topo->sockets = get_num_sockets_package_cpus(topo); + if (topo->sockets == UNKNOWN_DATA) { + printWarn("get_num_sockets_package_cpus failed: assuming 1 socket"); + topo->sockets = 1; + } } else { // fill_package_ids_from_sys succeeded, use the diff --git a/src/ppc/uarch.c b/src/ppc/uarch.c index abaacf0..9067c6e 100644 --- a/src/ppc/uarch.c +++ b/src/ppc/uarch.c @@ -25,6 +25,7 @@ enum { UARCH_PPC603, UARCH_PPC440, UARCH_PPC470, + UARCH_ESPRESSO, // Not exactly an uarch, but the codename of Wii U UARCH_PPC970, UARCH_PPC970FX, UARCH_PPC970MP, @@ -75,6 +76,7 @@ void fill_uarch(struct uarch* arch, MICROARCH u) { FILL_UARCH(arch->uarch, UARCH_PPC603, "PowerPC 603", UNK) // varies FILL_UARCH(arch->uarch, UARCH_PPC440, "PowerPC 440", UNK) FILL_UARCH(arch->uarch, UARCH_PPC470, "PowerPC 470", 45) // strange... + FILL_UARCH(arch->uarch, UARCH_ESPRESSO, "Espresso", 45) // https://en.wikipedia.org/wiki/PowerPC_7xx#Espresso, https://en.wikipedia.org/wiki/Espresso_(processor), https://github.com/Dr-Noob/cpufetch/issues/231 FILL_UARCH(arch->uarch, UARCH_PPC970, "PowerPC 970", 130) FILL_UARCH(arch->uarch, UARCH_PPC970FX, "PowerPC 970FX", 90) FILL_UARCH(arch->uarch, UARCH_PPC970MP, "PowerPC 970MP", 90) @@ -234,6 +236,7 @@ struct uarch* get_uarch_from_pvr(uint32_t pvr) { CHECK_UARCH(arch, pvr, 0xffff0000, 0x7ff50000, UARCH_PPC470) CHECK_UARCH(arch, pvr, 0xffff0000, 0x00050000, UARCH_PPC470) CHECK_UARCH(arch, pvr, 0xffff0000, 0x11a50000, UARCH_PPC470) + CHECK_UARCH(arch, pvr, 0xffffffff, 0x70010201, UARCH_ESPRESSO) UARCH_END return arch;