1 | /** |
---|
2 | * @file rtems/rtems/support.h |
---|
3 | * |
---|
4 | * This include file contains information about support functions for |
---|
5 | * the RTEMS API. |
---|
6 | */ |
---|
7 | |
---|
8 | /* COPYRIGHT (c) 1989-2008. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.com/license/LICENSE. |
---|
14 | * |
---|
15 | * $Id$ |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef _RTEMS_RTEMS_SUPPORT_H |
---|
19 | #define _RTEMS_RTEMS_SUPPORT_H |
---|
20 | |
---|
21 | #ifdef __cplusplus |
---|
22 | extern "C" { |
---|
23 | #endif |
---|
24 | |
---|
25 | #include <rtems/rtems/types.h> |
---|
26 | |
---|
27 | /** |
---|
28 | * @addtogroup ClassicRTEMS |
---|
29 | * @{ |
---|
30 | */ |
---|
31 | |
---|
32 | /** |
---|
33 | * @brief milliseconds to microseconds |
---|
34 | * |
---|
35 | * This is the public milliseconds to microseconds conversion. |
---|
36 | */ |
---|
37 | #define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) \ |
---|
38 | TOD_MILLISECONDS_TO_MICROSECONDS(_ms) |
---|
39 | |
---|
40 | /** |
---|
41 | * @brief milliseconds to ticks |
---|
42 | * |
---|
43 | * This is the public milliseconds to ticks conversion. |
---|
44 | */ |
---|
45 | #define RTEMS_MILLISECONDS_TO_TICKS(_ms) \ |
---|
46 | (TOD_MILLISECONDS_TO_MICROSECONDS(_ms) / \ |
---|
47 | rtems_configuration_get_microseconds_per_tick()) |
---|
48 | |
---|
49 | /** |
---|
50 | * @brief microseconds to ticks |
---|
51 | * |
---|
52 | * This is the public microseconds to tick conversion. |
---|
53 | */ |
---|
54 | #define RTEMS_MICROSECONDS_TO_TICKS(_ms) \ |
---|
55 | ((_ms) / rtems_configuration_get_microseconds_per_tick()) |
---|
56 | |
---|
57 | /** |
---|
58 | * @brief get workspace information |
---|
59 | * |
---|
60 | * This returns information about the heap that is used as |
---|
61 | * the RTEMS Executive Workspace. |
---|
62 | * |
---|
63 | * @param[in] the_info |
---|
64 | * |
---|
65 | * @return true if successful |
---|
66 | */ |
---|
67 | bool rtems_workspace_get_information( |
---|
68 | Heap_Information_block *the_info |
---|
69 | ); |
---|
70 | |
---|
71 | /** |
---|
72 | * @brief allocate memory from workspace |
---|
73 | * |
---|
74 | * This allocates memory from the the RTEMS Executive Workspace. |
---|
75 | * |
---|
76 | * @param[in] bytes is the number of bytes to allocate |
---|
77 | * @param[in] pointer is the returned pointer to allocated memory |
---|
78 | * |
---|
79 | * @return true if successful |
---|
80 | */ |
---|
81 | bool rtems_workspace_allocate( |
---|
82 | size_t bytes, |
---|
83 | void **pointer |
---|
84 | ); |
---|
85 | |
---|
86 | /** |
---|
87 | * @brief free memory back to the workspace |
---|
88 | * |
---|
89 | * This frees memory that was allocated from |
---|
90 | * the RTEMS Executive Workspace. |
---|
91 | * |
---|
92 | * @param[in] pointer is the allocated workspace |
---|
93 | * |
---|
94 | * @return true if successful |
---|
95 | */ |
---|
96 | bool rtems_workspace_free( |
---|
97 | void *pointer |
---|
98 | ); |
---|
99 | |
---|
100 | #ifndef __RTEMS_APPLICATION__ |
---|
101 | #include <rtems/rtems/support.inl> |
---|
102 | #endif |
---|
103 | |
---|
104 | #ifdef __cplusplus |
---|
105 | } |
---|
106 | #endif |
---|
107 | |
---|
108 | /**@}*/ |
---|
109 | |
---|
110 | #endif |
---|
111 | /* end of include file */ |
---|