From owner-svn-ports-head@freebsd.org Sun Jan 26 16:14:01 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8C3C1F2C5F; Sun, 26 Jan 2020 16:14:01 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485Hxj3YCtz4D7J; Sun, 26 Jan 2020 16:14:01 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6042F23AD9; Sun, 26 Jan 2020 16:14:01 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QGE102065406; Sun, 26 Jan 2020 16:14:01 GMT (envelope-from pkubaj@FreeBSD.org) Received: (from pkubaj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QGE1Ha065405; Sun, 26 Jan 2020 16:14:01 GMT (envelope-from pkubaj@FreeBSD.org) Message-Id: <202001261614.00QGE1Ha065405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkubaj set sender to pkubaj@FreeBSD.org using -f From: Piotr Kubaj Date: Sun, 26 Jan 2020 16:14:01 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r524210 - head/sysutils/cpuid/files X-SVN-Group: ports-head X-SVN-Commit-Author: pkubaj X-SVN-Commit-Paths: head/sysutils/cpuid/files X-SVN-Commit-Revision: 524210 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 16:14:01 -0000 Author: pkubaj Date: Sun Jan 26 16:14:00 2020 New Revision: 524210 URL: https://svnweb.freebsd.org/changeset/ports/524210 Log: sysutils/cpuid: adjust patch Modified: head/sysutils/cpuid/files/patch-cpuid.c Modified: head/sysutils/cpuid/files/patch-cpuid.c ============================================================================== --- head/sysutils/cpuid/files/patch-cpuid.c Sun Jan 26 16:14:00 2020 (r524209) +++ head/sysutils/cpuid/files/patch-cpuid.c Sun Jan 26 16:14:00 2020 (r524210) @@ -1,6 +1,6 @@ ---- cpuid.c.orig 2018-04-19 14:15:07 UTC +--- cpuid.c.orig 2020-01-22 16:55:23 UTC +++ cpuid.c -@@ -21,17 +21,19 @@ +@@ -33,12 +33,15 @@ #ifdef __linux__ #define USE_CPUID_MODULE #define USE_KERNEL_SCHED_SETAFFINITY @@ -13,7 +13,10 @@ +#define CPUID_MAJOR 0 + - #define _GNU_SOURCE + #if defined(__GNUC__) + #define UNUSED __attribute((unused)) + #else +@@ -49,7 +52,6 @@ #include #include #include @@ -21,26 +24,18 @@ #include #include #include -@@ -39,6 +41,8 @@ +@@ -57,6 +59,8 @@ #include #include #include +#include +#include - #ifdef USE_CPUID_MODULE - #include -@@ -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)) -@@ -6622,11 +6627,16 @@ real_setup(unsigned int cpu, - int status; - status = syscall(__NR_sched_setaffinity, 0, sizeof(mask), &mask); + #if defined(__sun) + #include +@@ -8123,12 +8127,17 @@ real_setup(unsigned int cpu, + pthread_t thread = pthread_self(); + int status = processor_bind(P_LWPID, thread, cpu, NULL); #else - cpu_set_t cpuset; + cpuset_t cpuset; @@ -53,11 +48,12 @@ + -1, sizeof(cpuset_t), &cpuset); +#else + status = sched_setaffinity(0, sizeof(cpuset_t), &cpuset); -+#endif #endif ++#endif if (status == -1) { if (cpu > 0) { -@@ -6749,11 +6759,14 @@ static int real_get (int cpuid + if (errno == EINVAL) return -1; +@@ -8250,11 +8259,14 @@ static int real_get (int cpuid_fd, "c" (ecx)); #endif } else { @@ -75,7 +71,7 @@ if (result == -1) { if (quiet) { return FALSE; -@@ -7307,7 +7320,7 @@ main(int argc, +@@ -8819,7 +8831,7 @@ main(int argc, }; boolean opt_one_cpu = FALSE; @@ -84,7 +80,7 @@ boolean opt_kernel = FALSE; boolean opt_raw = FALSE; boolean opt_debug = FALSE; -@@ -7437,7 +7450,8 @@ main(int argc, +@@ -8950,7 +8962,8 @@ main(int argc, } // Default to -i. So use inst unless -k is specified.