CVS commit: xsrc/external/mit/MesaLib/dist/src/util

2019-09-24 Thread Maya Rashish
Module Name:xsrc
Committed By:   maya
Date:   Tue Sep 24 19:47:33 UTC 2019

Modified Files:
xsrc/external/mit/MesaLib/dist/src/util: u_queue.c

Log Message:
Apply u_queue.c patch from pkgsrc:

atexit is not a good idea in shared libraries.
attempt to port cpuset logic to netbsd


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/MesaLib/dist/src/util/u_queue.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/MesaLib/dist/src/util/u_queue.c
diff -u xsrc/external/mit/MesaLib/dist/src/util/u_queue.c:1.3 xsrc/external/mit/MesaLib/dist/src/util/u_queue.c:1.4
--- xsrc/external/mit/MesaLib/dist/src/util/u_queue.c:1.3	Tue Sep 24 19:26:51 2019
+++ xsrc/external/mit/MesaLib/dist/src/util/u_queue.c	Tue Sep 24 19:47:33 2019
@@ -48,15 +48,22 @@ static once_flag atexit_once_flag = ONCE
 static struct list_head queue_list;
 static mtx_t exit_mutex = _MTX_INITIALIZER_NP;
 
+#define HAVE_NOATEXIT
+#if defined(HAVE_NOATEXIT)
 static int global_init_called = 0;
 
 static void __attribute__((__destructor__))
+#else
+static void
+#endif
 atexit_handler(void)
 {
struct util_queue *iter;
 
+#if defined(HAVE_NOATEXIT)
if (!global_init_called)
   return;
+#endif
 
mtx_lock(_mutex);
/* Wait for all queues to assert idle. */
@@ -70,7 +77,11 @@ static void
 global_init(void)
 {
LIST_INITHEAD(_list);
+#if defined(HAVE_NOATEXIT)
global_init_called = 1;
+#else
+   atexit(atexit_handler);
+#endif
 }
 
 static void
@@ -251,12 +262,25 @@ util_queue_thread_func(void *input)
   /* Don't inherit the thread affinity from the parent thread.
* Set the full mask.
*/
+#if defined(__NetBSD__)
+  cpuset_t *cpuset;
+  cpuset = cpuset_create();
+  if (cpuset != NULL) {
+ cpuset_zero(cpuset);
+ for (unsigned i = 0; i < cpuset_size(cpuset); i++)
+cpuset_set(i, cpuset);
+
+ pthread_setaffinity_np(pthread_self(), cpuset_size(cpuset), cpuset);
+ cpuset_destroy(cpuset);
+  }
+#else
   cpu_set_t cpuset;
   CPU_ZERO();
   for (unsigned i = 0; i < CPU_SETSIZE; i++)
  CPU_SET(i, );
 
   pthread_setaffinity_np(pthread_self(), sizeof(cpuset), );
+#endif
}
 #endif
 



CVS commit: xsrc/external/mit/MesaLib/dist/src/util

2019-09-24 Thread Maya Rashish
Module Name:xsrc
Committed By:   maya
Date:   Tue Sep 24 19:47:33 UTC 2019

Modified Files:
xsrc/external/mit/MesaLib/dist/src/util: u_queue.c

Log Message:
Apply u_queue.c patch from pkgsrc:

atexit is not a good idea in shared libraries.
attempt to port cpuset logic to netbsd


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/MesaLib/dist/src/util/u_queue.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: xsrc/external/mit/MesaLib/dist/src/util

2019-05-11 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Sat May 11 18:50:15 UTC 2019

Modified Files:
xsrc/external/mit/MesaLib/dist/src/util: u_atomic.c

Log Message:
try again to get it working for clang


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: xsrc/external/mit/MesaLib/dist/src/util

2019-05-11 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Sat May 11 18:50:15 UTC 2019

Modified Files:
xsrc/external/mit/MesaLib/dist/src/util: u_atomic.c

Log Message:
try again to get it working for clang


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c
diff -u xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c:1.4 xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c:1.5
--- xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c:1.4	Thu May  2 16:56:21 2019
+++ xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c	Sat May 11 14:50:15 2019
@@ -62,12 +62,9 @@ __atomic_fetch_sub_8(volatile long long 
return r;
 }
 
+#ifndef __clang__
 WEAK long long
-__sync_val_compare_and_swap_8(volatile long long *ptr, long long oldval, long long newval
-#ifdef __clang__
-	, ...
-#endif
-)
+__sync_val_compare_and_swap_8(volatile long long *ptr, long long oldval, long long newval)
 {
long long r;
 
@@ -79,5 +76,6 @@ __sync_val_compare_and_swap_8(volatile l
 
return r;
 }
+#endif
 
 #endif