7#ifndef ZEPHYR_INCLUDE_DEBUG_COREDUMP_H_
8#define ZEPHYR_INCLUDE_DEBUG_COREDUMP_H_
18#define COREDUMP_BEGIN_STR "BEGIN#"
19#define COREDUMP_END_STR "END#"
20#define COREDUMP_ERROR_STR "ERROR CANNOT DUMP#"
26#define COREDUMP_PREFIX_STR "#CD:"
139#ifdef CONFIG_DEBUG_COREDUMP
145#define COREDUMP_HDR_VER 2
147#define COREDUMP_ARCH_HDR_ID 'A'
149#define THREADS_META_HDR_ID 'T'
150#define THREADS_META_HDR_VER 1
152#define COREDUMP_MEM_HDR_ID 'M'
153#define COREDUMP_MEM_HDR_VER 1
156enum coredump_tgt_code {
157 COREDUMP_TGT_UNKNOWN = 0,
160 COREDUMP_TGT_ARM_CORTEX_M,
167struct coredump_hdr_t {
187struct coredump_arch_hdr_t {
199struct coredump_threads_meta_hdr_t {
211struct coredump_mem_hdr_t {
225typedef void (*coredump_backend_start_t)(void);
226typedef void (*coredump_backend_end_t)(void);
227typedef void (*coredump_backend_buffer_output_t)(
uint8_t *buf,
size_t buflen);
233struct coredump_backend_api {
235 coredump_backend_start_t start;
238 coredump_backend_end_t end;
241 coredump_backend_buffer_output_t buffer_output;
244 coredump_backend_query_t query;
247 coredump_backend_cmd_t
cmd;
270 ARG_UNUSED(start_addr);
271 ARG_UNUSED(end_addr);
282 ARG_UNUSED(query_id);
289 ARG_UNUSED(query_id);
coredump_query_id
Query ID.
Definition coredump.h:39
coredump_cmd_id
Command ID.
Definition coredump.h:70
static int coredump_cmd(enum coredump_cmd_id query_id, void *arg)
Perform command on coredump subsystem.
Definition coredump.h:287
static int coredump_query(enum coredump_query_id query_id, void *arg)
Perform query on coredump subsystem.
Definition coredump.h:280
static void coredump_memory_dump(uintptr_t start_addr, uintptr_t end_addr)
Dump memory region.
Definition coredump.h:268
static void coredump(unsigned int reason, const struct arch_esf *esf, struct k_thread *thread)
Perform coredump.
Definition coredump.h:260
static void coredump_buffer_output(uint8_t *buf, size_t buflen)
Output the buffer via coredump.
Definition coredump.h:274
@ COREDUMP_QUERY_HAS_STORED_DUMP
Check if there is a stored coredump from backend.
Definition coredump.h:53
@ COREDUMP_QUERY_GET_STORED_DUMP_SIZE
Returns:
Definition coredump.h:61
@ COREDUMP_QUERY_MAX
Max value for query ID.
Definition coredump.h:66
@ COREDUMP_QUERY_GET_ERROR
Returns error code from backend.
Definition coredump.h:43
@ COREDUMP_CMD_COPY_STORED_DUMP
Copy the raw stored coredump.
Definition coredump.h:108
@ COREDUMP_CMD_MAX
Max value for command ID.
Definition coredump.h:124
@ COREDUMP_CMD_INVALIDATE_STORED_DUMP
Invalidate the stored coredump.
Definition coredump.h:119
@ COREDUMP_CMD_ERASE_STORED_DUMP
Erase the stored coredump.
Definition coredump.h:97
@ COREDUMP_CMD_VERIFY_STORED_DUMP
Verify that the stored coredump is valid.
Definition coredump.h:87
@ COREDUMP_CMD_CLEAR_ERROR
Clear error code from backend.
Definition coredump.h:76
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition ft8xx_reference_api.h:153
#define ENOTSUP
Unsupported value.
Definition errno.h:114
__INTPTR_TYPE__ off_t
Definition types.h:36
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Exception Stack Frame.
Definition exception.h:60
Coredump copy command (COREDUMP_CMD_COPY_STORED_DUMP) argument definition.
Definition coredump.h:128
off_t offset
Copy offset.
Definition coredump.h:130
uint8_t * buffer
Copy destination buffer.
Definition coredump.h:133
size_t length
Copy length.
Definition coredump.h:136
Thread Structure.
Definition thread.h:259