From debca222121fbbe5c615281958bc5a72fac3268f Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 3 Aug 2012 01:00:55 +0200 Subject: loader: remove weird kstat thing Apparently the win32 binary codec loader used this to retrieve the CPU frequency on Solaris. --- configure | 13 ------------- loader/win32.c | 47 ----------------------------------------------- 2 files changed, 60 deletions(-) diff --git a/configure b/configure index d64e397b07..b0b94f6776 100755 --- a/configure +++ b/configure @@ -1436,18 +1436,6 @@ fi echores "$_builtin_expect" -echocheck "kstat" -_kstat=no -statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes -if test "$_kstat" = yes ; then - def_kstat="#define HAVE_LIBKSTAT 1" - extra_ldflags="$extra_ldflags -lkstat" -else - def_kstat="#undef HAVE_LIBKSTAT" -fi -echores "$_kstat" - - echocheck "posix4" # required for nanosleep on some systems _posix4=no @@ -4216,7 +4204,6 @@ $def_builtin_expect $def_dl $def_dos_paths $def_iconv -$def_kstat $def_macosx_bundle $def_macosx_finder $def_priority diff --git a/loader/win32.c b/loader/win32.c index 3f1ef66a49..635892f22d 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -66,9 +66,6 @@ for DLL to know too much about its environment. #include #include #include -#ifdef HAVE_KSTAT -#include -#endif #ifdef HAVE_SYS_MMAN_H #include @@ -2149,47 +2146,6 @@ static double linux_cpuinfo_freq(void) return freq; } - -static double solaris_kstat_freq(void) -{ -#if defined(HAVE_LIBKSTAT) && defined(KSTAT_DATA_INT32) - /* - * try to extract the CPU speed from the solaris kernel's kstat data - */ - kstat_ctl_t *kc; - kstat_t *ksp; - kstat_named_t *kdata; - int mhz = 0; - - kc = kstat_open(); - if (kc != NULL) - { - ksp = kstat_lookup(kc, "cpu_info", 0, "cpu_info0"); - - /* kstat found and name/value pairs? */ - if (ksp != NULL && ksp->ks_type == KSTAT_TYPE_NAMED) - { - /* read the kstat data from the kernel */ - if (kstat_read(kc, ksp, NULL) != -1) - { - /* - * lookup desired "clock_MHz" entry, check the expected - * data type - */ - kdata = (kstat_named_t *)kstat_data_lookup(ksp, "clock_MHz"); - if (kdata != NULL && kdata->data_type == KSTAT_DATA_INT32) - mhz = kdata->value.i32; - } - } - kstat_close(kc); - } - - if (mhz > 0) - return mhz * 1000.; -#endif /* HAVE_LIBKSTAT */ - return -1; // kstat stuff is not available, CPU freq is unknown -} - /* * Measure CPU freq using the pentium's time stamp counter register (TSC) */ @@ -2216,9 +2172,6 @@ static double CPU_Freq(void) if ((freq = linux_cpuinfo_freq()) > 0) return freq; - if ((freq = solaris_kstat_freq()) > 0) - return freq; - return tsc_freq(); } -- cgit v1.2.3