Changeset View
Changeset View
Standalone View
Standalone View
math/atlas/files/patch-CONFIG+src+backend+archinfo_freebsd.c
--- CONFIG/src/backend/archinfo_freebsd.c.orig 2011-05-14 13:33:24.000000000 -0400 | --- CONFIG/src/backend/archinfo_freebsd.c.orig 2014-07-10 18:22:02.000000000 +0200 | ||||
+++ CONFIG/src/backend/archinfo_freebsd.c 2011-09-20 07:05:52.000000000 -0400 | +++ CONFIG/src/backend/archinfo_freebsd.c 2014-11-10 17:47:32.000000000 +0100 | ||||
@@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||||
switch(fam) | switch(fam) | ||||
{ | { | ||||
case AFPPC: /* don't know */ | case AFPPC: /* don't know */ | ||||
- if (!CmndOneLine(NULL, "sysctl hw.model", res)) | - res = atlsys_1L(NULL, "sysctl hw.model", 0, 0); | ||||
+ if (!CmndOneLine(NULL, "sysctl -n hw.model", res)) | + res = atlsys_1L(NULL, "sysctl -n hw.model", 0, 0); | ||||
if (res) | |||||
{ | { | ||||
if (strstr(res, "PowerMac")) | if (strstr(res, "PowerMac")) | ||||
{ | @@ -99,35 +99,61 @@ | ||||
@@ -97,32 +97,57 @@ | free(res); | ||||
} | |||||
} | } | ||||
break; | break; | ||||
- case AFSPARC: /* don't know */ | - case AFSPARC: /* don't know */ | ||||
Context not available. | |||||
- break; | - break; | ||||
- case AFALPHA: | - case AFALPHA: | ||||
- #if 0 | - #if 0 | ||||
- if (!CmndOneLine(NULL, "sysctl hw.model", res)) | - res = atlsys_1L(NULL, "sysctl hw.model", 0, 0); | ||||
+ case AFSPARC: /* from src/sys/sparc64/sparc64/identcpu.c */ | + case AFSPARC: /* from src/sys/sparc64/sparc64/identcpu.c */ | ||||
+ if (!CmndOneLine(NULL, "sysctl -n hw.model", res)) | + res = atlsys_1L(NULL, "sysctl -n hw.model", 0, 0); | ||||
if (res) | |||||
{ | { | ||||
- if (strstr(res, "433au")) mach = Dec21164; | - if (strstr(res, "433au")) mach = Dec21164; | ||||
- else if (strstr(res, "XP1000")) mach = Dec21264; | - else if (strstr(res, "XP1000")) mach = Dec21264; | ||||
Context not available. | |||||
+ else if (strstr(res, "UltraSparc-III")) mach = SunUSIII; | + else if (strstr(res, "UltraSparc-III")) mach = SunUSIII; | ||||
+ else if (strstr(res, "UltraSparc-II")) mach = SunUSII; | + else if (strstr(res, "UltraSparc-II")) mach = SunUSII; | ||||
+ else mach = SunUSI; | + else mach = SunUSI; | ||||
free(res); | |||||
} | } | ||||
- #endif | - #endif | ||||
break; | break; | ||||
- case AFIA64: /* don't know */ | - case AFIA64: /* don't know */ | ||||
+ case AFIA64: /* from src/sys/ia64/ia64/machdep.c */ | + case AFIA64: /* from src/sys/ia64/ia64/machdep.c */ | ||||
+ if (!CmndOneLine(NULL, "sysctl -n hw.model", res)) | + res = atlsys_1L(NULL, "sysctl -n hw.model", 0, 0); | ||||
+ if (res) | |||||
+ { | + { | ||||
+ if (strstr(res, "Deerfield")) mach = IA64Itan2; | + if (strstr(res, "Deerfield")) mach = IA64Itan2; | ||||
+ else if (strstr(res, "McKinley")) mach = IA64Itan2; | + else if (strstr(res, "McKinley")) mach = IA64Itan2; | ||||
Context not available. | |||||
+ else if (strstr(res, "Montecito")) mach = IA64Itan2; | + else if (strstr(res, "Montecito")) mach = IA64Itan2; | ||||
+ else if (strstr(res, "Montvale")) mach = IA64Itan2; | + else if (strstr(res, "Montvale")) mach = IA64Itan2; | ||||
+ else if (strstr(res, "Merced")) mach = IA64Itan; | + else if (strstr(res, "Merced")) mach = IA64Itan; | ||||
+ } | + } | ||||
break; | break; | ||||
case AFX86: | case AFX86: | ||||
- if (!CmndOneLine(NULL, "sysctl hw.model", res)) | - res = atlsys_1L(NULL, "sysctl hw.model", 0, 0); | ||||
+ if (!CmndOneLine(NULL, "sysctl -n hw.model", res)) | + res = atlsys_1L(NULL, "sysctl -n hw.model", 0, 0); | ||||
if (res) | |||||
{ | { | ||||
if (strstr(res, "Pentium Pro")) mach = IntPPRO; | if (strstr(res, "Pentium Pro")) mach = IntPPRO; | ||||
+ else if (strstr(res, "Pentium(R) D")) mach = IntP4E; | + else if (strstr(res, "Pentium(R) D")) mach = IntP4E; | ||||
Context not available. | |||||
+ else if (strstr(res, "Pentium/P55C")) mach = IntP5MMX; | + else if (strstr(res, "Pentium/P55C")) mach = IntP5MMX; | ||||
+ else if (strstr(res, "Pentium/P54C")) mach=IntP5; | + else if (strstr(res, "Pentium/P54C")) mach=IntP5; | ||||
+ else if (strstr(res, "Pentium")) mach=IntP5; | + else if (strstr(res, "Pentium")) mach=IntP5; | ||||
+ else if (strstr(res, "VIA")) mach=IntP5MMX; | + else if (strstr(res, "VIA")) mach=IntP5MMX; | ||||
+ else if (strstr(res, "Crusoe(tm)")) mach=IntP5MMX; | + else if (strstr(res, "Crusoe(tm)")) mach=IntP5MMX; | ||||
+ else mach = IntP5; | + else mach = IntP5; | ||||
free(res); | |||||
} | } | ||||
break; | break; | ||||
default:; | @@ -140,7 +166,7 @@ | ||||
@@ -135,7 +160,7 @@ | |||||
int ncpu = 0; | int ncpu = 0; | ||||
char *reslns, res[1024]; | char *res; | ||||
- if (!CmndOneLine(NULL, "sysctl hw.ncpu", res)) ncpu = GetLastInt(res); | - res = atlsys_1L(NULL, "sysctl hw.ncpu", 0, 0); | ||||
+ if (!CmndOneLine(NULL, "sysctl -n hw.ncpu", res)) ncpu = GetFirstInt(res); | + res = atlsys_1L(NULL, "sysctl -n hw.ncpu", 0, 0); | ||||
return(ncpu); | if (res) | ||||
} | { | ||||
ncpu = GetLastInt(res); | |||||
@@ -169,7 +194,8 @@ | @@ -185,7 +211,8 @@ | ||||
* If uname is a known 64-bit platform, we're sure we've got OS support | * If uname is a known 64-bit platform, we're sure we've got OS support | ||||
* for 64bits (may not have compiler support, but that's not our fault) | * for 64bits (may not have compiler support, but that's not our fault) | ||||
*/ | */ | ||||
Context not available. | |||||
+ if (strstr(res, "amd64") || strstr(res, "ia64") || | + if (strstr(res, "amd64") || strstr(res, "ia64") || | ||||
+ strstr(res, "powerpc64") || strstr(res, "sparc64")) | + strstr(res, "powerpc64") || strstr(res, "sparc64")) | ||||
{ | { | ||||
iret = 64; | |||||
*sure = 1; | *sure = 1; | ||||
@@ -182,8 +208,10 @@ | free(res); | ||||
@@ -200,13 +227,13 @@ | |||||
{ | { | ||||
int mhz=0; | int mhz=0; | ||||
char res[1024]; | char *res; | ||||
- if (!CmndOneLine(NULL, "sysctl hw.cpufrequency", res) ) | - res = atlsys_1L(NULL, "sysctl hw.cpufrequency", 0, 0); | ||||
+ res = atlsys_1L(NULL, "sysctl -n dev.cpu.0.freq", 0, 0); | |||||
if (res) | |||||
{ | |||||
- mhz = GetFirstDouble(res) / 1000000; | - mhz = GetFirstDouble(res) / 1000000; | ||||
+ if (!CmndOneLine(NULL, "sysctl -n dev.cpu.0.freq", res) ) | + mhz = GetFirstDouble(res); | ||||
+ mhz = GetFirstInt(res); | free(res); | ||||
+ else if (!CmndOneLine(NULL, "sysctl -n hw.freq.cpu", res) ) | } | ||||
+ mhz = GetFirstInt(res); | - else if ((res=atlsys_1L(NULL, "sysctl hw.clockrate", 0, 0))) | ||||
return(mhz); | + else if ((res=atlsys_1L(NULL, "sysctl -n hw.freq.cpu", 0, 0))) | ||||
} | { | ||||
mhz = GetFirstDouble(res); | |||||
@@ -192,20 +220,7 @@ | free(res); | ||||
@@ -219,28 +246,7 @@ | |||||
* RETURNS: 1 if cpu throttling is detected, 0 otherwise | * RETURNS: 1 if cpu throttling is detected, 0 otherwise | ||||
*/ | */ | ||||
{ | { | ||||
- int iret=0; | - int iret=0; | ||||
- int imax=0, imin=0, icur=0; | - int imax=0, imin=0, icur=0; | ||||
- char res[1024]; | - char *res; | ||||
- | - | ||||
- if (!CmndOneLine(NULL, "sysctl hw.cpufrequency_max", res) ) | - res = atlsys_1L(NULL, "sysctl hw.cpufrequency_max", 0, 0); | ||||
- if (res) | |||||
- { | |||||
- imax = GetFirstInt(res); | - imax = GetFirstInt(res); | ||||
- if (!CmndOneLine(NULL, "sysctl hw.cpufrequency_min", res) ) | - free(res); | ||||
- } | |||||
- res = atlsys_1L(NULL, "sysctl hw.cpufrequency_min", 0, 0); | |||||
- if (res) | |||||
- { | |||||
- imin = GetFirstInt(res); | - imin = GetFirstInt(res); | ||||
- free(res); | |||||
- } | |||||
- if (imax) | - if (imax) | ||||
- { | - { | ||||
- if (imax != imin) | - if (imax != imin) | ||||
Context not available. |