Index: head/sysutils/cpuid/Makefile =================================================================== --- head/sysutils/cpuid/Makefile (revision 470706) +++ head/sysutils/cpuid/Makefile (revision 470707) @@ -1,38 +1,38 @@ # Created by: uffe@uffe.org # $FreeBSD$ PORTNAME= cpuid -PORTVERSION= 20170122 +DISTVERSION= 20180519 +DISTVERSIONSUFFIX= .src CATEGORIES= sysutils MASTER_SITES= http://www.etallen.com/cpuid/ PKGNAMESUFFIX= ${CPUID_SUFFIX} -DISTNAME= ${PORTNAME}-${PORTVERSION}.src MAINTAINER= pkubaj@anongoth.pl COMMENT= Tool to dump x86 CPUID information about the CPU(s) LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= amd64 i386 ONLY_FOR_ARCHS_REASON= only works with x86 CPUs USES= gmake perl5 USE_PERL5= build ALL_TARGET= default -WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} +WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION} # 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 470706) +++ head/sysutils/cpuid/distinfo (revision 470707) @@ -1,3 +1,3 @@ -TIMESTAMP = 1500174826 -SHA256 (cpuid-20170122.src.tar.gz) = 667612aae6704341dd10844e97c84c5c5c8700817a5937a3c293b55013bc4865 -SIZE (cpuid-20170122.src.tar.gz) = 80046 +TIMESTAMP = 1526817399 +SHA256 (cpuid-20180519.src.tar.gz) = 967823be36f23cbc972eb0aa882d069c1d155a5978990ac3bcf425e6a2e7ff9a +SIZE (cpuid-20180519.src.tar.gz) = 84784 Index: head/sysutils/cpuid/files/patch-cpuid.c =================================================================== --- head/sysutils/cpuid/files/patch-cpuid.c (revision 470706) +++ head/sysutils/cpuid/files/patch-cpuid.c (revision 470707) @@ -1,84 +1,96 @@ ---- cpuid.c.orig 2016-11-30 14:34:23 UTC +--- cpuid.c.orig 2018-04-19 14:15:07 UTC +++ cpuid.c -@@ -23,6 +23,8 @@ +@@ -21,17 +21,19 @@ + #ifdef __linux__ + #define USE_CPUID_MODULE #define USE_KERNEL_SCHED_SETAFFINITY ++#include #endif + #if __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ >= 40300 + #define USE_CPUID_COUNT + #endif + +#define CPUID_MAJOR 0 + #define _GNU_SOURCE #include #include -@@ -34,6 +36,8 @@ + #include +-#include + #include + #include + #include +@@ -39,6 +41,8 @@ #include #include #include +#include +#include #ifdef USE_CPUID_MODULE #include -@@ -58,6 +62,7 @@ typedef const char* const ccstring; +@@ -67,6 +71,7 @@ typedef const char* const ccstring; #define XSTR(x) STR(x) +#undef MAX #define MAX(l,r) ((l) > (r) ? (l) : (r)) #define LENGTH(array, type) (sizeof(array) / sizeof(type)) -@@ -6471,11 +6476,16 @@ real_setup(unsigned int cpu, +@@ -6622,11 +6627,16 @@ real_setup(unsigned int cpu, int status; 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) { -@@ -6590,11 +6600,14 @@ static int real_get (int cpuid - : "a" (reg), +@@ -6749,11 +6759,14 @@ static int real_get (int cpuid "c" (ecx)); + #endif } 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; -@@ -7138,7 +7151,7 @@ main(int argc, +@@ -7307,7 +7320,7 @@ main(int argc, }; boolean opt_one_cpu = FALSE; - boolean opt_inst = FALSE; + boolean opt_inst = TRUE; boolean opt_kernel = FALSE; boolean opt_raw = FALSE; boolean opt_debug = FALSE; -@@ -7268,7 +7281,8 @@ main(int argc, +@@ -7437,7 +7450,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));