mirror of
https://github.com/celisej567/source-engine.git
synced 2026-01-05 22:09:59 +03:00
build: arm target support
This commit is contained in:
@@ -22,7 +22,9 @@ const tchar* GetProcessorVendorId();
|
||||
|
||||
static bool cpuid(unsigned long function, unsigned long& out_eax, unsigned long& out_ebx, unsigned long& out_ecx, unsigned long& out_edx)
|
||||
{
|
||||
#if defined(GNUC)
|
||||
#if defined (__arm__) || defined( _X360 )
|
||||
return false;
|
||||
#elif defined(GNUC)
|
||||
asm("mov %%ebx, %%esi\n\t"
|
||||
"cpuid\n\t"
|
||||
"xchg %%esi, %%ebx"
|
||||
@@ -30,11 +32,9 @@ static bool cpuid(unsigned long function, unsigned long& out_eax, unsigned long&
|
||||
"=S" (out_ebx),
|
||||
"=c" (out_ecx),
|
||||
"=d" (out_edx)
|
||||
: "a" (function)
|
||||
: "a" (function)
|
||||
);
|
||||
return true;
|
||||
#elif defined( _X360 )
|
||||
return false;
|
||||
#elif defined(_WIN64)
|
||||
int pCPUInfo[4];
|
||||
__cpuid( pCPUInfo, (int)function );
|
||||
@@ -142,21 +142,21 @@ static bool IsWin98OrOlder()
|
||||
|
||||
static bool CheckSSETechnology(void)
|
||||
{
|
||||
#if defined( _X360 ) || defined( _PS3 )
|
||||
#if defined( __ARM__ )
|
||||
return false;
|
||||
#elif defined( _X360 ) || defined( _PS3 )
|
||||
return true;
|
||||
#else
|
||||
if ( IsWin98OrOlder() )
|
||||
{
|
||||
if ( IsWin98OrOlder() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long eax,ebx,edx,unused;
|
||||
if ( !cpuid(1,eax,ebx,unused,edx) )
|
||||
{
|
||||
unsigned long eax,ebx,edx,unused;
|
||||
if ( !cpuid(1,eax,ebx,unused,edx) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ( edx & 0x2000000L ) != 0;
|
||||
return ( edx & 0x2000000L ) != 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ uint64 CalculateCPUFreq()
|
||||
uint64 retVal = 1000000;
|
||||
return retVal * atoi( pFreq );
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
|
||||
// Try to open cpuinfo_max_freq. If the kernel was built with cpu scaling support disabled, this will fail.
|
||||
FILE *fp = fopen( "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", "r" );
|
||||
@@ -177,5 +177,6 @@ uint64 CalculateCPUFreq()
|
||||
}
|
||||
|
||||
return period;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user