Sound Open Firmware
Loading...
Searching...
No Matches
memory.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2024 Intel Corporation.
4 */
5
6#ifndef __SOF_LIB_MEMORY_H__
7#define __SOF_LIB_MEMORY_H__
8
9#include <platform/lib/memory.h>
10#include <stdbool.h>
11
12#ifndef __cold
13#define __cold
14#endif
15
16#ifndef __cold_rodata
17#define __cold_rodata
18#endif
19
20#ifdef __ZEPHYR__
21bool ll_sch_is_current(void);
22#else
23#define ll_sch_is_current() false
24#endif
25
26#if CONFIG_COLD_STORE_EXECUTE_DEBUG
27#include <rtos/panic.h>
28
31void dbg_path_hot_confirm(void);
32void dbg_path_cold_enter(const char *fn);
33
34static inline void __assert_can_be_cold(const char *fn)
35{
36 if (k_is_user_context())
37 return;
38
39 __ASSERT(!ll_sch_is_current(), "%s() called from an LL thread!", fn);
41}
42#define assert_can_be_cold() __assert_can_be_cold(__func__)
43#else
44#define dbg_path_hot_start_watching() do {} while (0)
45#define dbg_path_hot_stop_watching() do {} while (0)
46#define dbg_path_hot_confirm() do {} while (0)
47#define dbg_path_cold_enter() do {} while (0)
48#define assert_can_be_cold() do {} while (0)
49#endif
50
51#endif /* __SOF_LIB_MEMORY_H__ */
#define dbg_path_hot_stop_watching()
Definition memory.h:45
#define dbg_path_hot_start_watching()
Definition memory.h:44
#define dbg_path_hot_confirm()
Definition memory.h:46
#define dbg_path_cold_enter()
Definition memory.h:47
#define ll_sch_is_current()
Definition memory.h:23