RTEMS 6.1-rc2
Loading...
Searching...
No Matches
stackchk.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
14/*
15 * COPYRIGHT (c) 1989-2009.
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_STACKCHK_H
41#define _RTEMS_STACKCHK_H
42
43#include <rtems.h>
44#include <rtems/print.h>
45
52#ifdef __cplusplus
53extern "C" {
54#endif
55
67
77
90 const rtems_printer *printer
91);
92
97typedef struct {
105
112 const char *name;
113
117 const void *begin;
118
122 uintptr_t size;
123
130 const void *current;
131
138 uintptr_t used;
140
150 const rtems_stack_checker_info *info,
151 void *arg
152);
153
167
168/*************************************************************
169 *************************************************************
170 ** Prototyped only so the user extension can be installed **
171 *************************************************************
172 *************************************************************/
173
186 rtems_tcb *running,
187 rtems_tcb *the_thread
188);
189
190void rtems_stack_checker_begin_extension( rtems_tcb *executing );
191
204 rtems_tcb *running,
205 rtems_tcb *heir
206);
207
214#define RTEMS_STACK_CHECKER_EXTENSION \
215{ \
216 rtems_stack_checker_create_extension, /* rtems_task_create */ \
217 0, /* rtems_task_start */ \
218 0, /* rtems_task_restart */ \
219 0, /* rtems_task_delete */ \
220 rtems_stack_checker_switch_extension, /* task_switch */ \
221 rtems_stack_checker_begin_extension, /* task_begin */ \
222 0, /* task_exitted */ \
223 0, /* fatal */ \
224 0 /* terminate */ \
225}
226
227#ifdef __cplusplus
228}
229#endif
231#endif
232/* end of include file */
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition: types.h:94
void rtems_stack_checker_report_usage_with_plugin(const rtems_printer *printer)
Print the stack usage report using caller's routine.
Definition: check.c:531
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:554
bool rtems_stack_checker_is_blown(void)
Checks if current task is blown its stack.
Definition: check.c:367
void rtems_stack_checker_switch_extension(rtems_tcb *running, rtems_tcb *heir)
Stack Checker Task Context Switch Extension.
Definition: check.c:317
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:547
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:149
User print interface to the bspIO print plug in.
This header file defines the RTEMS Classic API.
Definition: thread.h:812
Definition: printer.h:76
This structure contains the stack information provided by the stack checker for a stack.
Definition: stackchk.h:97
uintptr_t used
This member contains the size in byes of the used stack area.
Definition: stackchk.h:138
uintptr_t size
This member contains the size in byes of the stack area.
Definition: stackchk.h:122
const void * current
This member provides the current stack pointer of the stack.
Definition: stackchk.h:130
const void * begin
This member provides the begin address of the stack area.
Definition: stackchk.h:117
const char * name
This member provides the object name associated with the object using the stack.
Definition: stackchk.h:112
rtems_id id
This member contains the object identifier associated with the object using the stack.
Definition: stackchk.h:104