source: rtems/cpukit/score/include/rtems/score/wkspace.h @ 5b33dc80

4.104.114.9
Last change on this file since 5b33dc80 was 5b33dc80, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 9, 2008 at 10:35:10 PM

2008-01-09 Joel Sherrill <joel.sherrill@…>

  • score/include/rtems/score/wkspace.h, score/inline/rtems/score/wkspace.inl, score/src/wkspace.c: Do not inline _Workspace_Free or _Workspace_Allocate since they are not always inlined and actually smaller overall as subroutines. They are not particularly time critical so inlining is not absolutely necessary.
  • Property mode set to 100644
File size: 2.7 KB
Line 
1/**
2 *  @file  rtems/score/wkspace.h
3 *
4 *  This include file contains information related to the
5 *  RAM Workspace.  This Handler provides mechanisms which can be used to
6 *  define, initialize and manipulate the workspace.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2006.
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_WKSPACE_H
21#define _RTEMS_SCORE_WKSPACE_H
22
23/**
24 *  @defgroup ScoreWorkspace Workspace Handler
25 *
26 *  This handler encapsulates functionality related to the management of
27 *  the RTEMS Executive Workspace.
28 */
29/**@{*/
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include <rtems/score/heap.h>
36#include <rtems/score/interr.h>
37
38/** @brief Executive Workspace Control
39 *
40 *  The is the heap control structure that used to manage the
41 *  RTEMS Executive Workspace.
42 */
43SCORE_EXTERN Heap_Control _Workspace_Area;  /* executive heap header */
44
45/** @brief Workspace Handler Initialization
46 *
47 *  This routine performs the initialization necessary for this handler.
48 *
49 *  @param[in] starting_address is the base address of the RTEMS Executive
50 *         Workspace
51 *  @param[in] size is the number of bytes in the RTEMS Executive Workspace
52 */
53void _Workspace_Handler_initialization(
54  void       *starting_address,
55  size_t      size
56);
57
58/** @brief Allocate Memory from Workspace
59 *
60 *  This routine returns the address of a block of memory of size
61 *  bytes.  If a block of the appropriate size cannot be allocated
62 *  from the workspace, then NULL is returned.
63 *
64 *  @param size is the requested size
65 *
66 *  @return a pointer to the requested memory or NULL.
67 */
68void *_Workspace_Allocate(
69  size_t   size
70);
71
72/** @brief Free Memory to the Workspace
73 *
74 *  This function frees the specified block of memory.  If the block
75 *  belongs to the Workspace and can be successfully freed, then
76 *  TRUE is returned.  Otherwise FALSE is returned.
77 *
78 *  @param block is the memory to free
79 *
80 *  @return TRUE if the free was successful.
81 */
82
83boolean _Workspace_Free(
84  void *block
85);
86
87/** @brief Workspace Allocate or Fail with Fatal Error
88 *
89 *  This routine returns the address of a block of memory of @a size
90 *  bytes.  If a block of the appropriate size cannot be allocated
91 *  from the workspace, then the internal error handler is invoked.
92 *
93 *  @param[in] size is the desired number of bytes to allocate
94 *  @return If successful, the starting address of the allocated memory
95 */
96void *_Workspace_Allocate_or_fatal_error(
97  size_t  size
98);
99
100#ifndef __RTEMS_APPLICATION__
101#include <rtems/score/wkspace.inl>
102#endif
103
104#ifdef __cplusplus
105}
106#endif
107
108/**@}*/
109
110#endif
111/* end of include file */
Note: See TracBrowser for help on using the repository browser.