diff options
author | Stanislav Sedov <stas@FreeBSD.org> | 2010-10-01 11:21:39 +0000 |
---|---|---|
committer | Stanislav Sedov <stas@FreeBSD.org> | 2010-10-01 11:21:39 +0000 |
commit | b8f56c104ca29cf0bf177b04a08520f211fb664d (patch) | |
tree | bb912771baf9fca835c03d52f3e778fbe3c18df2 /sysutils/x86info | |
parent | 29887f750856bf42e7c273e4b966eefea4fb51b6 (diff) | |
download | ports-b8f56c104ca29cf0bf177b04a08520f211fb664d.tar.gz ports-b8f56c104ca29cf0bf177b04a08520f211fb664d.zip |
Notes
Diffstat (limited to 'sysutils/x86info')
-rw-r--r-- | sysutils/x86info/Makefile | 6 | ||||
-rw-r--r-- | sysutils/x86info/distinfo | 6 | ||||
-rw-r--r-- | sysutils/x86info/files/patch-Intel_topology.c | 18 | ||||
-rw-r--r-- | sysutils/x86info/files/patch-cpuid.c | 77 |
4 files changed, 68 insertions, 39 deletions
diff --git a/sysutils/x86info/Makefile b/sysutils/x86info/Makefile index d6a189f3b4f6..50b6b963ce05 100644 --- a/sysutils/x86info/Makefile +++ b/sysutils/x86info/Makefile @@ -6,10 +6,10 @@ # PORTNAME= x86info -PORTVERSION= 1.25 +PORTVERSION= 1.27 CATEGORIES= sysutils -MASTER_SITES= http://www.codemonkey.org.uk/projects/x86info/ \ - http://www.codemonkey.org.uk/projects/x86info/old/ +MASTER_SITES= http://codemonkey.org.uk/projects/x86info/ \ + http://codemonkey.org.uk/projects/x86info/old/ EXTRACT_SUFX= .tgz MAINTAINER= stas@FreeBSD.org diff --git a/sysutils/x86info/distinfo b/sysutils/x86info/distinfo index 300e11b198bc..ffb345f71777 100644 --- a/sysutils/x86info/distinfo +++ b/sysutils/x86info/distinfo @@ -1,3 +1,3 @@ -MD5 (x86info-1.25.tgz) = 29143559c611272ec2045361a6ffd813 -SHA256 (x86info-1.25.tgz) = 4e7c9c25252142550e68a7c347bf41192fd282e30b5c0b2a1138a2465c4f7690 -SIZE (x86info-1.25.tgz) = 80716 +MD5 (x86info-1.27.tgz) = a618e4ac1b0aba44ee26aacad3611f1a +SHA256 (x86info-1.27.tgz) = dd6c7d5053fb520e7e47e6e2e08896a162fbbf6c247505127d0177cad19fe2a4 +SIZE (x86info-1.27.tgz) = 83312 diff --git a/sysutils/x86info/files/patch-Intel_topology.c b/sysutils/x86info/files/patch-Intel_topology.c index ea48ffbd757e..eceb99eea824 100644 --- a/sysutils/x86info/files/patch-Intel_topology.c +++ b/sysutils/x86info/files/patch-Intel_topology.c @@ -1,5 +1,5 @@ ---- Intel/topology.c.orig 2008-12-30 22:21:53.000000000 +0300 -+++ Intel/topology.c 2008-12-30 22:22:23.000000000 +0300 +--- Intel/topology.c.orig 2010-09-08 12:19:56.000000000 -0700 ++++ Intel/topology.c 2010-10-01 03:54:54.000000000 -0700 @@ -20,7 +20,7 @@ * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ @@ -9,12 +9,12 @@ { int r = 32; -@@ -55,7 +55,7 @@ +@@ -53,7 +53,7 @@ { - unsigned int MaskWidth = 0; - -- MaskWidth = fls(item)-1; -+ MaskWidth = priv_fls(item)-1; - return MaskWidth; - } + int order; +- order = fls(count) - 1; ++ order = priv_fls(count) - 1; + if (count & (count - 1)) + order++; + return order; diff --git a/sysutils/x86info/files/patch-cpuid.c b/sysutils/x86info/files/patch-cpuid.c index e4dd7e1b8ea7..b4b6acca00c4 100644 --- a/sysutils/x86info/files/patch-cpuid.c +++ b/sysutils/x86info/files/patch-cpuid.c @@ -1,10 +1,11 @@ ---- cpuid.c.orig 2008-12-16 22:09:47.000000000 +0300 -+++ cpuid.c 2008-12-30 22:36:09.000000000 +0300 -@@ -23,8 +23,15 @@ +--- cpuid.c.orig 2010-09-08 12:19:56.000000000 -0700 ++++ cpuid.c 2010-10-01 04:06:00.000000000 -0700 +@@ -23,8 +23,16 @@ #include <sched.h> #if defined(__FreeBSD__) +# include <sys/param.h> ++# include <sys/cpuset.h> # include <sys/ioctl.h> -# include <cpu.h> +# if __FreeBSD_version < 701102 @@ -17,31 +18,59 @@ #endif #include "x86info.h" -@@ -33,7 +40,9 @@ +@@ -45,7 +53,11 @@ unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { -+#if defined(__linux__) - cpu_set_t set; ++#if defined(__FreeBSD__) ++ cpuset_t set, tmp_set; ++#else + cpu_set_t set, tmp_set; +#endif unsigned int a = 0, b = 0, c = 0, d = 0; + int ret; - if (eax != NULL) -@@ -45,11 +54,13 @@ +@@ -58,15 +70,25 @@ if (edx != NULL) d = *edx; -+#if defined(__linux__) - if (sched_getaffinity(getpid(), sizeof(set), &set) == 0) { - CPU_ZERO(&set); - CPU_SET(cpunr, &set); - sched_setaffinity(getpid(), sizeof(set), &set); - } ++#if defined(__FreeBSD__) ++ ret = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, ++ -1, sizeof(set), &set); ++#else + ret = sched_getaffinity(getpid(), sizeof(set), &set); ++#endif + if (ret) + return ret; + + /* man CPU_SET(3): To duplicate a CPU set, use memcpy(3) */ +- memcpy(&tmp_set, &set, sizeof(cpu_set_t)); ++ memcpy(&tmp_set, &set, sizeof(tmp_set)); + CPU_ZERO(&set); + CPU_SET(cpunr, &set); ++#if defined(__FreeBSD__) ++ ret = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, ++ -1, sizeof(set), &set); ++#else + ret = sched_setaffinity(getpid(), sizeof(set), &set); +#endif + if (ret) + return ret; + +@@ -87,7 +109,12 @@ + *edx = d; - asm("cpuid" - : "=a" (a), -@@ -79,7 +90,11 @@ + /* Restore initial sched affinity */ ++#if defined(__FreeBSD__) ++ ret = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, ++ -1, sizeof(tmp_set), &tmp_set); ++#else + ret = sched_setaffinity(getpid(), sizeof(tmp_set), &tmp_set); ++#endif + if (ret) + return ret; + return 0; +@@ -106,7 +133,11 @@ char cpuname[20]; unsigned char buffer[16]; int fh; @@ -52,8 +81,8 @@ +#endif if (nodriver == 1) { - native_cpuid(CPU_number, idx, eax,ebx,ecx,edx); -@@ -88,10 +103,14 @@ + if (native_cpuid(CPU_number, idx, eax,ebx,ecx,edx)) +@@ -116,10 +147,14 @@ args.level = idx; /* Ok, use the /dev/CPU interface in preference to the _up code. */ @@ -69,16 +98,16 @@ perror(cpuname); exit(EXIT_FAILURE); } -@@ -106,8 +125,6 @@ +@@ -134,8 +169,6 @@ } else { /* Something went wrong, just do UP and hope for the best. */ nodriver = 1; - if (!silent && nrCPUs != 1) - perror(cpuname); - used_UP = 1; - native_cpuid(CPU_number, idx, eax,ebx,ecx,edx); - return; -@@ -154,7 +171,7 @@ + if (native_cpuid(CPU_number, idx, eax,ebx,ecx,edx)) { + printf("%s", NATIVE_CPUID_FAILED_MSG); + used_UP = 1; +@@ -187,7 +220,7 @@ fh = open(cpuname, O_RDONLY); if (fh != -1) { #ifndef S_SPLINT_S |