source: rtems/cpukit/include/rtems/rtems/barrierimpl.h @ 395a49e1

5
Last change on this file since 395a49e1 was 395a49e1, checked in by Sebastian Huber <sebastian.huber@…>, on 11/08/18 at 09:12:21

rtems: Move internal structures to barrierdata.h

Update #3598.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ClassicBarrierImpl
5 *
6 * @brief Classic Barrier Manager Implementation
7 */
8
9/*
10 * COPYRIGHT (c) 1989-2008.
11 * On-Line Applications Research Corporation (OAR).
12 *
13 * The license and distribution terms for this file may be
14 * found in the file LICENSE in this distribution or at
15 * http://www.rtems.org/license/LICENSE.
16 */
17
18#ifndef _RTEMS_RTEMS_BARRIERIMPL_H
19#define _RTEMS_RTEMS_BARRIERIMPL_H
20
21#include <rtems/rtems/barrierdata.h>
22#include <rtems/score/corebarrierimpl.h>
23#include <rtems/score/objectimpl.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/**
30 *  @defgroup ClassicBarrierImpl Classic Barrier Implementation
31 *
32 *  @ingroup ClassicBarrier
33 *
34 *  @{
35 */
36
37/**
38 *  The following defines the information control block used to manage
39 *  this class of objects.
40 */
41extern Objects_Information _Barrier_Information;
42
43/**
44 *  @brief _Barrier_Allocate
45 *
46 *  This function allocates a barrier control block from
47 *  the inactive chain of free barrier control blocks.
48 */
49RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Allocate( void )
50{
51  return (Barrier_Control *) _Objects_Allocate( &_Barrier_Information );
52}
53
54/**
55 *  @brief _Barrier_Free
56 *
57 *  This routine frees a barrier control block to the
58 *  inactive chain of free barrier control blocks.
59 */
60RTEMS_INLINE_ROUTINE void _Barrier_Free (
61  Barrier_Control *the_barrier
62)
63{
64  _CORE_barrier_Destroy( &the_barrier->Barrier );
65  _Objects_Free( &_Barrier_Information, &the_barrier->Object );
66}
67
68RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get(
69  Objects_Id            id,
70  Thread_queue_Context *queue_context
71)
72{
73  _Thread_queue_Context_initialize( queue_context );
74  return (Barrier_Control *) _Objects_Get(
75    id,
76    &queue_context->Lock_context.Lock_context,
77    &_Barrier_Information
78  );
79}
80
81/**@}*/
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif
88/*  end of include file */
Note: See TracBrowser for help on using the repository browser.