Index: head/sysutils/cpuid/Makefile =================================================================== --- head/sysutils/cpuid/Makefile (revision 423877) +++ head/sysutils/cpuid/Makefile (revision 423878) @@ -1,37 +1,38 @@ # Created by: uffe@uffe.org # $FreeBSD$ PORTNAME= cpuid -PORTVERSION= 20140123 +PORTVERSION= 20160814 CATEGORIES= sysutils MASTER_SITES= http://www.etallen.com/cpuid/ PKGNAMESUFFIX= ${CPUID_SUFFIX} DISTNAME= ${PORTNAME}-${PORTVERSION}.src -MAINTAINER= ports@FreeBSD.org +MAINTAINER= pkubaj@anongoth.pl COMMENT= Tool to dump x86 CPUID information about the CPU(s) LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= i386 amd64 ONLY_FOR_ARCHS_REASON= only works with x86 CPUs -USES= gmake +USES= gmake perl5 +USE_PERL5= build ALL_TARGET= default WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} # Renamed to avoid conflict with misc/cpuid CPUID_SUFFIX= -etallen PLIST_FILES= bin/cpuid${CPUID_SUFFIX} \ man/man1/cpuid${CPUID_SUFFIX}.1.gz post-patch: ${REINPLACE_CMD} 's,CFL=.*,& -pthread,' ${WRKSRC}/Makefile do-install: ${INSTALL_PROGRAM} ${WRKSRC}/cpuid ${STAGEDIR}${PREFIX}/bin/cpuid${CPUID_SUFFIX} ${INSTALL_MAN} ${WRKSRC}/cpuid.man.gz ${STAGEDIR}${PREFIX}/man/man1/cpuid${CPUID_SUFFIX}.1.gz .include Index: head/sysutils/cpuid/distinfo =================================================================== --- head/sysutils/cpuid/distinfo (revision 423877) +++ head/sysutils/cpuid/distinfo (revision 423878) @@ -1,2 +1,3 @@ -SHA256 (cpuid-20140123.src.tar.gz) = b85aba5696d382f0dba8dc246bd42d09767089d6181a9cd0633d626f079d79ff -SIZE (cpuid-20140123.src.tar.gz) = 67882 +TIMESTAMP = 1476108297 +SHA256 (cpuid-20160814.src.tar.gz) = fd4e2b2d88f417ae32f47a92d29351de395a36578fde8aedc228e2e131f38ecd +SIZE (cpuid-20160814.src.tar.gz) = 77160 Index: head/sysutils/cpuid/files/patch-cpuid.c =================================================================== --- head/sysutils/cpuid/files/patch-cpuid.c (revision 423877) +++ head/sysutils/cpuid/files/patch-cpuid.c (revision 423878) @@ -1,75 +1,77 @@ ---- cpuid.c.orig 2014-01-24 01:26:27 UTC +--- cpuid.c.orig 2016-08-15 03:54:53 UTC +++ cpuid.c -@@ -17,6 +17,8 @@ - ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ +@@ -23,6 +23,8 @@ + #define USE_KERNEL_SCHED_SETAFFINITY + #endif +#define CPUID_MAJOR 0 + #define _GNU_SOURCE #include #include -@@ -26,11 +28,14 @@ - #include - #include +@@ -34,6 +36,8 @@ #include --#include -+//#include #include #include - #include - +#include +#include -+ - typedef int boolean; - #define TRUE 1 - #define FALSE 0 -@@ -5877,7 +5882,8 @@ real_setup(unsigned int cpu, - = (1 << cpu % (sizeof(unsigned int)*8)); + #ifdef USE_CPUID_MODULE + #include +@@ -6420,11 +6424,16 @@ real_setup(unsigned int cpu, int status; -- status = syscall(__NR_sched_setaffinity, 0, sizeof(mask), &mask); -+ //status = syscall(__NR_sched_setaffinity, 0, sizeof(mask), &mask); -+ status = pthread_setaffinity_np(0, sizeof(mask), &mask); + status = syscall(__NR_sched_setaffinity, 0, sizeof(mask), &mask); + #else +- cpu_set_t cpuset; ++ cpuset_t cpuset; + CPU_ZERO(&cpuset); + CPU_SET(cpu, &cpuset); + int status; +- status = sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); ++#if defined(__FreeBSD__) ++ status = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, ++ -1, sizeof(cpuset_t), &cpuset); ++#else ++ status = sched_setaffinity(0, sizeof(cpuset_t), &cpuset); ++#endif + #endif if (status == -1) { if (cpu > 0) { - if (errno == EINVAL) return -1; -@@ -5987,11 +5993,14 @@ static int real_get (int cpuid +@@ -6539,11 +6548,14 @@ static int real_get (int cpuid : "a" (reg), "c" (ecx)); } else { - off64_t result; - off64_t offset = ((off64_t)ecx << 32) + reg; + //off64_t result; + //off64_t offset = ((uint64_t)ecx << 32) + reg; + uint64_t result; + uint64_t offset = ((uint64_t)ecx << 32) + reg; int status; - result = lseek64(cpuid_fd, offset, SEEK_SET); + //result = lseek64(cpuid_fd, offset, SEEK_SET); + result = lseek(cpuid_fd, offset, SEEK_SET); if (result == -1) { if (quiet) { return FALSE; -@@ -6432,7 +6441,8 @@ main(int argc, +@@ -7050,7 +7062,8 @@ main(int argc, }; boolean opt_one_cpu = FALSE; - boolean opt_inst = FALSE; + //boolean opt_inst = FALSE; + boolean opt_inst = TRUE; boolean opt_kernel = FALSE; boolean opt_raw = FALSE; boolean opt_debug = FALSE; -@@ -6508,7 +6518,8 @@ main(int argc, +@@ -7134,7 +7147,8 @@ main(int argc, } // Default to -i. So use inst unless -k is specified. - boolean inst = !opt_kernel; + //boolean inst = !opt_kernel; + boolean inst = TRUE; if (opt_version) { printf("cpuid version %s\n", XSTR(VERSION));