1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup ClassicPart |
---|
5 | * |
---|
6 | * @brief Classic Partition Manager API |
---|
7 | */ |
---|
8 | |
---|
9 | /* COPYRIGHT (c) 1989-2008. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef _RTEMS_RTEMS_PART_H |
---|
18 | #define _RTEMS_RTEMS_PART_H |
---|
19 | |
---|
20 | #include <rtems/rtems/attr.h> |
---|
21 | #include <rtems/rtems/status.h> |
---|
22 | #include <rtems/rtems/types.h> |
---|
23 | |
---|
24 | #ifdef __cplusplus |
---|
25 | extern "C" { |
---|
26 | #endif |
---|
27 | |
---|
28 | /** |
---|
29 | * @defgroup ClassicPart Partitions |
---|
30 | * |
---|
31 | * @ingroup ClassicRTEMS |
---|
32 | * |
---|
33 | * This encapsulates functionality related to the |
---|
34 | * Classic API Partition Manager. |
---|
35 | */ |
---|
36 | /**@{*/ |
---|
37 | |
---|
38 | /** |
---|
39 | * @brief RTEMS Partition Create |
---|
40 | * |
---|
41 | * Partition Manager |
---|
42 | * |
---|
43 | * This routine implements the rtems_partition_create directive. The |
---|
44 | * partition will have the name name. The memory area managed by |
---|
45 | * the partition is of length bytes and starts at starting_address. |
---|
46 | * The memory area will be divided into as many buffers of |
---|
47 | * buffer_size bytes as possible. The attribute_set determines if |
---|
48 | * the partition is global or local. It returns the id of the |
---|
49 | * created partition in ID. |
---|
50 | */ |
---|
51 | rtems_status_code rtems_partition_create( |
---|
52 | rtems_name name, |
---|
53 | void *starting_address, |
---|
54 | uintptr_t length, |
---|
55 | size_t buffer_size, |
---|
56 | rtems_attribute attribute_set, |
---|
57 | rtems_id *id |
---|
58 | ); |
---|
59 | |
---|
60 | /** |
---|
61 | * @brief RTEMS Partition Ident |
---|
62 | * |
---|
63 | * This routine implements the rtems_partition_ident directive. |
---|
64 | * This directive returns the partition ID associated with name. |
---|
65 | * If more than one partition is named name, then the partition |
---|
66 | * to which the ID belongs is arbitrary. node indicates the |
---|
67 | * extent of the search for the ID of the partition named name. |
---|
68 | * The search can be limited to a particular node or allowed to |
---|
69 | * encompass all nodes. |
---|
70 | * |
---|
71 | * @param[in] name is the user defined partition name |
---|
72 | * @param[in] node is(are) the node(s) to be searched |
---|
73 | * @param[in] id is the pointer to partition id |
---|
74 | * |
---|
75 | * @retval RTEMS_SUCCESSFUL if successful or error code if unsuccessful and |
---|
76 | * *id filled in with the partition id |
---|
77 | */ |
---|
78 | rtems_status_code rtems_partition_ident( |
---|
79 | rtems_name name, |
---|
80 | uint32_t node, |
---|
81 | rtems_id *id |
---|
82 | ); |
---|
83 | |
---|
84 | /** |
---|
85 | * @brief RTEMS Delete Partition |
---|
86 | * |
---|
87 | * This routine implements the rtems_partition_delete directive. The |
---|
88 | * partition indicated by ID is deleted, provided that none of its buffers |
---|
89 | * are still allocated. |
---|
90 | * |
---|
91 | * @param[in] id is the partition id |
---|
92 | * |
---|
93 | * @retval This method returns RTEMS_SUCCESSFUL if there was not an |
---|
94 | * error. Otherwise, a status code is returned indicating the |
---|
95 | * source of the error. |
---|
96 | */ |
---|
97 | rtems_status_code rtems_partition_delete( |
---|
98 | rtems_id id |
---|
99 | ); |
---|
100 | |
---|
101 | /** |
---|
102 | * @brief RTEMS Get Partition Buffer |
---|
103 | * |
---|
104 | * This routine implements the rtems_partition_get_buffer directive. It |
---|
105 | * attempts to allocate a buffer from the partition associated with ID. |
---|
106 | * If a buffer is allocated, its address is returned in buffer. |
---|
107 | * |
---|
108 | * @param[in] id is the partition id |
---|
109 | * @param[out] buffer is the pointer to buffer address |
---|
110 | * |
---|
111 | * @retval RTEMS_SUCCESSFUL if successful or error code if unsuccessful |
---|
112 | */ |
---|
113 | rtems_status_code rtems_partition_get_buffer( |
---|
114 | rtems_id id, |
---|
115 | void **buffer |
---|
116 | ); |
---|
117 | |
---|
118 | /** |
---|
119 | * @brief rtems_partition_return_buffer |
---|
120 | * |
---|
121 | * This routine implements the rtems_partition_return_buffer directive. It |
---|
122 | * frees the buffer to the partition associated with ID. The buffer must |
---|
123 | * have been previously allocated from the same partition. |
---|
124 | */ |
---|
125 | rtems_status_code rtems_partition_return_buffer( |
---|
126 | rtems_id id, |
---|
127 | void *buffer |
---|
128 | ); |
---|
129 | |
---|
130 | /**@}*/ |
---|
131 | |
---|
132 | #ifdef __cplusplus |
---|
133 | } |
---|
134 | #endif |
---|
135 | |
---|
136 | #endif |
---|
137 | /* end of include file */ |
---|