diff options
Diffstat (limited to 'freebsd/sys/sys')
-rw-r--r-- | freebsd/sys/sys/_lock.h | 10 | ||||
-rw-r--r-- | freebsd/sys/sys/_mutex.h | 5 | ||||
-rw-r--r-- | freebsd/sys/sys/_rwlock.h | 7 | ||||
-rw-r--r-- | freebsd/sys/sys/_sx.h | 5 | ||||
-rw-r--r-- | freebsd/sys/sys/condvar.h | 11 |
5 files changed, 22 insertions, 16 deletions
diff --git a/freebsd/sys/sys/_lock.h b/freebsd/sys/sys/_lock.h index 457ffd4d..35decd76 100644 --- a/freebsd/sys/sys/_lock.h +++ b/freebsd/sys/sys/_lock.h @@ -31,19 +31,11 @@ #ifndef _SYS__LOCK_H_ #define _SYS__LOCK_H_ -#ifdef __rtems__ -#include <rtems.h> -#include <rtems/chain.h> -#endif struct lock_object { -#ifdef __rtems__ - rtems_chain_node lo_node; - rtems_id lo_id; -#endif /* __rtems__ */ const char *lo_name; /* Individual lock name. */ u_int lo_flags; - u_int lo_data; /* General class specific data. */ #ifndef __rtems__ + u_int lo_data; /* General class specific data. */ struct witness *lo_witness; /* Data for witness. */ #endif /* __rtems__ */ }; diff --git a/freebsd/sys/sys/_mutex.h b/freebsd/sys/sys/_mutex.h index 9bf2d39f..2f4a674e 100644 --- a/freebsd/sys/sys/_mutex.h +++ b/freebsd/sys/sys/_mutex.h @@ -30,6 +30,9 @@ #ifndef _SYS__MUTEX_H_ #define _SYS__MUTEX_H_ +#ifdef __rtems__ +#include <machine/rtems-bsd-mutex.h> +#endif /* __rtems__ */ /* * Sleep/spin mutex. @@ -38,6 +41,8 @@ struct mtx { struct lock_object lock_object; /* Common lock properties. */ #ifndef __rtems__ volatile uintptr_t mtx_lock; /* Owner and flags. */ +#else /* __rtems__ */ + rtems_bsd_mutex mutex; #endif /* __rtems__ */ }; diff --git a/freebsd/sys/sys/_rwlock.h b/freebsd/sys/sys/_rwlock.h index c5adac0e..25eb55e9 100644 --- a/freebsd/sys/sys/_rwlock.h +++ b/freebsd/sys/sys/_rwlock.h @@ -31,13 +31,20 @@ #ifndef _SYS__RWLOCK_H_ #define _SYS__RWLOCK_H_ +#ifdef __rtems__ +#include <machine/rtems-bsd-mutex.h> +#endif /* __rtems__ */ /* * Reader/writer lock. */ struct rwlock { struct lock_object lock_object; +#ifndef __rtems__ volatile uintptr_t rw_lock; +#else /* __rtems__ */ + rtems_bsd_mutex mutex; +#endif /* __rtems__ */ }; #endif /* !_SYS__RWLOCK_H_ */ diff --git a/freebsd/sys/sys/_sx.h b/freebsd/sys/sys/_sx.h index 699316b6..b07ac47a 100644 --- a/freebsd/sys/sys/_sx.h +++ b/freebsd/sys/sys/_sx.h @@ -30,6 +30,9 @@ #ifndef _SYS__SX_H_ #define _SYS__SX_H_ +#ifdef __rtems__ +#include <machine/rtems-bsd-mutex.h> +#endif /* __rtems__ */ /* * Shared/exclusive lock main structure definition. @@ -38,6 +41,8 @@ struct sx { struct lock_object lock_object; #ifndef __rtems__ volatile uintptr_t sx_lock; +#else /* __rtems__ */ + rtems_bsd_mutex mutex; #endif /* __rtems__ */ }; diff --git a/freebsd/sys/sys/condvar.h b/freebsd/sys/sys/condvar.h index 51da8170..8b2ee4db 100644 --- a/freebsd/sys/sys/condvar.h +++ b/freebsd/sys/sys/condvar.h @@ -44,17 +44,14 @@ TAILQ_HEAD(cv_waitq, thread); * optimization to avoid looking up the sleep queue if there are no waiters. */ #ifdef __rtems__ -#include <pthread.h> -#include <rtems/chain.h> -#endif -struct cv { -#ifdef __rtems__ - rtems_chain_node cv_node; - pthread_cond_t cv_id; +#include <rtems/score/threadq.h> #endif /* __rtems__ */ +struct cv { const char *cv_description; #ifndef __rtems__ int cv_waiters; +#else /* __rtems__ */ + Thread_queue_Control cv_waiters; #endif /* __rtems__ */ }; |