RTEMS 7.0-rc1
Loading...
Searching...
No Matches
support.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2020, 2021 embedded brains GmbH & Co. KG
13 * Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37/*
38 * This file is part of the RTEMS quality process and was automatically
39 * generated. If you find something that needs to be fixed or
40 * worded better please post a report or patch to an RTEMS mailing list
41 * or raise a bug report:
42 *
43 * https://www.rtems.org/bugs.html
44 *
45 * For information on updating and regenerating please refer to the How-To
46 * section in the Software Requirements Engineering chapter of the
47 * RTEMS Software Engineering manual. The manual is provided as a part of
48 * a release. For development sources please refer to the online
49 * documentation at:
50 *
51 * https://docs.rtems.org
52 */
53
54/* Generated from spec:/rtems/support/if/header */
55
56#ifndef _RTEMS_RTEMS_SUPPORT_H
57#define _RTEMS_RTEMS_SUPPORT_H
58
59#include <stdbool.h>
60#include <stddef.h>
61#include <stdint.h>
62#include <rtems/config.h>
63#include <rtems/rtems/types.h>
65
66#ifdef __cplusplus
67extern "C" {
68#endif
69
70/* Generated from spec:/rtems/support/if/group */
71
80/* Generated from spec:/rtems/support/if/is-name-valid */
81
100static inline bool rtems_is_name_valid( rtems_name name )
101{
102 return name != 0;
103}
104
105/* Generated from spec:/rtems/support/if/microseconds-to-ticks */
106
130#define RTEMS_MICROSECONDS_TO_TICKS( _us ) \
131 ( ( _us ) / rtems_configuration_get_microseconds_per_tick() )
132
133/* Generated from spec:/rtems/support/if/milliseconds-to-microseconds */
134
155#define RTEMS_MILLISECONDS_TO_MICROSECONDS( _ms ) ( ( _ms ) * 1000UL )
156
157/* Generated from spec:/rtems/support/if/milliseconds-to-ticks */
158
181#define RTEMS_MILLISECONDS_TO_TICKS( _ms ) \
182 RTEMS_MICROSECONDS_TO_TICKS( RTEMS_MILLISECONDS_TO_MICROSECONDS( _ms ) )
183
184/* Generated from spec:/rtems/support/if/name-to-characters */
185
210static inline void rtems_name_to_characters(
211 rtems_name name,
212 char *c1,
213 char *c2,
214 char *c3,
215 char *c4
216)
217{
218 *c1 = (char) ( ( ( name ) >> 24 ) & 0xff );
219 *c2 = (char) ( ( ( name ) >> 16 ) & 0xff );
220 *c3 = (char) ( ( ( name ) >> 8 ) & 0xff );
221 *c4 = (char) ( ( name ) & 0xff );
222}
223
224/* Generated from spec:/rtems/support/if/workspace-allocate */
225
255bool rtems_workspace_allocate( size_t bytes, void **pointer );
256
257/* Generated from spec:/rtems/support/if/workspace-free */
258
282bool rtems_workspace_free( void *pointer );
283
284/* Generated from spec:/rtems/support/if/workspace-get-information */
285
312
313/* Generated from spec:/rtems/support/if/workspace-greedy-allocate */
314
332 const uintptr_t *block_sizes,
333 size_t block_count
334);
335
336/* Generated from spec:/rtems/support/if/workspace-greedy-allocate-all-except-largest */
337
370 uintptr_t *allocatable_size
371);
372
373/* Generated from spec:/rtems/support/if/workspace-greedy-free */
374
401
402#ifdef __cplusplus
403}
404#endif
405
406#endif /* _RTEMS_RTEMS_SUPPORT_H */
bool rtems_workspace_allocate(size_t bytes, void **pointer)
Allocates a memory area from the RTEMS Workspace.
Definition: workspace.c:61
bool rtems_workspace_free(void *pointer)
Frees the memory area allocated from the RTEMS Workspace.
Definition: workspace.c:88
bool rtems_workspace_get_information(Heap_Information_block *the_info)
Gets information about the RTEMS Workspace.
Definition: workspace.c:51
void rtems_workspace_greedy_free(void *opaque)
Frees space of a greedy allocation to the RTEMS Workspace.
Definition: workspacegreedy.c:88
void * rtems_workspace_greedy_allocate(const uintptr_t *block_sizes, size_t block_count)
Greedy allocates that empties the RTEMS Workspace.
Definition: workspacegreedy.c:52
void * rtems_workspace_greedy_allocate_all_except_largest(uintptr_t *allocatable_size)
Greedy allocates all blocks of the RTEMS Workspace except the largest free block.
Definition: workspacegreedy.c:69
uint32_t rtems_name
This type represents Classic API object names.
Definition: types.h:226
This header file provides interfaces of the Barrier Handler which are used by the implementation and ...
This header file provides types used by the Classic API.
Information block returned by _Heap_Get_information().
Definition: heapinfo.h:165
Definition: bootldr.h:44