forked from 0ad/0ad
janwas
73683b6109
. the massive renaming undertaking: camelCase functions -> PascalCase. . add some cppdoc. . minor additional renaming improvements: e.g. GetIsClosed -> IsClosed . in entity code, replace constructs like "pvec = new vector; return pvec; use *pvec; delete pvec" with a simple stack variable passed as output parameter (avoid unnecessary dynamic allocs) . timer: simpler handling of raw ticks vs normal timer (less #if) This was SVN commit r5017.
53 lines
801 B
C++
53 lines
801 B
C++
#include "precompiled.h"
|
|
|
|
#include "ucpu.h"
|
|
|
|
int ucpu_IsThrottlingPossible()
|
|
{
|
|
return -1; // don't know
|
|
}
|
|
|
|
int ucpu_NumPackages()
|
|
{
|
|
long res = sysconf(_SC_NPROCESSORS_CONF);
|
|
if (res == -1)
|
|
return 1;
|
|
else
|
|
return (int)res;
|
|
}
|
|
|
|
double ucpu_ClockFrequency()
|
|
{
|
|
return -1; // don't know
|
|
}
|
|
|
|
|
|
// apparently not possible on non-Windows OSes because they seem to lack
|
|
// a CPU affinity API. see sysdep.h comment.
|
|
LibError ucpu_CallByEachCPU(CpuCallback cb, void* param)
|
|
{
|
|
UNUSED2(cb);
|
|
|
|
/*
|
|
cpu_set_t currentCPU;
|
|
|
|
while ( j < sysNumProcs )
|
|
|
|
{
|
|
|
|
CPU_ZERO(¤tCPU);
|
|
|
|
CPU_SET(j, ¤tCPU);
|
|
|
|
if ( sched_setaffinity (0, sizeof (currentCPU), ¤tCPU)
|
|
|
|
== 0 )
|
|
|
|
{
|
|
|
|
sleep(0); // Ensure system to switch to the right
|
|
*/
|
|
|
|
return ERR::NO_SYS;
|
|
}
|