mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
osx: add cpu model name
This commit is contained in:
parent
1d0a9262ae
commit
1c9ac4e825
@ -110,6 +110,8 @@ typedef enum
|
||||
CFAllDomainsMask = 0x0ffff /* All domains: all of the above and future items */
|
||||
} CFDomainMask;
|
||||
|
||||
static char darwin_cpu_model_name[64] = {0};
|
||||
|
||||
static NSSearchPathDirectory NSConvertFlagsCF(unsigned flags)
|
||||
{
|
||||
switch (flags)
|
||||
@ -736,6 +738,12 @@ static uint64_t frontend_darwin_get_mem_used(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char* frontend_darwin_get_cpu_model_name(void)
|
||||
{
|
||||
cpu_features_get_model_name(darwin_cpu_model_name, sizeof(darwin_cpu_model_name));
|
||||
return darwin_cpu_model_name;
|
||||
}
|
||||
|
||||
frontend_ctx_driver_t frontend_ctx_darwin = {
|
||||
frontend_darwin_get_environment_settings,
|
||||
NULL, /* init */
|
||||
@ -763,6 +771,6 @@ frontend_ctx_driver_t frontend_ctx_darwin = {
|
||||
NULL, /* watch_path_for_changes */
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
frontend_darwin_get_cpu_model_name,
|
||||
"darwin",
|
||||
};
|
||||
|
@ -873,6 +873,10 @@ end:
|
||||
/* terminate our string */
|
||||
if (pos < len)
|
||||
name[pos] = '\0';
|
||||
#elif defined(__MACH__)
|
||||
if (!name)
|
||||
return;
|
||||
sysctlbyname("machdep.cpu.brand_string", name, &len, NULL, 0);
|
||||
#else
|
||||
if (!name)
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user