diff options
| author | Mathieu Arnold <mat@FreeBSD.org> | 2016-07-27 15:09:11 +0000 |
|---|---|---|
| committer | Mathieu Arnold <mat@FreeBSD.org> | 2016-07-27 15:09:11 +0000 |
| commit | 56bf85096cc89f91d28671b5d93b4172240263bc (patch) | |
| tree | 0574ce9eee45d627f943b80b2445882a762b52af /benchmarks/smhasher/files/patch-Platform.cpp | |
| parent | 26b078f5434c79c09183a623d0c9897d12fd26c9 (diff) | |
Cleanup patches, category benchmarks
Rename them to follow the make makepatch naming, and regenerate them.
With hat: portmgr
Sponsored by: Absolight
Diffstat (limited to 'benchmarks/smhasher/files/patch-Platform.cpp')
| -rw-r--r-- | benchmarks/smhasher/files/patch-Platform.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/benchmarks/smhasher/files/patch-Platform.cpp b/benchmarks/smhasher/files/patch-Platform.cpp new file mode 100644 index 000000000000..14311fb21cc2 --- /dev/null +++ b/benchmarks/smhasher/files/patch-Platform.cpp @@ -0,0 +1,41 @@ +--- Platform.cpp.orig 2014-04-22 21:40:50 UTC ++++ Platform.cpp +@@ -19,6 +19,38 @@ void SetAffinity ( int cpu ) + SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST); + } + ++#elif __FreeBSD__ ++ ++#include <string.h> ++#include <errno.h> ++#include <sys/types.h> ++#include <sys/param.h> ++#include <sys/cpuset.h> ++ ++void ++SetAffinity(int cpu) ++{ ++ cpuset_t mask; ++ unsigned int i; ++ ++ fprintf(stdout, "SetAffinity called with arg %d\n", cpu); ++ ++ CPU_ZERO(&mask); ++ i = 0; ++ do { ++ if (cpu & 1) { ++ CPU_SET(i, &mask); ++ } ++ i++; ++ cpu >>= 1; ++ } while (cpu); ++ ++ if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), &mask) == -1) ++ { ++ fprintf(stderr, "SetAffinity() failed. %s", strerror(errno)); ++ } ++} ++ + #else + + #include <sched.h> |
