Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/GameSetup/HWDetect.cpp
/* Copyright (C) 2021 Wildfire Games. | /* Copyright (C) 2022 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 10 Lines | |||||
#include "lib/svn_revision.h" | #include "lib/svn_revision.h" | ||||
#include "lib/timer.h" | #include "lib/timer.h" | ||||
#include "lib/utf8.h" | #include "lib/utf8.h" | ||||
#include "lib/external_libraries/libsdl.h" | #include "lib/external_libraries/libsdl.h" | ||||
#include "lib/posix/posix_utsname.h" | #include "lib/posix/posix_utsname.h" | ||||
#include "lib/sysdep/cpu.h" | #include "lib/sysdep/cpu.h" | ||||
#include "lib/sysdep/numa.h" | #include "lib/sysdep/numa.h" | ||||
#include "lib/sysdep/os_cpu.h" | #include "lib/sysdep/os_cpu.h" | ||||
#if ARCH_X86_X64 | |||||
# include "lib/sysdep/arch/x86_x64/topology.h" | |||||
#endif | |||||
#if CONFIG2_AUDIO | #if CONFIG2_AUDIO | ||||
#include "soundmanager/SoundManager.h" | #include "soundmanager/SoundManager.h" | ||||
#endif | #endif | ||||
#include "ps/CLogger.h" | #include "ps/CLogger.h" | ||||
#include "ps/ConfigDB.h" | #include "ps/ConfigDB.h" | ||||
#include "ps/Filesystem.h" | #include "ps/Filesystem.h" | ||||
#include "ps/GameSetup/Config.h" | #include "ps/GameSetup/Config.h" | ||||
#include "ps/Profile.h" | #include "ps/Profile.h" | ||||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | #if OS_LINUX | ||||
} | } | ||||
#endif | #endif | ||||
Script::SetProperty(rq, settings, "cpu_identifier", std::string(cpu_IdentifierString())); | Script::SetProperty(rq, settings, "cpu_identifier", std::string(cpu_IdentifierString())); | ||||
Script::SetProperty(rq, settings, "cpu_frequency", os_cpu_ClockFrequency()); | Script::SetProperty(rq, settings, "cpu_frequency", os_cpu_ClockFrequency()); | ||||
Script::SetProperty(rq, settings, "cpu_pagesize", (u32)os_cpu_PageSize()); | Script::SetProperty(rq, settings, "cpu_pagesize", (u32)os_cpu_PageSize()); | ||||
Script::SetProperty(rq, settings, "cpu_largepagesize", (u32)os_cpu_LargePageSize()); | Script::SetProperty(rq, settings, "cpu_largepagesize", (u32)os_cpu_LargePageSize()); | ||||
Script::SetProperty(rq, settings, "cpu_numprocs", (u32)os_cpu_NumProcessors()); | Script::SetProperty(rq, settings, "cpu_numprocs", (u32)os_cpu_NumProcessors()); | ||||
#if ARCH_X86_X64 | |||||
Script::SetProperty(rq, settings, "cpu_numpackages", (u32)topology::NumPackages()); | |||||
Script::SetProperty(rq, settings, "cpu_coresperpackage", (u32)topology::CoresPerPackage()); | |||||
Script::SetProperty(rq, settings, "cpu_logicalpercore", (u32)topology::LogicalPerCore()); | |||||
#endif | |||||
Script::SetProperty(rq, settings, "numa_numnodes", (u32)numa_NumNodes()); | Script::SetProperty(rq, settings, "numa_numnodes", (u32)numa_NumNodes()); | ||||
Script::SetProperty(rq, settings, "numa_factor", numa_Factor()); | Script::SetProperty(rq, settings, "numa_factor", numa_Factor()); | ||||
Script::SetProperty(rq, settings, "numa_interleaved", numa_IsMemoryInterleaved()); | Script::SetProperty(rq, settings, "numa_interleaved", numa_IsMemoryInterleaved()); | ||||
Script::SetProperty(rq, settings, "ram_total", (u32)os_cpu_MemorySize()); | Script::SetProperty(rq, settings, "ram_total", (u32)os_cpu_MemorySize()); | ||||
Script::SetProperty(rq, settings, "ram_total_os", (u32)os_cpu_QueryMemorySize()); | Script::SetProperty(rq, settings, "ram_total_os", (u32)os_cpu_QueryMemorySize()); | ||||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator