Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
#include "precompiled.h"
#include "lib/sysdep/os/win/wcpu.h"
#include "lib/sysdep/os_cpu.h"
#include "lib/bits.h"
#include "lib/alignment.h"
#include "lib/module_init.h"
#include "lib/sysdep/os/win/wutil.h"
#include "lib/sysdep/arch/x86_x64/x86_x64.h"
Functions | |
uintptr_t | os_cpu_ProcessorMask () |
size_t | os_cpu_NumProcessors () |
Status | wcpu_ReadFrequencyFromRegistry (u32 &freqMhz) |
size_t | os_cpu_PageSize () |
size_t | os_cpu_LargePageSize () |
static void | GetMemoryStatus (MEMORYSTATUSEX &mse) |
size_t | os_cpu_QueryMemorySize () |
size_t | os_cpu_MemoryAvailable () |
DWORD_PTR | wcpu_AffinityFromProcessorMask (DWORD_PTR processAffinity, uintptr_t processorMask) |
uintptr_t | wcpu_ProcessorMaskFromAffinity (DWORD_PTR processAffinity, DWORD_PTR affinity) |
static void | VerifyRunningOnCorrectProcessors (DWORD_PTR affinity) |
uintptr_t | os_cpu_SetThreadAffinityMask (uintptr_t processorMask) |
restrict the current thread to a set of processors. More... | |
Status | os_cpu_CallByEachCPU (OsCpuCallback cb, uintptr_t cbData) |
execute the specified function once on each processor. More... | |
|
static |
Status os_cpu_CallByEachCPU | ( | OsCpuCallback | cb, |
uintptr_t | cbData | ||
) |
execute the specified function once on each processor.
this proceeds serially (the callback is never reentered) in increasing order of processor ID. fails if process affinity prevents running on all processors.
size_t os_cpu_LargePageSize | ( | ) |
size_t os_cpu_MemoryAvailable | ( | ) |
size_t os_cpu_NumProcessors | ( | ) |
note: this function is necessary because POSIX sysconf _SC_NPROCESSORS_CONF is not suppored on MacOSX, else we would use that.
size_t os_cpu_PageSize | ( | ) |
uintptr_t os_cpu_ProcessorMask | ( | ) |
size_t os_cpu_QueryMemorySize | ( | ) |
uintptr_t os_cpu_SetThreadAffinityMask | ( | uintptr_t | processorMask | ) |
restrict the current thread to a set of processors.
processorMask | a bit mask of acceptable processors (bit index i corresponds to processor i) |
|
static |
DWORD_PTR wcpu_AffinityFromProcessorMask | ( | DWORD_PTR | processAffinity, |
uintptr_t | processorMask | ||
) |
uintptr_t wcpu_ProcessorMaskFromAffinity | ( | DWORD_PTR | processAffinity, |
DWORD_PTR | affinity | ||
) |