source: rtems/cpukit/score/include/rtems/score/apimutex.h @ dea3eccb

4.104.115
Last change on this file since dea3eccb was dea3eccb, checked in by Joel Sherrill <joel.sherrill@…>, on 09/06/09 at 15:24:08

2009-09-06 Sebastian Huber <Sebastian.Huber@…>

  • libcsupport/src/free.c, libmisc/stackchk/check.c, rtems/include/rtems/rtems/region.h, rtems/src/regioncreate.c, rtems/src/regionextend.c, rtems/src/regiongetinfo.c, rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c, rtems/src/regionresizesegment.c, score/src/pheapallocate.c, score/src/pheapallocatealigned.c, score/src/pheapextend.c, score/src/pheapfree.c, score/src/pheapgetblocksize.c, score/src/pheapgetfreeinfo.c, score/src/pheapgetinfo.c, score/src/pheapgetsize.c, score/src/pheapinit.c, score/src/pheapresizeblock.c, score/src/pheapwalk.c: Update for heap API changes.
  • score/include/rtems/score/apimutex.h, score/include/rtems/score/object.h: Documentation.
  • score/include/rtems/score/heap.h, score/include/rtems/score/protectedheap.h, score/inline/rtems/score/heap.inl, score/src/heap.c, score/src/heapallocate.c, score/src/heapallocatealigned.c, score/src/heapextend.c, score/src/heapfree.c, score/src/heapgetfreeinfo.c, score/src/heapgetinfo.c, score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c, score/src/heapwalk.c: Overall cleanup. Added boundary constraint to allocation function. More changes follow.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ScoreAPIMutex
5 *
6 * @brief API Mutex Handler API.
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.com/license/LICENSE.
16 *
17 *  $Id$
18 */
19
20#ifndef _RTEMS_SCORE_APIMUTEX_H
21#define _RTEMS_SCORE_APIMUTEX_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/**
28 * @defgroup ScoreAPIMutex API Mutex Handler
29 *
30 * @ingroup Score
31 *
32 * @brief Provides routines to ensure mutual exclusion on API level.
33 *
34 * @{
35 */
36
37#include <rtems/score/coremutex.h>
38#include <rtems/score/isr.h>
39#include <rtems/score/object.h>
40
41/**
42 * @brief Control block used to manage each API mutex.
43 */
44typedef struct {
45  /**
46   * @brief Allows each API Mutex to be a full-fledged RTEMS object.
47   */
48  Objects_Control Object;
49
50  /**
51   * Contains the SuperCore mutex information.
52   */
53  CORE_mutex_Control Mutex;
54} API_Mutex_Control;
55
56/**
57 * @brief Information control block used to manage this class of objects.
58 */
59SCORE_EXTERN Objects_Information _API_Mutex_Information;
60
61/**
62 * @brief Performs the initialization necessary for this handler.
63 *
64 * The value @a maximum_mutexes is the maximum number of API mutexes that may
65 * exist at any time.
66 */
67void _API_Mutex_Initialization( uint32_t maximum_mutexes );
68
69/**
70 * @brief Allocates an API mutex from the inactive set and returns it in
71 * @a mutex.
72 */
73void _API_Mutex_Allocate( API_Mutex_Control **mutex );
74
75/**
76 * @brief Acquires the specified API mutex @a mutex.
77 */
78void _API_Mutex_Lock( API_Mutex_Control *mutex );
79
80/**
81 * @brief Releases the specified API mutex @a mutex.
82 */
83void _API_Mutex_Unlock( API_Mutex_Control *mutex );
84
85/** @} */
86
87/**
88 * @defgroup ScoreAllocatorMutex RTEMS Allocator Mutex
89 *
90 * @ingroup ScoreAPIMutex
91 *
92 * @brief Protection for all memory allocations and deallocations in RTEMS.
93 *
94 * When the APIs all use this for allocation and deallocation protection, then
95 * this possibly should be renamed and moved to a higher level in the
96 * hierarchy.
97 *
98 * @{
99 */
100
101SCORE_EXTERN API_Mutex_Control *_RTEMS_Allocator_Mutex;
102
103#define _RTEMS_Lock_allocator() \
104  _API_Mutex_Lock( _RTEMS_Allocator_Mutex )
105
106#define _RTEMS_Unlock_allocator() \
107  _API_Mutex_Unlock( _RTEMS_Allocator_Mutex )
108
109/** @} */
110
111#ifdef __cplusplus
112}
113#endif
114
115#endif
116/*  end of include file */
Note: See TracBrowser for help on using the repository browser.