RTEMS 6.1-rc4
Loading...
Searching...
No Matches
stackchk.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * COPYRIGHT (c) 1989-2024 On-Line Applications Research Corporation (OAR).
13 * COPYRIGHT (c) 2024 Mohamed Hassan <muhammad.hamdy.hassan@gmail.com>
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _RTEMS_STACKCHK_H
38#define _RTEMS_STACKCHK_H
39
40#include <rtems.h>
41#include <rtems/print.h>
42
49#ifdef __cplusplus
50extern "C" {
51#endif
52
63
73
87 const rtems_printer *printer
88);
89
93typedef struct {
101
108 const char *name;
109
113 const void *begin;
114
118 uintptr_t size;
119
126 const void *current;
127
134 uintptr_t used;
136
146 const rtems_stack_checker_info *info,
147 void *arg
148);
149
163
164/*************************************************************
165 *************************************************************
166 ** Prototyped only so the user extension can be installed **
167 *************************************************************
168 *************************************************************/
169
183 rtems_tcb *running,
184 rtems_tcb *the_thread
185);
186
187void rtems_stack_checker_begin_extension( rtems_tcb *executing );
188
202 rtems_tcb *running,
203 rtems_tcb *heir
204);
205
217 const rtems_tcb *running,
218 bool pattern_ok
219);
220
231 const rtems_tcb *running,
232 bool pattern_ok
233);
234
241#define RTEMS_STACK_CHECKER_EXTENSION \
242{ \
243 rtems_stack_checker_create_extension, /* rtems_task_create */ \
244 0, /* rtems_task_start */ \
245 0, /* rtems_task_restart */ \
246 0, /* rtems_task_delete */ \
247 rtems_stack_checker_switch_extension, /* task_switch */ \
248 rtems_stack_checker_begin_extension, /* task_begin */ \
249 0, /* task_exitted */ \
250 0, /* fatal */ \
251 0 /* terminate */ \
252}
253
264 const rtems_tcb *running,
265 bool pattern_ok
266);
267
274
275#ifdef __cplusplus
276}
277#endif
279#endif
280/* end of include file */
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition: types.h:94
const Stack_checker_Reporter_handler Stack_checker_Reporter
The Stack Checker Reporter Initialization Handler.
void(* Stack_checker_Reporter_handler)(const rtems_tcb *running, bool pattern_ok)
The Stack Checker Reporter Initialization Handler.
Definition: stackchk.h:263
void rtems_stack_checker_reporter_quiet(const rtems_tcb *running, bool pattern_ok)
A Quiet Version of Stack Checker Reporter.
Definition: check.c:312
void rtems_stack_checker_report_usage_with_plugin(const rtems_printer *printer)
Print the stack usage report using caller's routine.
Definition: check.c:539
void rtems_stack_checker_iterate(rtems_stack_checker_visitor visit, void *arg)
Iterates over all stacks used by the system and invokes the visitor routine for each stack.
Definition: check.c:562
bool rtems_stack_checker_is_blown(void)
Checks if current task is blown its stack.
Definition: check.c:376
void rtems_stack_checker_switch_extension(rtems_tcb *running, rtems_tcb *heir)
Stack Checker Task Context Switch Extension.
Definition: check.c:326
bool rtems_stack_checker_create_extension(rtems_tcb *running, rtems_tcb *the_thread)
Stack Checker Task Create Extension.
void rtems_stack_checker_report_usage(void)
Print the stack usage report using printk.
Definition: check.c:555
void rtems_stack_checker_reporter_print_details(const rtems_tcb *running, bool pattern_ok)
The Default Function to Report a Blown Stack.
Definition: check.c:264
void(* rtems_stack_checker_visitor)(const rtems_stack_checker_info *info, void *arg)
Visitor routines invoked by rtems_stack_checker_iterate() shall have this type.
Definition: stackchk.h:145
User print interface to the bspIO print plug in.
This header file defines the RTEMS Classic API.
Definition: thread.h:837
Definition: printer.h:76
Stack information provided by the stack checker.
Definition: stackchk.h:93
uintptr_t used
Definition: stackchk.h:134
uintptr_t size
Definition: stackchk.h:118
const void * current
Definition: stackchk.h:126
const void * begin
Definition: stackchk.h:113
const char * name
Definition: stackchk.h:108
rtems_id id
Definition: stackchk.h:100