RTEMS  5.0.0
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
22 extern "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 
52  rtems_name name
53 )
54 {
55  return ( name != 0 );
56 }
57 
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 
96  Heap_Information_block *the_info
97 );
98 
108  size_t bytes,
109  void **pointer
110 );
111 
121  void *pointer
122 );
123 
134  const uintptr_t *block_sizes,
135  size_t block_count
136 );
137 
148  uintptr_t *allocatable_size
149 );
150 
158 void rtems_workspace_greedy_free( void *opaque );
159 
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 #endif
167 /* end of include file */
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_INLINE_ROUTINE bool rtems_is_name_valid(rtems_name name)
Returns true if the name is valid, and false otherwise.
Definition: support.h:51
uint32_t rtems_name
Classic API object name type.
Definition: types.h:77
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
void * rtems_workspace_greedy_allocate(const uintptr_t *block_sizes, size_t block_count)
Greedy allocate that empties the workspace.
Definition: workspacegreedy.c:32
Information block returned by _Heap_Get_information().
Definition: heapinfo.h:145
void rtems_workspace_greedy_free(void *opaque)
Frees space of a greedy allocation.
Definition: workspacegreedy.c:62
Definition: bootldr.h:42
bool rtems_workspace_allocate(size_t bytes, void **pointer)
Allocates Memory from the Workspace.
Definition: workspace.c:39
bool rtems_workspace_get_information(Heap_Information_block *the_info)
Gets Workspace Information.
Definition: workspace.c:29
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
bool rtems_workspace_free(void *pointer)
Frees Memory Allocated from the Workspace.
Definition: workspace.c:66