--- mpcpucache.c.bak 2009-03-10 16:18:07.000000000 -0500 +++ mpcpucache.c 2010-06-02 08:00:28.000000000 -0500 @@ -733,6 +733,32 @@ #endif #if defined(__ppc64__) + +#if defined(__FreeBSD__) +#include +#include + +#include +#include + +unsigned long +s_mpi_getProcessorLineSize() +{ + static int cacheline_size = 0; + static int cachemib[] = { CTL_MACHDEP, CPU_CACHELINE }; + int clen; + + if (cacheline_size > 0) + return cacheline_size; + + clen = sizeof(cacheline_size); + if (sysctl(cachemib, sizeof(cachemib) / sizeof(cachemib[0]), + &cacheline_size, &clen, NULL, 0) < 0 || !cacheline_size) + return 128; /* guess */ + + return cacheline_size; +} +#else /* * Sigh, The PPC has some really nice features to help us determine cache * size, since it had lots of direct control functions to do so. The POWER @@ -785,6 +811,7 @@ } return 0; } +#endif #define MPI_GET_PROCESSOR_LINE_SIZE_DEFINED 1 #endif