RTEMS CPU Kit with SuperCore  4.11.3
support.h
Go to the documentation of this file.
1 
10 /* COPYRIGHT (c) 1989-2008.
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.org/license/LICENSE.
16  */
17 
18 #ifndef _RTEMS_RTEMS_SUPPORT_H
19 #define _RTEMS_RTEMS_SUPPORT_H
20 
21 #include <rtems/rtems/types.h>
22 #include <rtems/config.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
36 #define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) ((uint32_t)(_ms) * 1000UL)
37 
41 #define RTEMS_MILLISECONDS_TO_TICKS(_ms) \
42  (RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) / \
43  rtems_configuration_get_microseconds_per_tick())
44 
48 #define RTEMS_MICROSECONDS_TO_TICKS(_us) \
49  ((_us) / rtems_configuration_get_microseconds_per_tick())
50 
55  rtems_name name
56 )
57 {
58  return ( name != 0 );
59 }
60 
66  rtems_name name,
67  char *c1,
68  char *c2,
69  char *c3,
70  char *c4
71 )
72 {
73  *c1 = (char) ((name >> 24) & 0xff);
74  *c2 = (char) ((name >> 16) & 0xff);
75  *c3 = (char) ((name >> 8) & 0xff);
76  *c4 = (char) ( name & 0xff);
77 }
78 
99  Heap_Information_block *the_info
100 );
101 
111  size_t bytes,
112  void **pointer
113 );
114 
124  void *pointer
125 );
126 
137  const uintptr_t *block_sizes,
138  size_t block_count
139 );
140 
151  uintptr_t *allocatable_size
152 );
153 
161 void rtems_workspace_greedy_free( void *opaque );
162 
165 #ifdef __cplusplus
166 }
167 #endif
168 
169 #endif
170 /* end of include file */
RTEMS_INLINE_ROUTINE bool rtems_is_name_valid(rtems_name name)
Returns true if the name is valid, and false otherwise.
Definition: support.h:54
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:65
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
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
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: heap.h:379
void rtems_workspace_greedy_free(void *opaque)
Frees space of a greedy allocation.
Definition: workspacegreedy.c:62
uint32_t rtems_name
Classic API object name type.
Definition: types.h:74
bool rtems_workspace_allocate(size_t bytes, void **pointer)
Allocates Memory from the Workspace.
Definition: workspace.c:40
bool rtems_workspace_get_information(Heap_Information_block *the_info)
Gets Workspace Information.
Definition: workspace.c:30
bool rtems_workspace_free(void *pointer)
Frees Memory Allocated from the Workspace.
Definition: workspace.c:67