diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2016-04-08 10:21:43 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2016-04-08 10:21:43 +0000 |
commit | 9e821f27969c12a51a08a2f4cd10449cac8b4382 (patch) | |
tree | f9ffd2a1454f197b9f128f06e224492882967f53 /lib | |
parent | 222c454d33e785f114c6138f48da62cb1d2a570e (diff) | |
download | src-test2-9e821f27969c12a51a08a2f4cd10449cac8b4382.tar.gz src-test2-9e821f27969c12a51a08a2f4cd10449cac8b4382.zip |
Notes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libthr/thread/thr_barrier.c | 3 | ||||
-rw-r--r-- | lib/libthr/thread/thr_cond.c | 3 | ||||
-rw-r--r-- | lib/libthr/thread/thr_mutex.c | 3 | ||||
-rw-r--r-- | lib/libthr/thread/thr_pspinlock.c | 3 | ||||
-rw-r--r-- | lib/libthr/thread/thr_rwlock.c | 3 |
5 files changed, 15 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_barrier.c b/lib/libthr/thread/thr_barrier.c index 45ca41a18f9d..ad4477d0089c 100644 --- a/lib/libthr/thread/thr_barrier.c +++ b/lib/libthr/thread/thr_barrier.c @@ -34,6 +34,9 @@ #include "thr_private.h" +_Static_assert(sizeof(struct pthread_barrier) <= PAGE_SIZE, + "pthread_barrier is too large for off-page"); + __weak_reference(_pthread_barrier_init, pthread_barrier_init); __weak_reference(_pthread_barrier_wait, pthread_barrier_wait); __weak_reference(_pthread_barrier_destroy, pthread_barrier_destroy); diff --git a/lib/libthr/thread/thr_cond.c b/lib/libthr/thread/thr_cond.c index 934f9a04a63a..13487bfe48ac 100644 --- a/lib/libthr/thread/thr_cond.c +++ b/lib/libthr/thread/thr_cond.c @@ -40,6 +40,9 @@ #include "thr_private.h" +_Static_assert(sizeof(struct pthread_cond) <= PAGE_SIZE, + "pthread_cond too large"); + /* * Prototypes */ diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index 865e4cfbb29f..f732a63118fe 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -51,6 +51,9 @@ #include "thr_private.h" +_Static_assert(sizeof(struct pthread_mutex) <= PAGE_SIZE, + "pthread_mutex is too large for off-page"); + /* * For adaptive mutexes, how many times to spin doing trylock2 * before entering the kernel to block diff --git a/lib/libthr/thread/thr_pspinlock.c b/lib/libthr/thread/thr_pspinlock.c index 1c9b41285599..124e97b47e27 100644 --- a/lib/libthr/thread/thr_pspinlock.c +++ b/lib/libthr/thread/thr_pspinlock.c @@ -38,6 +38,9 @@ #include "thr_private.h" +_Static_assert(sizeof(struct pthread_spinlock) <= PAGE_SIZE, + "pthread_spinlock is too large for off-page"); + #define SPIN_COUNT 100000 __weak_reference(_pthread_spin_init, pthread_spin_init); diff --git a/lib/libthr/thread/thr_rwlock.c b/lib/libthr/thread/thr_rwlock.c index aadd0e9ab183..8e9fd7385772 100644 --- a/lib/libthr/thread/thr_rwlock.c +++ b/lib/libthr/thread/thr_rwlock.c @@ -35,6 +35,9 @@ #include "un-namespace.h" #include "thr_private.h" +_Static_assert(sizeof(struct pthread_rwlock) <= PAGE_SIZE, + "pthread_rwlock is too large for off-page"); + __weak_reference(_pthread_rwlock_destroy, pthread_rwlock_destroy); __weak_reference(_pthread_rwlock_init, pthread_rwlock_init); __weak_reference(_pthread_rwlock_rdlock, pthread_rwlock_rdlock); |