summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/sys/_rwlock.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-09-22 13:42:26 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-09-23 10:03:10 +0200
commitbe43b79fcabb7551677e2d27c75e2a500e2ba622 (patch)
treeadacb76593743ee5bf58d0ea5df2db97880b5d5a /freebsd/sys/sys/_rwlock.h
parentInclude missing header file (diff)
downloadrtems-libbsd-be43b79fcabb7551677e2d27c75e2a500e2ba622.tar.bz2
Replace RTEMS objects with custom implementation
Performance analysis revealed that the standard RTEMS objects are a major bottleneck. The object get mechanism and attribute checks at runtime have a significant overhead. Use a custom implementation for synchronization primitives. This drops also the size of the synchronization primitives considerably.
Diffstat (limited to 'freebsd/sys/sys/_rwlock.h')
-rw-r--r--freebsd/sys/sys/_rwlock.h7
1 files changed, 7 insertions, 0 deletions
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_ */