1 | /* wkspace.h |
---|
2 | * |
---|
3 | * This include file contains information related to the RTEMS |
---|
4 | * RAM Workspace. This Handler provides mechanisms which can be used to |
---|
5 | * define, initialize and manipulate the RTEMS workspace. |
---|
6 | * |
---|
7 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
8 | * On-Line Applications Research Corporation (OAR). |
---|
9 | * All rights assigned to U.S. Government, 1994. |
---|
10 | * |
---|
11 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
12 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
13 | * notice must appear in all copies of this file and its derivatives. |
---|
14 | * |
---|
15 | * wkspace.h,v 1.2 1995/05/31 16:47:46 joel Exp |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef __RTEMS_WORKSPACE_h |
---|
19 | #define __RTEMS_WORKSPACE_h |
---|
20 | |
---|
21 | #ifdef __cplusplus |
---|
22 | extern "C" { |
---|
23 | #endif |
---|
24 | |
---|
25 | #include <rtems/heap.h> |
---|
26 | #include <rtems/fatal.h> |
---|
27 | #include <rtems/status.h> |
---|
28 | |
---|
29 | /* |
---|
30 | * The following is used to manage the RTEMS Workspace. |
---|
31 | * |
---|
32 | */ |
---|
33 | |
---|
34 | EXTERN Heap_Control _Workspace_Area; /* executive heap header */ |
---|
35 | |
---|
36 | /* |
---|
37 | * _Workspace_Handler_initialization |
---|
38 | * |
---|
39 | * DESCRIPTION: |
---|
40 | * |
---|
41 | * This routine performs the initialization necessary for this handler. |
---|
42 | */ |
---|
43 | |
---|
44 | STATIC INLINE void _Workspace_Handler_initialization( |
---|
45 | void *starting_address, |
---|
46 | unsigned32 size |
---|
47 | ); |
---|
48 | |
---|
49 | /* |
---|
50 | * _Workspace_Allocate |
---|
51 | * |
---|
52 | * DESCRIPTION: |
---|
53 | * |
---|
54 | * This routine returns the address of a block of memory of size |
---|
55 | * bytes. If a block of the appropriate size cannot be allocated |
---|
56 | * from the workspace, then NULL is returned. |
---|
57 | */ |
---|
58 | |
---|
59 | STATIC INLINE void *_Workspace_Allocate( |
---|
60 | unsigned32 size |
---|
61 | ); |
---|
62 | |
---|
63 | /* |
---|
64 | * _Workspace_Allocate_or_fatal_error |
---|
65 | * |
---|
66 | * DESCRIPTION: |
---|
67 | * |
---|
68 | * This routine returns the address of a block of memory of size |
---|
69 | * bytes. If a block of the appropriate size cannot be allocated |
---|
70 | * from the workspace, then the rtems_fatal_error_occurred directive |
---|
71 | * is invoked. |
---|
72 | */ |
---|
73 | |
---|
74 | void *_Workspace_Allocate_or_fatal_error( |
---|
75 | unsigned32 size |
---|
76 | ); |
---|
77 | |
---|
78 | /* |
---|
79 | * _Workspace_Free |
---|
80 | * |
---|
81 | * DESCRIPTION: |
---|
82 | * |
---|
83 | * This function frees the specified block of memory. If the block |
---|
84 | * belongs to the Workspace and can be successfully freed, then |
---|
85 | * TRUE is returned. Otherwise FALSE is returned. |
---|
86 | */ |
---|
87 | |
---|
88 | STATIC INLINE boolean _Workspace_Free( |
---|
89 | void *block |
---|
90 | ); |
---|
91 | |
---|
92 | #include <rtems/wkspace.inl> |
---|
93 | |
---|
94 | #ifdef __cplusplus |
---|
95 | } |
---|
96 | #endif |
---|
97 | |
---|
98 | #endif |
---|
99 | /* end of include file */ |
---|