Skip to content

Commit b2810bc

Browse files
committed
CPU (Linux): update comments
1 parent 8f1f160 commit b2810bc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/detection/cpu/cpu_linux.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ FF_MAYBE_UNUSED static void detectArmSoc(FFCPUResult* cpu)
324324
if (cpu->name.length > 0)
325325
return;
326326

327+
// device-vendor,device-model\0soc-vendor,soc-model\0
327328
char content[64];
328329
ssize_t length = ffReadFileData("/proc/device-tree/compatible", sizeof(content), content);
329330
if (length <= 2) return;
@@ -335,12 +336,7 @@ FF_MAYBE_UNUSED static void detectArmSoc(FFCPUResult* cpu)
335336
if (ffStrStartsWith(modelName, "apple,t"))
336337
{
337338
// https://elixir.bootlin.com/linux/v6.11-rc7/source/arch/arm64/boot/dts/apple
338-
// In Asahi Linux, reading /proc/device-tree/compatible gives
339-
// information on the device model. It consists of 3 NUL terminated
340-
// strings, the second of which gives the actual SoC model. But it
341-
// is not the marketing name, i.e. for M2 there is "apple,t8112" in
342-
// the compatible string.
343-
const char* code = modelName + strlen("qcom,sc");
339+
const char* code = modelName + strlen("apple,t");
344340
uint32_t deviceId = (uint32_t) strtoul(code, NULL, 10);
345341
ffStrbufSetStatic(&cpu->name, ffCPUAppleCodeToName(deviceId));
346342
if (!cpu->name.length)

0 commit comments

Comments
 (0)