summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/inline/rtems
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2006-09-25 13:38:24 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2006-09-25 13:38:24 +0000
commit8042961d87b10e0bf0b0f021e24dbb8eb1979841 (patch)
tree975fa83004c5c30404880036836cdfae88e775ab /cpukit/rtems/inline/rtems
parentAdd name. (diff)
downloadrtems-8042961d87b10e0bf0b0f021e24dbb8eb1979841.tar.bz2
2006-09-25 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/Makefile.am, rtems/preinstall.am, rtems/include/rtems.h, rtems/include/rtems/rtems/attr.h, rtems/include/rtems/rtems/config.h, rtems/inline/rtems/rtems/attr.inl, rtems/macros/rtems/rtems/attr.inl: Add Classic API Barriers. * rtems/include/rtems/rtems/barrier.h, rtems/include/rtems/rtems/barriermp.h, rtems/inline/rtems/rtems/barrier.inl, rtems/macros/rtems/rtems/barrier.inl, rtems/src/barrier.c, rtems/src/barriercreate.c, rtems/src/barrierdelete.c, rtems/src/barrierident.c, rtems/src/barrierrelease.c, rtems/src/barriertranslatereturncode.c, rtems/src/barrierwait.c: New files.
Diffstat (limited to '')
-rw-r--r--cpukit/rtems/inline/rtems/rtems/attr.inl17
-rw-r--r--cpukit/rtems/inline/rtems/rtems/barrier.inl79
2 files changed, 96 insertions, 0 deletions
diff --git a/cpukit/rtems/inline/rtems/rtems/attr.inl b/cpukit/rtems/inline/rtems/rtems/attr.inl
index 387bf6b888..54dd93d729 100644
--- a/cpukit/rtems/inline/rtems/rtems/attr.inl
+++ b/cpukit/rtems/inline/rtems/rtems/attr.inl
@@ -196,6 +196,23 @@ RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority_ceiling(
/*PAGE
*
+ * _Attributes_Is_barrier_automatic
+ *
+ * DESCRIPTION:
+ *
+ * This function returns TRUE if the barrier automatic release
+ * attribute is enabled in the attribute_set and FALSE otherwise.
+ */
+
+RTEMS_INLINE_ROUTINE boolean _Attributes_Is_barrier_automatic(
+ rtems_attribute attribute_set
+)
+{
+ return ( attribute_set & RTEMS_BARRIER_AUTOMATIC_RELEASE );
+}
+
+/*PAGE
+ *
* _Attributes_Is_system_task
*
* DESCRIPTION:
diff --git a/cpukit/rtems/inline/rtems/rtems/barrier.inl b/cpukit/rtems/inline/rtems/rtems/barrier.inl
new file mode 100644
index 0000000000..e296b88e72
--- /dev/null
+++ b/cpukit/rtems/inline/rtems/rtems/barrier.inl
@@ -0,0 +1,79 @@
+/**
+ * @file rtems/rtems/barrier.inl
+ */
+
+/*
+ * This file contains the static inlin implementation of the inlined
+ * routines from the Barrier Manager.
+ *
+ * COPYRIGHT (c) 1989-2006.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifndef _RTEMS_RTEMS_BARRIER_INL
+#define _RTEMS_RTEMS_BARRIER_INL
+
+/**
+ * @brief _Barrier_Allocate
+ *
+ * This function allocates a barrier control block from
+ * the inactive chain of free barrier control blocks.
+ */
+RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Allocate( void )
+{
+ return (Barrier_Control *) _Objects_Allocate( &_Barrier_Information );
+}
+
+/**
+ * @brief _Barrier_Free
+ *
+ * This routine frees a barrier control block to the
+ * inactive chain of free barrier control blocks.
+ */
+RTEMS_INLINE_ROUTINE void _Barrier_Free (
+ Barrier_Control *the_barrier
+)
+{
+ _Objects_Free( &_Barrier_Information, &the_barrier->Object );
+}
+
+/**
+ * @brief _Barrier_Get
+ *
+ * This function maps barrier IDs to barrier control blocks.
+ * If ID corresponds to a local barrier, then it returns
+ * the_barrier control pointer which maps to ID and location
+ * is set to OBJECTS_LOCAL. if the barrier ID is global and
+ * resides on a remote node, then location is set to OBJECTS_REMOTE,
+ * and the_barrier is undefined. Otherwise, location is set
+ * to OBJECTS_ERROR and the_barrier is undefined.
+ */
+RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get (
+ Objects_Id id,
+ Objects_Locations *location
+)
+{
+ return (Barrier_Control *)
+ _Objects_Get( &_Barrier_Information, id, location );
+}
+
+/**
+ * @brief _Barrier_Is_null
+ *
+ * This function returns TRUE if the_barrier is NULL and FALSE otherwise.
+ */
+RTEMS_INLINE_ROUTINE boolean _Barrier_Is_null (
+ Barrier_Control *the_barrier
+)
+{
+ return ( the_barrier == NULL );
+}
+
+#endif
+/* end of include file */