source: mainline/uspace/lib/c/include/stacktrace.h@ cd1e3fc0

Last change on this file since cd1e3fc0 was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 * SPDX-FileCopyrightText: 2009 Jakub Jermar
3 * SPDX-FileCopyrightText: 2010 Jiri Svoboda
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/** @addtogroup libc
9 * @{
10 */
11/** @file
12 */
13
14#ifndef _LIBC_STACKTRACE_H_
15#define _LIBC_STACKTRACE_H_
16
17#include <errno.h>
18#include <stdint.h>
19#include <stdbool.h>
20
21typedef struct {
22 errno_t (*read_uintptr)(void *, uintptr_t, uintptr_t *);
23 int (*printf)(const char *, ...);
24} stacktrace_ops_t;
25
26typedef struct {
27 void *op_arg;
28 stacktrace_ops_t *ops;
29} stacktrace_t;
30
31extern void stacktrace_print(void);
32extern void stacktrace_kio_print(void);
33extern void stacktrace_print_fp_pc(uintptr_t, uintptr_t);
34extern void stacktrace_print_generic(stacktrace_ops_t *, void *, uintptr_t,
35 uintptr_t);
36
37/*
38 * The following interface is to be implemented by each architecture.
39 */
40extern bool stacktrace_fp_valid(stacktrace_t *, uintptr_t);
41extern errno_t stacktrace_fp_prev(stacktrace_t *, uintptr_t, uintptr_t *);
42extern errno_t stacktrace_ra_get(stacktrace_t *, uintptr_t, uintptr_t *);
43
44extern void stacktrace_prepare(void);
45extern uintptr_t stacktrace_fp_get(void);
46extern uintptr_t stacktrace_pc_get(void);
47
48#endif
49
50/** @}
51 */
Note: See TracBrowser for help on using the repository browser.