RTEMS: cpukit/include/rtems/rtems/support.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
support.h
Go to the documentation of this file.
1
7/* COPYRIGHT (c) 1989-2008.
8 * On-Line Applications Research Corporation (OAR).
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifndef _RTEMS_RTEMS_SUPPORT_H
16#define _RTEMS_RTEMS_SUPPORT_H
17
18#include <rtems/rtems/types.h>
19#include <rtems/config.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
33#define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) ((_ms) * 1000UL)
34
38#define RTEMS_MILLISECONDS_TO_TICKS(_ms) \
39 (RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) / \
40 rtems_configuration_get_microseconds_per_tick())
41
45#define RTEMS_MICROSECONDS_TO_TICKS(_us) \
46 ((_us) / rtems_configuration_get_microseconds_per_tick())
47
51 RTEMS_INLINE_ROUTINE bool rtems_is_name_valid (
52 rtems_name name
53)
54{
55 return ( name != 0 );
56}
57
62 RTEMS_INLINE_ROUTINE void rtems_name_to_characters(
63 rtems_name name,
64 char *c1,
65 char *c2,
66 char *c3,
67 char *c4
68)
69{
70 *c1 = (char) ((name >> 24) & 0xff);
71 *c2 = (char) ((name >> 16) & 0xff);
72 *c3 = (char) ((name >> 8) & 0xff);
73 *c4 = (char) ( name & 0xff);
74}
75
95bool rtems_workspace_get_information(
96 Heap_Information_block *the_info
97);
98
107bool rtems_workspace_allocate(
108 size_t bytes,
109 void **pointer
110);
111
120bool rtems_workspace_free(
121 void *pointer
122);
123
133void *rtems_workspace_greedy_allocate(
134 const uintptr_t *block_sizes,
135 size_t block_count
136);
137
147void *rtems_workspace_greedy_allocate_all_except_largest(
148 uintptr_t *allocatable_size
149);
150
158void rtems_workspace_greedy_free( void *opaque );
159
162#ifdef __cplusplus
163}
164#endif
165
166#endif
167/* end of include file */
types.h
rtems_workspace_allocate
bool rtems_workspace_allocate(size_t bytes, void **pointer)
Allocates Memory from the Workspace.
Definition: workspace.c:39
rtems_workspace_free
bool rtems_workspace_free(void *pointer)
Frees Memory Allocated from the Workspace.
Definition: workspace.c:66
rtems_workspace_get_information
bool rtems_workspace_get_information(Heap_Information_block *the_info)
Gets Workspace Information.
Definition: workspace.c:29
rtems_workspace_greedy_free
void rtems_workspace_greedy_free(void *opaque)
Frees space of a greedy allocation.
Definition: workspacegreedy.c:62
rtems_workspace_greedy_allocate
void * rtems_workspace_greedy_allocate(const uintptr_t *block_sizes, size_t block_count)
Greedy allocate that empties the workspace.
Definition: workspacegreedy.c:32
rtems_workspace_greedy_allocate_all_except_largest
void * rtems_workspace_greedy_allocate_all_except_largest(uintptr_t *allocatable_size)
Greedy allocate all blocks except the largest free block.
Definition: workspacegreedy.c:46
rtems_is_name_valid
RTEMS_INLINE_ROUTINE bool rtems_is_name_valid(rtems_name name)
Returns true if the name is valid, and false otherwise.
Definition: support.h:51
rtems_name_to_characters
RTEMS_INLINE_ROUTINE void rtems_name_to_characters(rtems_name name, char *c1, char *c2, char *c3, char *c4)
Breaks the object name into the four component characters c1, c2, c3, and c4.
Definition: support.h:62
rtems_name
uint32_t rtems_name
Classic API object name type.
Definition: types.h:77
RTEMS_INLINE_ROUTINE
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
Heap_Information_block
Information block returned by _Heap_Get_information().
Definition: heapinfo.h:145
opaque
Definition: bootldr.h:42