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 1
147#define COREDUMP_ARCH_HDR_ID 'A'
149#define COREDUMP_MEM_HDR_ID 'M'
150#define COREDUMP_MEM_HDR_VER 1
153enum coredump_tgt_code {
154 COREDUMP_TGT_UNKNOWN = 0,
157 COREDUMP_TGT_ARM_CORTEX_M,
164struct coredump_hdr_t {
184struct coredump_arch_hdr_t {
196struct coredump_mem_hdr_t {
210typedef void (*coredump_backend_start_t)(void);
211typedef void (*coredump_backend_end_t)(void);
212typedef void (*coredump_backend_buffer_output_t)(
uint8_t *buf,
size_t buflen);
218struct coredump_backend_api {
220 coredump_backend_start_t start;
223 coredump_backend_end_t end;
226 coredump_backend_buffer_output_t buffer_output;
229 coredump_backend_query_t query;
232 coredump_backend_cmd_t
cmd;
255 ARG_UNUSED(start_addr);
256 ARG_UNUSED(end_addr);
267 ARG_UNUSED(query_id);
274 ARG_UNUSED(query_id);
static void coredump_buffer_output(uint8_t *buf, size_t buflen)
Output the buffer via coredump.
Definition: coredump.h:259
coredump_query_id
Query ID.
Definition: coredump.h:39
coredump_cmd_id
Command ID.
Definition: coredump.h:70
static void coredump_memory_dump(uintptr_t start_addr, uintptr_t end_addr)
Dump memory region.
Definition: coredump.h:253
static int coredump_cmd(enum coredump_cmd_id query_id, void *arg)
Perform command on coredump subsystem.
Definition: coredump.h:272
static int coredump_query(enum coredump_query_id query_id, void *arg)
Perform query on coredump subsystem.
Definition: coredump.h:265
static void coredump(unsigned int reason, const struct arch_esf *esf, struct k_thread *thread)
Perform coredump.
Definition: coredump.h:245
@ 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:57
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