source: rtems/cpukit/rtems/include/rtems/rtems/part.h @ f9293df

4.104.114.95
Last change on this file since f9293df was f9293df, checked in by Joel Sherrill <joel.sherrill@…>, on 04/18/08 at 20:08:08

2008-04-18 Joel Sherrill <joel.sherrill@…>

  • rtems/Doxyfile, rtems/include/rtems/rtems/asr.h, rtems/include/rtems/rtems/attr.h, rtems/include/rtems/rtems/barrier.h, rtems/include/rtems/rtems/barriermp.h, rtems/include/rtems/rtems/cache.h, rtems/include/rtems/rtems/config.h, rtems/include/rtems/rtems/dpmem.h, rtems/include/rtems/rtems/event.h, rtems/include/rtems/rtems/eventmp.h, rtems/include/rtems/rtems/eventset.h, rtems/include/rtems/rtems/intr.h, rtems/include/rtems/rtems/message.h, rtems/include/rtems/rtems/modes.h, rtems/include/rtems/rtems/mp.h, rtems/include/rtems/rtems/msgmp.h, rtems/include/rtems/rtems/options.h, rtems/include/rtems/rtems/part.h, rtems/include/rtems/rtems/partmp.h, rtems/include/rtems/rtems/ratemon.h, rtems/include/rtems/rtems/region.h, rtems/include/rtems/rtems/regionmp.h, rtems/include/rtems/rtems/rtemsapi.h, rtems/include/rtems/rtems/sem.h, rtems/include/rtems/rtems/semmp.h, rtems/include/rtems/rtems/signal.h, rtems/include/rtems/rtems/signalmp.h, rtems/include/rtems/rtems/status.h, rtems/include/rtems/rtems/support.h, rtems/include/rtems/rtems/taskmp.h, rtems/include/rtems/rtems/tasks.h, rtems/include/rtems/rtems/timer.h, rtems/include/rtems/rtems/types.h, rtems/inline/rtems/rtems/asr.inl, rtems/inline/rtems/rtems/attr.inl, rtems/inline/rtems/rtems/barrier.inl, rtems/inline/rtems/rtems/dpmem.inl, rtems/inline/rtems/rtems/event.inl, rtems/inline/rtems/rtems/message.inl, rtems/inline/rtems/rtems/modes.inl, rtems/inline/rtems/rtems/options.inl, rtems/inline/rtems/rtems/part.inl, rtems/inline/rtems/rtems/ratemon.inl, rtems/inline/rtems/rtems/region.inl, rtems/inline/rtems/rtems/sem.inl, rtems/inline/rtems/rtems/status.inl, rtems/inline/rtems/rtems/support.inl, rtems/inline/rtems/rtems/timer.inl: More Doxygen improvements.
  • Property mode set to 100644
