AuroraRuntime/Source/HWInfo/CpuInfo.Linux.cpp
Reece df1c36bd28 [*] Refactor CpuInfo
[*] class -> struct RSA interface
2022-02-18 10:46:51 +00:00

34 lines
710 B
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: CpuId.Linux.cpp
Date: 2022-1-25
Author: Reece
***/
#include <Source/RuntimeInternal.hpp>
#include "HWInfo.hpp"
#include "CpuInfo.hpp"
#include "CpuInfo.Linux.hpp"
#if defined(AURORA_IS_BSD_DERIVED)
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
#if defined(AURORA_IS_POSIX_DERIVED)
#include <stdlib.h>
#include <sys/sysinfo.h>
#endif
namespace Aurora::HWInfo
{
void SetCpuTopologyLinux()
{
gCpuInfo.uSocket = 1;
gCpuInfo.uCores = 1;
gCpuInfo.uThreads = get_nprocs();
// TODO: parse /proc/cpuinfo
gCpuInfo.bMaskMTHalf = true;
}
}