source: rtems/cpukit/include/rtems/score/wkspace.h

Last change on this file was 7b85efb8, checked in by Joel Sherrill <joel@…>, on 02/16/22 at 21:16:11

cpukit/include/rtems/score/[s-z]*.h: Change license to BSD-2

Updates #3053.

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @ingroup RTEMSScoreWorkspace
7 *
8 * @brief This header file provides interfaces of the
9 *   @ref RTEMSScoreWorkspace which are only used by the implementation.
10 */
11
12/*
13 *  COPYRIGHT (c) 1989-2009.
14 *  On-Line Applications Research Corporation (OAR).
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 *    notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 *    notice, this list of conditions and the following disclaimer in the
23 *    documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef _RTEMS_SCORE_WKSPACE_H
39#define _RTEMS_SCORE_WKSPACE_H
40
41#include <rtems/score/heap.h>
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/**
48 * @addtogroup RTEMSScoreWorkspace
49 *
50 * @{
51 */
52
53/**
54 *  @brief Executive workspace control.
55 *
56 *  This is the heap control structure used to manage the RTEMS Executive
57 *  Workspace.
58 */
59extern Heap_Control _Workspace_Area;
60
61/**
62 * @brief Initializes the workspace handler.
63 *
64 * This routine performs the initialization necessary for this handler.
65 */
66void _Workspace_Handler_initialization( void );
67
68/**
69 * @brief Allocates a memory block of the specified size from the workspace.
70 *
71 * @param size The size of the memory block.
72 *
73 * @retval pointer The pointer to the memory block.  The pointer is at least
74 *   aligned by CPU_HEAP_ALIGNMENT.
75 * @retval NULL No memory block with the requested size is available in the
76 *   workspace.
77 */
78void *_Workspace_Allocate( size_t size );
79
80/**
81 * @brief Frees memory to the workspace.
82 *
83 * This function frees the specified block of memory.
84 *
85 * @param block The memory to free.
86 *
87 * @note If @a block is equal to NULL, then the request is ignored.
88 *        This allows the caller to not worry about whether or not
89 *        a pointer is NULL.
90 */
91void _Workspace_Free(
92  void *block
93);
94
95/**
96 * @brief Duplicates string with memory from the workspace.
97 *
98 * @param string The pointer to a zero terminated string.
99 * @param len The length of the string (equal to strlen(string)).
100 *
101 * @retval other Duplicated string.
102 * @retval NULL Not enough memory.
103 */
104char *_Workspace_String_duplicate(
105  const char *string,
106  size_t len
107);
108
109/** @} */
110
111#ifdef __cplusplus
112}
113#endif
114
115#endif
116/* end of include file */
Note: See TracBrowser for help on using the repository browser.