OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [include/] [rtems/] [rtems/] [part.h] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  partition.h
2
 *
3
 *  This include file contains all the constants and structures associated
4
 *  with the Partition Manager.  This manager provides facilities to
5
 *  dynamically allocate memory in fixed-sized units which are returned
6
 *  as buffers.
7
 *
8
 *  Directives provided are:
9
 *
10
 *     + create a partition
11
 *     + get an ID of a partition
12
 *     + delete a partition
13
 *     + get a buffer from a partition
14
 *     + return a buffer to a partition
15
 *
16
 *  COPYRIGHT (c) 1989-1999.
17
 *  On-Line Applications Research Corporation (OAR).
18
 *
19
 *  The license and distribution terms for this file may be
20
 *  found in the file LICENSE in this distribution or at
21
 *  http://www.OARcorp.com/rtems/license.html.
22
 *
23
 *  $Id: part.h,v 1.2 2001-09-27 11:59:18 chris Exp $
24
 */
25
 
26
#ifndef __RTEMS_PARTITION_h
27
#define __RTEMS_PARTITION_h
28
 
29
#ifdef __cplusplus
30
extern "C" {
31
#endif
32
 
33
#include <rtems/score/address.h>
34
#include <rtems/score/object.h>
35
#include <rtems/rtems/attr.h>
36
#include <rtems/rtems/types.h>
37
 
38
/*
39
 *  The following defines the control block used to manage each partition.
40
 */
41
 
42
typedef struct {
43
  Objects_Control     Object;
44
  void               *starting_address;      /* physical address */
45
  unsigned32          length;                /* in bytes */
46
  unsigned32          buffer_size;           /* in bytes */
47
  rtems_attribute  attribute_set;         /* attributes */
48
  unsigned32          number_of_used_blocks; /* or allocated buffers */
49
  Chain_Control       Memory;                /* buffer chain */
50
}   Partition_Control;
51
 
52
/*
53
 *  The following defines the information control block used to
54
 *  manage this class of objects.
55
 */
56
 
57
RTEMS_EXTERN Objects_Information _Partition_Information;
58
 
59
/*
60
 *  _Partition_Manager_initialization
61
 *
62
 *  DESCRIPTION:
63
 *
64
 *  This routine performs the initialization necessary for this manager.
65
 */
66
 
67
void _Partition_Manager_initialization(
68
  unsigned32 maximum_partitions
69
);
70
 
71
/*
72
 *  rtems_partition_create
73
 *
74
 *  DESCRIPTION:
75
 *
76
 *  This routine implements the rtems_partition_create directive.  The
77
 *  partition will have the name name.  The memory area managed by
78
 *  the partition is of length bytes and starts at starting_address.
79
 *  The memory area will be divided into as many buffers of
80
 *  buffer_size bytes as possible.   The attribute_set determines if
81
 *  the partition is global or local.  It returns the id of the
82
 *  created partition in ID.
83
 */
84
 
85
rtems_status_code rtems_partition_create(
86
  rtems_name          name,
87
  void               *starting_address,
88
  unsigned32          length,
89
  unsigned32          buffer_size,
90
  rtems_attribute  attribute_set,
91
  Objects_Id         *id
92
);
93
 
94
/*
95
 *  rtems_partition_ident
96
 *
97
 *  DESCRIPTION:
98
 *
99
 *  This routine implements the rtems_partition_ident directive.
100
 *  This directive returns the partition ID associated with name.
101
 *  If more than one partition is named name, then the partition
102
 *  to which the ID belongs is arbitrary.  node indicates the
103
 *  extent of the search for the ID of the partition named name.
104
 *  The search can be limited to a particular node or allowed to
105
 *  encompass all nodes.
106
 */
107
 
108
rtems_status_code rtems_partition_ident(
109
  rtems_name    name,
110
  unsigned32    node,
111
  Objects_Id   *id
112
);
113
 
114
/*
115
 *  rtems_partition_delete
116
 *
117
 *  DESCRIPTION:
118
 *
119
 *  This routine implements the rtems_partition_delete directive.  The
120
 *  partition indicated by ID is deleted.
121
 */
122
 
123
rtems_status_code rtems_partition_delete(
124
  Objects_Id id
125
);
126
 
127
/*
128
 *  rtems_partition_get_buffer
129
 *
130
 *  DESCRIPTION:
131
 *
132
 *  This routine implements the rtems_partition_get_buffer directive.  It
133
 *  attempts to allocate a buffer from the partition associated with ID.
134
 *  If a buffer is allocated, its address is returned in buffer.
135
 */
136
 
137
rtems_status_code rtems_partition_get_buffer(
138
  Objects_Id  id,
139
  void       **buffer
140
);
141
 
142
/*
143
 *  rtems_partition_return_buffer
144
 *
145
 *  DESCRIPTION:
146
 *
147
 *  This routine implements the rtems_partition_return_buffer directive.  It
148
 *  frees the buffer to the partition associated with ID.  The buffer must
149
 *  have been previously allocated from the same partition.
150
 */
151
 
152
rtems_status_code rtems_partition_return_buffer(
153
  Objects_Id  id,
154
  void       *buffer
155
);
156
 
157
#ifndef __RTEMS_APPLICATION__
158
#include <rtems/rtems/part.inl>
159
#endif
160
#if defined(RTEMS_MULTIPROCESSING)
161
#include <rtems/rtems/partmp.h>
162
#endif
163
 
164
#ifdef __cplusplus
165
}
166
#endif
167
 
168
#endif
169
/* end of include file */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.