Assert that the lock objects put into the off-page, fit into the page.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Konstantin Belousov 2016-04-08 10:21:43 +00:00
parent 222c454d33
commit 9e821f2796
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297701
5 changed files with 15 additions and 0 deletions

View File

@ -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);

View File

@ -40,6 +40,9 @@
#include "thr_private.h"
_Static_assert(sizeof(struct pthread_cond) <= PAGE_SIZE,
"pthread_cond too large");
/*
* Prototypes
*/

View File

@ -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

View File

@ -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);

View File

@ -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);