xref: /optee_os/core/include/kernel/unwind.h (revision 8d541aee2e0fe7242ec6fb57aabc7a04471b2237)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*-
3  * Copyright (c) 2015-2019 Linaro Limited
4  * Copyright (c) 2020, Huawei Technologies Co., Ltd
5  */
6 
7 #ifndef __KERNEL_UNWIND
8 #define __KERNEL_UNWIND
9 
10 #include <types_ext.h>
11 
12 #if defined(CFG_UNWIND) && (TRACE_LEVEL > 0)
13 void print_kernel_stack(void);
14 #else
15 static inline void print_kernel_stack(void)
16 {
17 }
18 #endif
19 
20 #ifdef CFG_UNWIND
21 /* Get current call stack as an array allocated on the heap */
22 vaddr_t *unw_get_kernel_stack(void);
23 #else
24 static inline void *unw_get_kernel_stack(void)
25 {
26 	return NULL;
27 }
28 #endif /* CFG_UNWIND  */
29 
30 #endif /*__KERNEL_UNWIND*/
31