File size: 4.7 KB
Line 
1/**
2 * @file rtems/rtems/part.h
3 *
4 *  This include file contains all the constants and structures associated
5 *  with the Partition Manager.  This manager provides facilities to
6 *  dynamically allocate memory in fixed-sized units which are returned
7 *  as buffers.
8 *
9 *  Directives provided are:
10 *
11 *     - create a partition
12 *     - get an ID of a partition
13 *     - delete a partition
14 *     - get a buffer from a partition
15 *     - return a buffer to a partition
16 */
17
18/*  COPYRIGHT (c) 1989-2008.
19 *  On-Line Applications Research Corporation (OAR).
20 *
21 *  The license and distribution terms for this file may be
22 *  found in the file LICENSE in this distribution or at
23 *  http://www.rtems.com/license/LICENSE.
24 *
25 *  $Id$
26 */
27
28#ifndef _RTEMS_RTEMS_PART_H
29#define _RTEMS_RTEMS_PART_H
30
31/**
32 *  This constant is defined to extern most of the time when using
33 *  this header file.  However by defining it to nothing, the data
34 *  declared in this header file can be instantiated.  This is done
35 *  in a single per manager file.
36 */
37#ifndef RTEMS_PART_EXTERN
38#define RTEMS_PART_EXTERN extern
39#endif
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45#include <rtems/score/address.h>
46#include <rtems/score/object.h>
47#include <rtems/rtems/attr.h>
48#include <rtems/rtems/status.h>
49#include <rtems/rtems/support.h>
50#include <rtems/rtems/types.h>
51
52/**
53 *  @defgroup ClassicPart Classic API Partition
54 *
55 *  This encapsulates functionality which XXX
56 */
57/**@{*/
58
59/**
60 *  The following defines the control block used to manage each partition.
61 */
62typedef struct {
63  Objects_Control     Object;
64  void               *starting_address;      /* physical address */
65  uint32_t            length;                /* in bytes */
66  uint32_t            buffer_size;           /* in bytes */
67  rtems_attribute  attribute_set;         /* attributes */
68  uint32_t            number_of_used_blocks; /* or allocated buffers */
69  Chain_Control       Memory;                /* buffer chain */
70}   Partition_Control;
71
72/**
73 *  The following defines the information control block used to
74 *  manage this class of objects.
75 */
76RTEMS_PART_EXTERN Objects_Information _Partition_Information;
77
78/**
79 *  @brief Partition_Manager_initialization
80 *
81 *  This routine performs the initialization necessary for this manager.
82 */
83void _Partition_Manager_initialization(
84  uint32_t   maximum_partitions
85);
86
87/**
88 *  @brief rtems_partition_create
89 *
90 *  This routine implements the rtems_partition_create directive.  The
91 *  partition will have the name name.  The memory area managed by
92 *  the partition is of length bytes and starts at starting_address.
93 *  The memory area will be divided into as many buffers of
94 *  buffer_size bytes as possible.   The attribute_set determines if
95 *  the partition is global or local.  It returns the id of the
96 *  created partition in ID.
97 */
98rtems_status_code rtems_partition_create(
99  rtems_name          name,
100  void               *starting_address,
101  uint32_t            length,
102  uint32_t            buffer_size,
103  rtems_attribute  attribute_set,
104  Objects_Id         *id
105);
106
107/**
108 *  @brief rtems_partition_ident
109 *
110 *  This routine implements the rtems_partition_ident directive.
111 *  This directive returns the partition ID associated with name.
112 *  If more than one partition is named name, then the partition
113 *  to which the ID belongs is arbitrary.  node indicates the
114 *  extent of the search for the ID of the partition named name.
115 *  The search can be limited to a particular node or allowed to
116 *  encompass all nodes.
117 */
118rtems_status_code rtems_partition_ident(
119  rtems_name    name,
120  uint32_t      node,
121  Objects_Id   *id
122);
123
124/**
125 *  @brief rtems_partition_delete
126 *
127 *  This routine implements the rtems_partition_delete directive.  The
128 *  partition indicated by ID is deleted.
129 */
130rtems_status_code rtems_partition_delete(
131  Objects_Id id
132);
133
134/**
135 *  @brief rtems_partition_get_buffer
136 *
137 *  This routine implements the rtems_partition_get_buffer directive.  It
138 *  attempts to allocate a buffer from the partition associated with ID.
139 *  If a buffer is allocated, its address is returned in buffer.
140 */
141rtems_status_code rtems_partition_get_buffer(
142  Objects_Id  id,
143  void       **buffer
144);
145
146/**
147 *  @brief rtems_partition_return_buffer
148 *
149 *  This routine implements the rtems_partition_return_buffer directive.  It
150 *  frees the buffer to the partition associated with ID.  The buffer must
151 *  have been previously allocated from the same partition.
152 */
153rtems_status_code rtems_partition_return_buffer(
154  Objects_Id  id,
155  void       *buffer
156);
157
158#ifndef __RTEMS_APPLICATION__
159#include <rtems/rtems/part.inl>
160#endif
161#if defined(RTEMS_MULTIPROCESSING)
162#include <rtems/rtems/partmp.h>
163#endif
164
165#ifdef __cplusplus
166}
167#endif
168
169/**@}*/
170
171#endif
172/* end of include file */
Note: See TracBrowser for help on using the repository browser.