RTEMS CPU Kit with SuperCore  4.11.3
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 extern void libc_init(void);
61 extern int host_errno(void);
62 extern void fix_syscall_errno(void);
63 
69 extern size_t malloc_free_space(void);
70 
76 extern int malloc_info(Heap_Information_block *the_info);
77 
78 /*
79  * Prototypes required to install newlib reentrancy user extension
80  */
81 bool newlib_create_hook(
82  rtems_tcb *current_task,
83  rtems_tcb *creating_task
84 );
85 
86 #define __RTEMS_NEWLIB_BEGIN 0
87 
88 void newlib_terminate_hook(
89  rtems_tcb *current_task
90 );
91 
92 #define RTEMS_NEWLIB_EXTENSION \
93 { \
94  newlib_create_hook, /* rtems_task_create */ \
95  0, /* rtems_task_start */ \
96  0, /* rtems_task_restart */ \
97  0, /* rtems_task_delete */ \
98  0, /* task_switch */ \
99  __RTEMS_NEWLIB_BEGIN, /* task_begin */ \
100  0, /* task_exitted */ \
101  0, /* fatal */ \
102  newlib_terminate_hook /* thread terminate */ \
103 }
104 
105 typedef struct {
106  uint32_t active_barriers;
107  uint32_t active_extensions;
108  uint32_t active_message_queues;
109  uint32_t active_partitions;
110  uint32_t active_periods;
111  uint32_t active_ports;
112  uint32_t active_regions;
113  uint32_t active_semaphores;
114  uint32_t active_tasks;
115  uint32_t active_timers;
117 
118 typedef struct {
119  uint32_t active_barriers;
120  uint32_t active_condition_variables;
121  uint32_t active_message_queues;
122  uint32_t active_message_queue_descriptors;
123  uint32_t active_mutexes;
124  uint32_t active_rwlocks;
125  uint32_t active_semaphores;
126  uint32_t active_spinlocks;
127  uint32_t active_threads;
128  uint32_t active_timers;
130 
131 typedef struct {
132  Heap_Information_block workspace_info;
133  Heap_Information_block heap_info;
134  uint32_t active_posix_key_value_pairs;
135  uint32_t active_posix_keys;
136  rtems_resource_rtems_api rtems_api;
137  rtems_resource_posix_api posix_api;
138  int open_files;
140 
166 
179  const rtems_resource_snapshot *a,
180  const rtems_resource_snapshot *b
181 );
182 
196 
199 #ifdef __cplusplus
200 }
201 #endif
202 
203 #endif
204 /* end of include file */
Definition: libcsupport.h:118
Definition: libcsupport.h:105
Information block returned by _Heap_Get_information().
Definition: heap.h:379
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.
Heap_Control * malloc_get_heap_pointer(void)
Get malloc heap pointer.
Definition: mallocgetheapptr.c:25
This structure defines the Thread Control Block (TCB).
Definition: thread.h:671
void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot)
Tasks a snapshot of the resource usage of the system.
Definition: resource_snapshot.c:141
Control block used to manage a heap.
Definition: heap.h:342
int malloc_info(Heap_Information_block *the_info)
Get malloc status information.
Definition: mallocinfo.c:24
Definition: libcsupport.h:131
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:165
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:173