summaryrefslogtreecommitdiff
path: root/math/atlas/files/patch-CONFIG+src+backend+archinfo_freebsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/atlas/files/patch-CONFIG+src+backend+archinfo_freebsd.c')
-rw-r--r--math/atlas/files/patch-CONFIG+src+backend+archinfo_freebsd.c114
1 files changed, 88 insertions, 26 deletions
diff --git a/math/atlas/files/patch-CONFIG+src+backend+archinfo_freebsd.c b/math/atlas/files/patch-CONFIG+src+backend+archinfo_freebsd.c
index a8f1e062dab5..b390c3540a3e 100644
--- a/math/atlas/files/patch-CONFIG+src+backend+archinfo_freebsd.c
+++ b/math/atlas/files/patch-CONFIG+src+backend+archinfo_freebsd.c
@@ -1,32 +1,50 @@
---- CONFIG/src/backend/archinfo_freebsd.c.orig Wed Jan 31 06:30:00 2007
-+++ CONFIG/src/backend/archinfo_freebsd.c Thu Feb 8 16:37:05 2007
-@@ -73,13 +73,24 @@
+--- CONFIG/src/backend/archinfo_freebsd.c.orig 2011-05-14 13:33:24.000000000 -0400
++++ CONFIG/src/backend/archinfo_freebsd.c 2011-09-20 07:05:52.000000000 -0400
+@@ -62,7 +62,7 @@
+ switch(fam)
+ {
+ case AFPPC: /* don't know */
+- if (!CmndOneLine(NULL, "sysctl hw.model", res))
++ if (!CmndOneLine(NULL, "sysctl -n hw.model", res))
+ {
+ if (strstr(res, "PowerMac"))
+ {
+@@ -97,32 +97,57 @@
+ }
}
break;
- case AFSPARC: /* don't know */
-+ if (!CmndOneLine(NULL, "sysctl hw.model", res))
-+ {
+- case AFSPARC: /* don't know */
+- break;
+- case AFALPHA:
+- #if 0
+- if (!CmndOneLine(NULL, "sysctl hw.model", res))
++ case AFSPARC: /* from src/sys/sparc64/sparc64/identcpu.c */
++ if (!CmndOneLine(NULL, "sysctl -n hw.model", res))
+ {
+- if (strstr(res, "433au")) mach = Dec21164;
+- else if (strstr(res, "XP1000")) mach = Dec21264;
+ if (strstr(res, "UltraSparc-IV")) mach = SunUSIV;
-+ if (strstr(res, "UltraSparc-II")) mach = SunUSII;
-+ if (strstr(res, "UltraSparc-I")) mach = SunUSI;
-+ if (strstr(res, "UltraSparc")) mach = SunUSI;
++ else if (strstr(res, "UltraSparc-III")) mach = SunUSIII;
++ else if (strstr(res, "UltraSparc-II")) mach = SunUSII;
+ else mach = SunUSI;
-+ }
- break;
- case AFALPHA:
- #if 0
- if (!CmndOneLine(NULL, "sysctl hw.model", res))
- {
- if (strstr(res, "433au")) mach = Dec21164;
-+ else if (strstr(res, "500au")) mach = Dec21164;
-+ else if (strstr(res, "AlphaPC 164")) mach = Dec21164;
- else if (strstr(res, "XP1000")) mach = Dec21264;
-+ else mach = Dec21264;
}
- #endif
+- #endif
+ break;
+- case AFIA64: /* don't know */
++ case AFIA64: /* from src/sys/ia64/ia64/machdep.c */
++ if (!CmndOneLine(NULL, "sysctl -n hw.model", res))
++ {
++ if (strstr(res, "Deerfield")) mach = IA64Itan2;
++ else if (strstr(res, "McKinley")) mach = IA64Itan2;
++ else if (strstr(res, "Madison")) mach = IA64Itan2;
++ else if (strstr(res, "Montecito")) mach = IA64Itan2;
++ else if (strstr(res, "Montvale")) mach = IA64Itan2;
++ else if (strstr(res, "Merced")) mach = IA64Itan;
++ }
break;
-@@ -89,15 +100,33 @@
- if (!CmndOneLine(NULL, "sysctl hw.model", res))
+ case AFX86:
+- if (!CmndOneLine(NULL, "sysctl hw.model", res))
++ if (!CmndOneLine(NULL, "sysctl -n hw.model", res))
{
if (strstr(res, "Pentium Pro")) mach = IntPPRO;
+ else if (strstr(res, "Pentium(R) D")) mach = IntP4E;
@@ -63,13 +81,57 @@
}
break;
default:;
-@@ -156,8 +185,8 @@
+@@ -135,7 +160,7 @@
+ int ncpu = 0;
+ char *reslns, res[1024];
+
+- if (!CmndOneLine(NULL, "sysctl hw.ncpu", res)) ncpu = GetLastInt(res);
++ if (!CmndOneLine(NULL, "sysctl -n hw.ncpu", res)) ncpu = GetFirstInt(res);
+ return(ncpu);
+ }
+
+@@ -169,7 +194,8 @@
+ * 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)
+ */
+- if (strstr(res, "x86_64") || strstr(res, "ppc64") || strstr(res, "ia64"))
++ if (strstr(res, "amd64") || strstr(res, "ia64") ||
++ strstr(res, "powerpc64") || strstr(res, "sparc64"))
+ {
+ iret = 64;
+ *sure = 1;
+@@ -182,8 +208,10 @@
{
int mhz=0;
char res[1024];
- if (!CmndOneLine(NULL, "sysctl hw.cpufrequency", res) )
-+ if (!CmndOneLine(NULL, "sysctl machdep.tsc_freq", res) )
- mhz = GetFirstDouble(res) / 1000000;
+- mhz = GetFirstDouble(res) / 1000000;
++ if (!CmndOneLine(NULL, "sysctl -n dev.cpu.0.freq", res) )
++ mhz = GetFirstInt(res);
++ else if (!CmndOneLine(NULL, "sysctl -n hw.freq.cpu", res) )
++ mhz = GetFirstInt(res);
return(mhz);
}
+@@ -192,20 +220,7 @@
+ * RETURNS: 1 if cpu throttling is detected, 0 otherwise
+ */
+ {
+- int iret=0;
+- int imax=0, imin=0, icur=0;
+- char res[1024];
+-
+- if (!CmndOneLine(NULL, "sysctl hw.cpufrequency_max", res) )
+- imax = GetFirstInt(res);
+- if (!CmndOneLine(NULL, "sysctl hw.cpufrequency_min", res) )
+- imin = GetFirstInt(res);
+- if (imax)
+- {
+- if (imax != imin)
+- iret = 1;
+- }
+- return(iret);
++ return(0);
+ }
+
+ main(int nargs, char **args)