RTEMS 6.1-rc4
Loading...
Searching...
No Matches
libcsupport.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
14/*
15 * COPYRIGHT (c) 1989-2011.
16 * On-Line Applications Research Corporation (OAR).
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40#ifndef _RTEMS_RTEMS_LIBCSUPPORT_H
41#define _RTEMS_RTEMS_LIBCSUPPORT_H
42
43#include <sys/types.h>
44#include <stdint.h>
45
46#include <rtems/score/heap.h>
47#include <rtems/rtems/tasks.h>
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
63extern void malloc_dump(void);
64
68extern bool malloc_walk(int source, bool printf_enabled);
69
76
83
89extern size_t malloc_free_space(void);
90
96extern int malloc_info(Heap_Information_block *the_info);
97
98/*
99 * Prototypes required to install newlib reentrancy user extension
100 */
101
102#ifdef _REENT_THREAD_LOCAL
103#define _NEWLIB_CREATE_HOOK NULL
104#else
105bool newlib_create_hook(
106 rtems_tcb *current_task,
107 rtems_tcb *creating_task
108);
109#define _NEWLIB_CREATE_HOOK newlib_create_hook
110#endif
111
112void newlib_terminate_hook(
113 rtems_tcb *current_task
114);
115
116#define RTEMS_NEWLIB_EXTENSION \
117 { \
118 _NEWLIB_CREATE_HOOK, /* thread_create */ \
119 NULL, /* thread_start */ \
120 NULL, /* thread_restart */ \
121 NULL, /* thread_delete */ \
122 NULL, /* thread_switch */ \
123 NULL, /* thread_begin */ \
124 NULL, /* thread_exitted */ \
125 NULL, /* fatal */ \
126 newlib_terminate_hook /* thread_terminate */ \
127 }
128
129typedef struct {
130 uint32_t active_barriers;
131 uint32_t active_extensions;
132 uint32_t active_message_queues;
133 uint32_t active_partitions;
134 uint32_t active_periods;
135 uint32_t active_ports;
136 uint32_t active_regions;
137 uint32_t active_semaphores;
138 uint32_t active_tasks;
139 uint32_t active_timers;
141
142typedef struct {
143 uint32_t active_message_queues;
144 uint32_t active_semaphores;
145 uint32_t active_threads;
146 uint32_t active_timers;
148
149typedef struct {
150 Heap_Information_block workspace_info;
151 Heap_Information_block heap_info;
152 uint32_t active_posix_key_value_pairs;
153 uint32_t active_posix_keys;
154 rtems_resource_rtems_api rtems_api;
155 rtems_resource_posix_api posix_api;
156 int open_files;
158
184
199);
200
214
217#ifdef __cplusplus
218}
219#endif
220
221#endif
222/* end of include file */
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:148
int malloc_info(Heap_Information_block *the_info)
Get malloc status information.
Definition: mallocinfo.c:43
Heap_Control * malloc_get_heap_pointer(void)
Get malloc heap pointer.
Definition: mallocgetheapptr.c:44
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:156
bool malloc_walk(int source, bool printf_enabled)
Malloc walk.
void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot)
Tasks a snapshot of the resource usage of the system.
Definition: resource_snapshot.c:113
size_t malloc_free_space(void)
Get free malloc information.
Definition: mallocfreespace.c:56
void malloc_set_heap_pointer(Heap_Control *new_heap)
Set malloc heap pointer.
Definition: mallocsetheapptr.c:44
This header file provides interfaces of the Heap Handler which are used by the implementation and the...
Control block used to manage a heap.
Definition: heap.h:339
Information block returned by _Heap_Get_information().
Definition: heapinfo.h:165
Definition: thread.h:837
Definition: libcsupport.h:142
Definition: libcsupport.h:129
Definition: libcsupport.h:149
This header file defines the main parts of the Tasks Manager API.