diff --git a/src/detection/cpu/cpu_apple.c b/src/detection/cpu/cpu_apple.c index 8d5cbf0a4..1226131e5 100644 --- a/src/detection/cpu/cpu_apple.c +++ b/src/detection/cpu/cpu_apple.c @@ -15,6 +15,7 @@ static double detectCpuTemp(const FFstrbuf* cpuName) case 1: error = ffDetectSmcTemps(FF_TEMP_CPU_M1X, &result); break; case 2: error = ffDetectSmcTemps(FF_TEMP_CPU_M2X, &result); break; case 3: error = ffDetectSmcTemps(FF_TEMP_CPU_M3X, &result); break; + case 4: error = ffDetectSmcTemps(FF_TEMP_CPU_M4X, &result); break; default: error = "Unsupported Apple Silicon CPU"; } } diff --git a/src/detection/gpu/gpu_apple.c b/src/detection/gpu/gpu_apple.c index 551b8bffe..793db62a7 100644 --- a/src/detection/gpu/gpu_apple.c +++ b/src/detection/gpu/gpu_apple.c @@ -21,6 +21,7 @@ static double detectGpuTemp(const FFstrbuf* gpuName) case 1: error = ffDetectSmcTemps(FF_TEMP_GPU_M1X, &result); break; case 2: error = ffDetectSmcTemps(FF_TEMP_GPU_M2X, &result); break; case 3: error = ffDetectSmcTemps(FF_TEMP_GPU_M3X, &result); break; + case 4: error = ffDetectSmcTemps(FF_TEMP_GPU_M4X, &result); break; default: error = "Unsupported Apple Silicon GPU"; } } diff --git a/src/util/apple/smc_temps.c b/src/util/apple/smc_temps.c index 1f9d8179d..483d51e8d 100644 --- a/src/util/apple/smc_temps.c +++ b/src/util/apple/smc_temps.c @@ -269,7 +269,7 @@ static const char *smcReadValue(io_connect_t conn, const UInt32Char_t key, doubl return NULL; } -static bool detectTemp(io_connect_t conn, const char *sensor, double* sum) +static bool detectTemp(io_connect_t conn, const char* sensor, double* sum) { double temp = 0; const char* error = smcReadValue(conn, sensor, &temp); @@ -280,7 +280,7 @@ static bool detectTemp(io_connect_t conn, const char *sensor, double* sum) return true; } -const char *ffDetectSmcTemps(enum FFTempType type, double *result) +const char* ffDetectSmcTemps(enum FFTempType type, double* result) { static io_connect_t conn; if (!conn) @@ -353,6 +353,21 @@ const char *ffDetectSmcTemps(enum FFTempType type, double *result) count += detectTemp(conn, "Tf4E", result); // CPU performance core 12 break; + case FF_TEMP_CPU_M4X: + count += detectTemp(conn, "Te05", result); // CPU efficiency core 1 + count += detectTemp(conn, "Te0S", result); // CPU efficiency core 2 + count += detectTemp(conn, "Te09", result); // CPU efficiency core 3 + count += detectTemp(conn, "Te0H", result); // CPU efficiency core 4 + count += detectTemp(conn, "Tp01", result); // CPU performance core 1 + count += detectTemp(conn, "Tp05", result); // CPU performance core 2 + count += detectTemp(conn, "Tp09", result); // CPU performance core 3 + count += detectTemp(conn, "Tp0D", result); // CPU performance core 4 + count += detectTemp(conn, "Tp0V", result); // CPU performance core 5 + count += detectTemp(conn, "Tp0Y", result); // CPU performance core 6 + count += detectTemp(conn, "Tp0b", result); // CPU performance core 7 + count += detectTemp(conn, "Tp0e", result); // CPU performance core 8 + break; + case FF_TEMP_GPU_INTEL: count += detectTemp(conn, "TCGC", result); // GPU Intel Graphics goto gpu_unknown; @@ -390,6 +405,19 @@ const char *ffDetectSmcTemps(enum FFTempType type, double *result) count += detectTemp(conn, "Tf2A", result); // GPU 8 break; + case FF_TEMP_GPU_M4X: + count += detectTemp(conn, "Tg0G", result); // GPU 1 (Basic) + count += detectTemp(conn, "Tg0H", result); // GPU 2 (Basic) + count += detectTemp(conn, "Tg1U", result); // GPU 1 (Pro / Max) + count += detectTemp(conn, "Tg1k", result); // GPU 2 (Pro / Max) + count += detectTemp(conn, "Tg0K", result); // GPU 3 + count += detectTemp(conn, "Tg0L", result); // GPU 4 + count += detectTemp(conn, "Tg0d", result); // GPU 5 + count += detectTemp(conn, "Tg0e", result); // GPU 6 + count += detectTemp(conn, "Tg0j", result); // GPU 7 + count += detectTemp(conn, "Tg0k", result); // GPU 8 + break; + case FF_TEMP_BATTERY: count += detectTemp(conn, "TB1T", result); // Battery count += detectTemp(conn, "TB2T", result); // Battery diff --git a/src/util/apple/smc_temps.h b/src/util/apple/smc_temps.h index 0d6e104c1..4adc7a607 100644 --- a/src/util/apple/smc_temps.h +++ b/src/util/apple/smc_temps.h @@ -15,6 +15,7 @@ enum FFTempType FF_TEMP_CPU_M1X, FF_TEMP_CPU_M2X, FF_TEMP_CPU_M3X, + FF_TEMP_CPU_M4X, FF_TEMP_GPU_INTEL, FF_TEMP_GPU_AMD, @@ -22,10 +23,11 @@ enum FFTempType FF_TEMP_GPU_M1X, FF_TEMP_GPU_M2X, FF_TEMP_GPU_M3X, + FF_TEMP_GPU_M4X, FF_TEMP_BATTERY, FF_TEMP_MEMORY, }; -const char *ffDetectSmcTemps(enum FFTempType type, double* result); +const char* ffDetectSmcTemps(enum FFTempType type, double* result);