RTEMS: cpukit/include/rtems/libcsupport.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
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
29extern "C" {
30#endif
31
42extern void malloc_dump(void);
43
47 extern bool malloc_walk(int source, bool printf_enabled);
48
54void malloc_set_heap_pointer(Heap_Control *new_heap);
55
61 Heap_Control *malloc_get_heap_pointer( void );
62
68extern size_t malloc_free_space(void);
69
75extern int malloc_info(Heap_Information_block *the_info);
76
77/*
78 * Prototypes required to install newlib reentrancy user extension
79 */
80bool newlib_create_hook(
81 rtems_tcb *current_task,
82 rtems_tcb *creating_task
83);
84
85void newlib_terminate_hook(
86 rtems_tcb *current_task
87);
88
89#define RTEMS_NEWLIB_EXTENSION \
90{ \
91 newlib_create_hook, /* rtems_task_create */ \
92 0, /* rtems_task_start */ \
93 0, /* rtems_task_restart */ \
94 0, /* rtems_task_delete */ \
95 0, /* task_switch */ \
96 0, /* task_begin */ \
97 0, /* task_exitted */ \
98 0, /* fatal */ \
99 newlib_terminate_hook /* thread terminate */ \
100}
101
102 typedef struct {
103 uint32_t active_barriers;
104 uint32_t active_extensions;
105 uint32_t active_message_queues;
106 uint32_t active_partitions;
107 uint32_t active_periods;
108 uint32_t active_ports;
109 uint32_t active_regions;
110 uint32_t active_semaphores;
111 uint32_t active_tasks;
112 uint32_t active_timers;
113} rtems_resource_rtems_api;
114
115 typedef struct {
116 uint32_t active_message_queues;
117 uint32_t active_semaphores;
118 uint32_t active_threads;
119 uint32_t active_timers;
120} rtems_resource_posix_api;
121
122 typedef struct {
123 Heap_Information_block workspace_info;
124 Heap_Information_block heap_info;
125 uint32_t active_posix_key_value_pairs;
126 uint32_t active_posix_keys;
127 rtems_resource_rtems_api rtems_api;
128 rtems_resource_posix_api posix_api;
129 int open_files;
130} rtems_resource_snapshot;
131
156void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot);
157
169bool rtems_resource_snapshot_equal(
170 const rtems_resource_snapshot *a,
171 const rtems_resource_snapshot *b
172);
173
186bool rtems_resource_snapshot_check(const rtems_resource_snapshot *snapshot);
187
190#ifdef __cplusplus
191}
192#endif
193
194#endif
195/* end of include file */
rtems_resource_snapshot_equal
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
malloc_info
int malloc_info(Heap_Information_block *the_info)
Get malloc status information.
Definition: mallocinfo.c:24
malloc_get_heap_pointer
Heap_Control * malloc_get_heap_pointer(void)
Get malloc heap pointer.
Definition: mallocgetheapptr.c:25
rtems_resource_snapshot_check
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
malloc_walk
bool malloc_walk(int source, bool printf_enabled)
Malloc walk.
rtems_resource_snapshot_take
void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot)
Tasks a snapshot of the resource usage of the system.
Definition: resource_snapshot.c:100
malloc_free_space
size_t malloc_free_space(void)
Get free malloc information.
Definition: mallocfreespace.c:37
malloc_set_heap_pointer
void malloc_set_heap_pointer(Heap_Control *new_heap)
Set malloc heap pointer.
Definition: mallocsetheapptr.c:25
heap.h
Heap Handler API.
Heap_Control
Control block used to manage a heap.
Definition: heap.h:318
Heap_Information_block
Information block returned by _Heap_Get_information().
Definition: heapinfo.h:145
_Thread_Control
Definition: thread.h:732
rtems_resource_posix_api
Definition: libcsupport.h:115
rtems_resource_rtems_api
Definition: libcsupport.h:102
rtems_resource_snapshot
Definition: libcsupport.h:122
tasks.h
Classic Task Manager API.