diff options
Diffstat (limited to 'pr/src/misc/prsystem.c')
-rw-r--r-- | pr/src/misc/prsystem.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/pr/src/misc/prsystem.c b/pr/src/misc/prsystem.c index d0775d34..40c6eaac 100644 --- a/pr/src/misc/prsystem.c +++ b/pr/src/misc/prsystem.c @@ -255,6 +255,8 @@ PR_IMPLEMENT(PRInt32) PR_GetNumberOfProcessors( void ) } #elif defined(IRIX) numCpus = sysconf( _SC_NPROC_ONLN ); +#elif defined(RISCOS) + numCpus = 1; #elif defined(XP_UNIX) numCpus = sysconf( _SC_NPROCESSORS_ONLN ); #else @@ -276,20 +278,20 @@ PR_IMPLEMENT(PRInt32) PR_GetNumberOfProcessors( void ) */ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void) { - PRUint64 bytes = LL_ZERO; + PRUint64 bytes = 0; #if defined(LINUX) || defined(SOLARIS) long pageSize = sysconf(_SC_PAGESIZE); long pageCount = sysconf(_SC_PHYS_PAGES); - LL_I2L(bytes, pageSize * pageCount); + bytes = (PRUint64) pageSize * pageCount; #elif defined(HPUX) struct pst_static info; int result = pstat_getstatic(&info, sizeof(info), 1, 0); if (result == 1) - LL_I2L(bytes, info.physical_memory * info.page_size); + bytes = (PRUint64) info.physical_memory * info.page_size; #elif defined(DARWIN) @@ -301,7 +303,7 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void) (host_info_t) &hInfo, &count); if (result == KERN_SUCCESS) - LL_I2L(bytes, hInfo.memory_size); + bytes = hInfo.memory_size; #elif defined(WIN32) @@ -317,16 +319,16 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void) memStat.dwLength = sizeof(memStat); if (globalMemory(&memStat)) - LL_UI2L(bytes, memStat.ullTotalPhys); + bytes = memStat.ullTotalPhys; } } - if (LL_EQ(bytes, LL_ZERO)) { + if (!bytes) { /* Fall back to the older API. */ MEMORYSTATUS memStat; memset(&memStat, 0, sizeof(memStat)); GlobalMemoryStatus(&memStat); - LL_I2L(bytes, memStat.dwTotalPhys); + bytes = memStat.dwTotalPhys; } #elif defined(OS2) @@ -336,7 +338,7 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void) QSV_TOTPHYSMEM, &ulPhysMem, sizeof(ulPhysMem)); - LL_I2L(bytes, ulPhysMem); + bytes = ulPhysMem; #elif defined(AIX) @@ -344,9 +346,7 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void) int how_many; struct CuAt *obj = getattr("sys0", "realmem", 0, &how_many); if (obj != NULL) { - PRUint64 kbytes; - LL_I2L(kbytes, atoi(obj->value)); - LL_MUL(bytes, kbytes, 1024); + bytes = (PRUint64) atoi(obj->value) * 1024; free(obj); } odm_terminate(); |