15#ifndef __SOF_DEBUG_DEBUG_H__
16#define __SOF_DEBUG_DEBUG_H__
31#error "This file requires RELATIVE_FILE to be defined. " \
32 "Add it to CMake's target with sof_append_relative_path_definitions."
40#define DEBUG_SET_FW_READY_FLAGS SOF_IPC_INFO_BUILD
45 volatile uint32_t *__m = (uint32_t *)mailbox_get_debug_base(); \
46 *(__m++) = (RELATIVE_FILE[0] << 24) + \
47 (RELATIVE_FILE[1] << 16) + \
48 (RELATIVE_FILE[2] << 8) + (RELATIVE_FILE[3]); \
49 *(__m++) = (__func__[0] << 24) + (__func__[1] << 16) + \
50 (__func__[2] << 8) + (__func__[3]); \
57 volatile uint32_t *__m = \
58 (uint32_t *)mailbox_get_debug_base() + __x; \
59 *(__m++) = (RELATIVE_FILE[0] << 24) + \
60 (RELATIVE_FILE[1] << 16) + \
61 (RELATIVE_FILE[2] << 8) + (RELATIVE_FILE[3]); \
62 *(__m++) = (__func__[0] << 24) + (__func__[1] << 16) + \
63 (__func__[2] << 8) + (__func__[3]); \
70 volatile uint32_t *__m = \
71 (volatile uint32_t *)mailbox_get_debug_base(); \
76#define dbg_val_at(__v, __x) \
78 volatile uint32_t *__m = \
79 (volatile uint32_t *)mailbox_get_debug_base() + __x; \
84#define dump(addr, count) \
86 volatile uint32_t *__m = (uint32_t *)mailbox_get_debug_base(); \
87 volatile uint32_t *__a = (uint32_t *)addr; \
88 volatile int __c = count; \
90 *(__m++) = *(__a++); \
94#define dump_at(addr, count, offset) \
96 volatile uint32_t *__m = \
97 (uint32_t *)mailbox_get_debug_base() + offset; \
98 volatile uint32_t *__a = (uint32_t *)addr; \
99 volatile int __c = count; \
101 *(__m++) = *(__a++); \
105#define dump_object(__o) \
108 dump(&__o, sizeof(__o) >> 2); \
112#define dump_object_ptr(__o) \
115 dump(__o, sizeof(*(__o)) >> 2); \
119#define dump_object_ptr_at(__o, __at) \
122 dump_at(__o, sizeof(*(__o)) >> 2, __at);\
127#define DEBUG_SET_FW_READY_FLAGS 0
129#define dbg() do {} while (0)
130#define dbg_at(__x) do {} while (0)
131#define dbg_val(__v) do {} while (0)
132#define dbg_val_at(__v, __x) do {} while (0)
133#define dump(addr, count) do {} while (0)
134#define dump_object(__o) do {} while (0)
135#define dump_object_ptr(__o) do {} while (0)
139#define bswap32(N) ({ \
140 __typeof__(N) n = (N); \
141 ((n & 0x000000FF) << 24) | \
142 ((n & 0x0000FF00) << 8) | \
143 ((n & 0x00FF0000) >> 8) | \
144 ((n & 0xFF000000) >> 24); })
151#define dump_hex(ptr, idx, len) \
153 __typeof__(idx) __i = (idx); \
154 __typeof__(ptr) __p = (ptr) + __i; \
155 __typeof__(idx) __l = (len) - __i; \
156 __typeof__(idx) __n = __l > 4 ? 4 : __l; \
158 comp_info(dev, "%08x%08x%08x%08x", bswap32(__p[0]), bswap32(__p[1]), \
159 bswap32(__p[2]), bswap32(__p[3])); \
160 } else if (__n == 3) { \
161 comp_info(dev, "%08x%08x%08x", bswap32(__p[0]), bswap32(__p[1]), \
163 } else if (__n == 2) { \
164 comp_info(dev, "%08x%08x", bswap32(__p[0]), bswap32(__p[1])); \
165 } else if (__n == 1) { \
166 comp_info(dev, "%08x", bswap32(__p[0])); \
172#define dump_hex() do {} while (0)
RTOS data and instruction cache invalidation and writeback helpers.
Sound Open Firmware global runtime context.
Host-DSP IPC trace DMA configuration, filtering, and panic descriptors.