pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rdsn-git: Add more draft patches for NetBSD



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sat Feb 27 22:05:47 2016 +0100
Changeset:	34863efe29b68cf18f311ca2003137f2a5f747af

Modified Files:
	rdsn-git/distinfo
	rdsn-git/patches/patch-src_core_core_task__worker.cpp
Added Files:
	rdsn-git/patches/patch-src_core_tools_hpc_hpc__aio__provider.bsd.cpp
	rdsn-git/patches/patch-src_core_tools_hpc_hpc__aio__provider.h

Log Message:
rdsn-git: Add more draft patches for NetBSD

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=34863efe29b68cf18f311ca2003137f2a5f747af

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

diffstat:
 rdsn-git/distinfo                                  |  4 +-
 .../patches/patch-src_core_core_task__worker.cpp   | 17 ++++++-
 ...h-src_core_tools_hpc_hpc__aio__provider.bsd.cpp | 59 ++++++++++++++++++++++
 .../patch-src_core_tools_hpc_hpc__aio__provider.h  | 13 +++++
 4 files changed, 91 insertions(+), 2 deletions(-)

diffs:
diff --git a/rdsn-git/distinfo b/rdsn-git/distinfo
index ee61219..0ff5977 100644
--- a/rdsn-git/distinfo
+++ b/rdsn-git/distinfo
@@ -14,6 +14,8 @@ RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
 Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
 SHA1 (patch-include_dsn_internal_ports.h) = ccd24ba17720920ebafcb185bacd63952685c7fe
 SHA1 (patch-src_core_core_library__utils.cpp) = 72b92cf3d16b634ed19c44c5f56c65864054d365
-SHA1 (patch-src_core_core_task__worker.cpp) = 4250bf98519f38c6e4ef6319d697f201cd6502ce
+SHA1 (patch-src_core_core_task__worker.cpp) = 40f7bd56ff7b841a2542ff7ef29e49975f889c43
+SHA1 (patch-src_core_tools_hpc_hpc__aio__provider.bsd.cpp) = c21589c90d91c7acc440236d76178e3e30471c67
+SHA1 (patch-src_core_tools_hpc_hpc__aio__provider.h) = c712aa3f7268627058c1e81774663b8862472fde
 SHA1 (patch-src_dev_cpp_file__utils.cpp) = e1bec04a6857deded632f57e6d531d1a78b0418a
 SHA1 (patch-src_dev_cpp_utils.cpp) = 4cd5db8b3273bb5c24f8cf4c2d62877e4a8921a3
diff --git a/rdsn-git/patches/patch-src_core_core_task__worker.cpp b/rdsn-git/patches/patch-src_core_core_task__worker.cpp
index c7eedaf..c1dd832 100644
--- a/rdsn-git/patches/patch-src_core_core_task__worker.cpp
+++ b/rdsn-git/patches/patch-src_core_core_task__worker.cpp
@@ -22,9 +22,24 @@ $NetBSD$
      # endif
      if (err != 0)
      {
-@@ -255,10 +261,16 @@ void task_worker::set_affinity(uint64_t 
+@@ -254,11 +260,31 @@ void task_worker::set_affinity(uint64_t 
+         (thread_policy_t)&policy,
          THREAD_AFFINITY_POLICY_COUNT
          ));
++# elif defined(__NetBSD__)
++    cpuset_t *cpuset;
++    int nr_bits = std::min(nr_cpu, static_cast<int>(sizeof(affinity) * 8));
++
++    cpuset = cpuset_create();
++    cpuset_zero(cpuset);
++    for (int i = 0; i < nr_bits; i++)
++    {
++        if ((affinity & ((uint64_t)1 << i)) != 0)
++        {
++            cpuset_set(i, cpuset);
++        }
++    }
++    err = pthread_setaffinity_np(pthread_self(), cpuset_size(cpuset), cpuset);
  # else
 -    # ifdef __FreeBSD__
 +    # if defined(__FreeBSD__) || defined(__NetBSD__)
diff --git a/rdsn-git/patches/patch-src_core_tools_hpc_hpc__aio__provider.bsd.cpp b/rdsn-git/patches/patch-src_core_tools_hpc_hpc__aio__provider.bsd.cpp
new file mode 100644
index 0000000..208878e
--- /dev/null
+++ b/rdsn-git/patches/patch-src_core_tools_hpc_hpc__aio__provider.bsd.cpp
@@ -0,0 +1,59 @@
+$NetBSD$
+
+--- src/core/tools/hpc/hpc_aio_provider.bsd.cpp.orig	2016-02-27 19:59:48.000000000 +0000
++++ src/core/tools/hpc/hpc_aio_provider.bsd.cpp
+@@ -34,7 +34,7 @@
+  */
+ 
+ 
+-# if defined(__APPLE__) || defined(__FreeBSD__)
++# if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ 
+ # include "hpc_aio_provider.h"
+ # include <fcntl.h>
+@@ -44,6 +44,11 @@
+ # include <stdio.h>
+ # include "mix_all_io_looper.h"
+ 
++# if defined(__NetBSD__)
++# include <sys/event.h>
++# include <sys/aio.h>
++# endif
++
+ # ifdef __TITLE__
+ # undef __TITLE__
+ # endif
+@@ -53,7 +58,7 @@ namespace dsn { namespace tools {
+ 
+ struct posix_disk_aio_context : public disk_aio
+ {
+-    struct aiocb cb;
++    struct ::aiocb cb;
+     aio_task* tsk;
+     hpc_aio_provider* this_;
+     utils::notify_event* evt;
+@@ -62,7 +67,7 @@ struct posix_disk_aio_context : public d
+ };
+ 
+ #ifndef io_prep_pread
+-static inline void io_prep_pread(struct aiocb *iocb, int fd, void *buf, size_t count, long long offset)
++static inline void io_prep_pread(struct ::aiocb *iocb, int fd, void *buf, size_t count, long long offset)
+ {
+     memset(iocb, 0, sizeof(*iocb));
+     iocb->aio_fildes = fd;
+@@ -211,6 +216,7 @@ error_code hpc_aio_provider::aio_interna
+     }
+ 
+     // set up callback
++#if 0
+     aio->cb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
+     aio->cb.aio_sigevent.sigev_notify_kqueue = (int)(uintptr_t)_looper->native_handle();
+     aio->cb.aio_sigevent.sigev_notify_kevent_flags = EV_CLEAR;
+@@ -251,6 +257,7 @@ error_code hpc_aio_provider::aio_interna
+             return aio->err;
+         }
+     }
++#endif
+ }
+ 
+ void hpc_aio_provider::complete_aio(struct aiocb* io, int bytes, int err)
diff --git a/rdsn-git/patches/patch-src_core_tools_hpc_hpc__aio__provider.h b/rdsn-git/patches/patch-src_core_tools_hpc_hpc__aio__provider.h
new file mode 100644
index 0000000..16cea43
--- /dev/null
+++ b/rdsn-git/patches/patch-src_core_tools_hpc_hpc__aio__provider.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/core/tools/hpc/hpc_aio_provider.h.orig	2016-02-27 19:59:48.000000000 +0000
++++ src/core/tools/hpc/hpc_aio_provider.h
+@@ -75,7 +75,7 @@ namespace dsn {
+ 
+             io_context_t _ctx;
+             int          _event_fd;
+-# elif defined(__APPLE__) || defined(__FreeBSD__)
++# elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+             void complete_aio(struct aiocb* io, int bytes, int err);
+ # endif
+         };


Home | Main Index | Thread Index | Old Index