RTEMS  5.0.0
libcsupport.h
Go to the documentation of this file.
1 
10 /*
11  * COPYRIGHT (c) 1989-2011.
12  * On-Line Applications Research Corporation (OAR).
13  *
14  * The license and distribution terms for this file may be
15  * found in the file LICENSE in this distribution or at
16  * http://www.rtems.org/license/LICENSE.
17  */
18 
19 #ifndef _RTEMS_RTEMS_LIBCSUPPORT_H
20 #define _RTEMS_RTEMS_LIBCSUPPORT_H
21 
22 #include <sys/types.h>
23 #include <stdint.h>
24 
25 #include <rtems/score/heap.h>
26 #include <rtems/rtems/tasks.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
40 extern void malloc_dump(void);
41 
45 extern bool malloc_walk(int source, bool printf_enabled);
46 
53 
60 
66 extern size_t malloc_free_space(void);
67 
73 extern int malloc_info(Heap_Information_block *the_info);
74 
75 /*
76  * Prototypes required to install newlib reentrancy user extension
77  */
78 bool newlib_create_hook(
79  rtems_tcb *current_task,
80  rtems_tcb *creating_task
81 );
82 
83 void newlib_terminate_hook(
84  rtems_tcb *current_task
85 );
86 
87 #define RTEMS_NEWLIB_EXTENSION \
88 { \
89  newlib_create_hook, /* rtems_task_create */ \
90  0, /* rtems_task_start */ \
91  0, /* rtems_task_restart */ \
92  0, /* rtems_task_delete */ \
93  0, /* task_switch */ \
94  0, /* task_begin */ \
95  0, /* task_exitted */ \
96  0, /* fatal */ \
97  newlib_terminate_hook /* thread terminate */ \
98 }
99 
100 typedef struct {
101  uint32_t active_barriers;
102  uint32_t active_extensions;
103  uint32_t active_message_queues;
104  uint32_t active_partitions;
105  uint32_t active_periods;
106  uint32_t active_ports;
107  uint32_t active_regions;
108  uint32_t active_semaphores;
109  uint32_t active_tasks;
110  uint32_t active_timers;
112 
113 typedef struct {
114  uint32_t active_message_queues;
115  uint32_t active_semaphores;
116  uint32_t active_threads;
117  uint32_t active_timers;
119 
120 typedef struct {
121  Heap_Information_block workspace_info;
122  Heap_Information_block heap_info;
123  uint32_t active_posix_key_value_pairs;
124  uint32_t active_posix_keys;
125  rtems_resource_rtems_api rtems_api;
126  rtems_resource_posix_api posix_api;
127  int open_files;
129 
155 
168  const rtems_resource_snapshot *a,
169  const rtems_resource_snapshot *b
170 );
171 
185 
188 #ifdef __cplusplus
189 }
190 #endif
191 
192 #endif
193 /* end of include file */
Definition: libcsupport.h:113
Definition: libcsupport.h:100
Information block returned by _Heap_Get_information().
Definition: heapinfo.h:145
void malloc_set_heap_pointer(Heap_Control *new_heap)
Set malloc heap pointer.
Definition: mallocsetheapptr.c:25
bool malloc_walk(int source, bool printf_enabled)
Malloc walk.
size_t malloc_free_space(void)
Get free malloc information.
Definition: mallocfreespace.c:37
Heap Handler API.
Definition: thread.h:728
Heap_Control * malloc_get_heap_pointer(void)
Get malloc heap pointer.
Definition: mallocgetheapptr.c:25
void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot)
Tasks a snapshot of the resource usage of the system.
Definition: resource_snapshot.c:100
Classic Task Manager API.
Control block used to manage a heap.
Definition: heap.h:255
int malloc_info(Heap_Information_block *the_info)
Get malloc status information.
Definition: mallocinfo.c:24
Definition: libcsupport.h:120
bool rtems_resource_snapshot_equal(const rtems_resource_snapshot *a, const rtems_resource_snapshot *b)
Compares two resource snapshots for equality.
Definition: resource_snapshot.c:135
bool rtems_resource_snapshot_check(const rtems_resource_snapshot *snapshot)
Takes a new resource snapshot and checks that it is equal to the given resource snapshot.
Definition: resource_snapshot.c:143