forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpanic.h
More file actions
40 lines (32 loc) · 1.11 KB
/
panic.h
File metadata and controls
40 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2018 Intel Corporation. All rights reserved.
*
* Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
*/
#ifndef __SOF_DEBUG_PANIC_H__
#define __SOF_DEBUG_PANIC_H__
#include <arch/debug/panic.h>
#include <ipc/trace.h>
#include <stdint.h>
#ifdef __clang_analyzer__
#define SOF_NORETURN __attribute__((analyzer_noreturn))
#elif __GNUC__
#define SOF_NORETURN __attribute__((noreturn))
#else
#define SOF_NORETURN
#endif
#ifndef RELATIVE_FILE
#error "This file requires RELATIVE_FILE to be defined. " \
"Add it to CMake's target with sof_append_relative_path_definitions."
#endif
void dump_panicinfo(void *addr, struct sof_ipc_panic_info *panic_info);
void panic_dump(uint32_t p, struct sof_ipc_panic_info *panic_info,
uintptr_t *data)
SOF_NORETURN;
void __panic(uint32_t p, char *filename, uint32_t linenum) SOF_NORETURN;
/* panic dump filename and linenumber of the call */
#define panic(x) __panic((x), (RELATIVE_FILE), (__LINE__))
/* runtime assertion */
#define assert(cond) (void)((cond) || (panic(SOF_IPC_PANIC_ASSERT), 0))
#endif /* __SOF_DEBUG_PANIC_H__ */