Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jan 2020 16:14:01 +0000 (UTC)
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r524210 - head/sysutils/cpuid/files
Message-ID:  <202001261614.00QGE1Ha065405@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <stdio.h>
  #include <sys/types.h>
  #include <sys/stat.h>
@@ -21,26 +24,18 @@
  #include <fcntl.h>
  #include <errno.h>
  #include <unistd.h>
-@@ -39,6 +41,8 @@
+@@ -57,6 +59,8 @@
  #include <string.h>
  #include <regex.h>
  #include <getopt.h>
 +#include <pthread.h>
 +#include <pthread_np.h>
  
- #ifdef USE_CPUID_MODULE
- #include <linux/major.h>
-@@ -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 <sys/processor.h>
+@@ -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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001261614.00QGE1Ha065405>