Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
coredump.h
Go to the documentation of this file.
1/*
2 * Copyright Meta Platforms, Inc. and its affiliates.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef INCLUDE_ZEPHYR_DRIVERS_COREDUMP_H_
14#define INCLUDE_ZEPHYR_DRIVERS_COREDUMP_H_
15
16#include <zephyr/device.h>
17#include <zephyr/sys/slist.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
29
48
56typedef void (*coredump_dump_callback_t)(uintptr_t dump_area, size_t dump_area_size);
57
62
69typedef void (*coredump_device_dump_t)(const struct device *dev);
70
75typedef bool (*coredump_device_register_memory_t)(const struct device *dev,
76 struct coredump_mem_region_node *region);
77
82typedef bool (*coredump_device_unregister_memory_t)(const struct device *dev,
83 struct coredump_mem_region_node *region);
84
89typedef bool (*coredump_device_register_callback_t)(const struct device *dev,
91
113
115
126static inline bool coredump_device_register_memory(const struct device *dev,
127 struct coredump_mem_region_node *region)
128{
129 return DEVICE_API_GET(coredump, dev)->register_memory(dev, region);
130}
131
142static inline bool coredump_device_unregister_memory(const struct device *dev,
143 struct coredump_mem_region_node *region)
144{
145 return DEVICE_API_GET(coredump, dev)->unregister_memory(dev, region);
146}
147
157static inline bool coredump_device_register_callback(const struct device *dev,
159{
160 return DEVICE_API_GET(coredump, dev)->register_callback(dev, callback);
161}
162
166
167#ifdef __cplusplus
168}
169#endif
170
171#endif /* INCLUDE_ZEPHYR_DRIVERS_COREDUMP_H_ */
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1449
static void coredump(unsigned int reason, const struct arch_esf *esf, struct k_thread *thread)
Perform coredump.
Definition coredump.h:266
static bool coredump_device_register_memory(const struct device *dev, struct coredump_mem_region_node *region)
Register a region of memory to be stored in core dump at the time it is generated.
Definition coredump.h:126
void(* coredump_device_dump_t)(const struct device *dev)
@def_driverbackendgroup{Coredump pseudo-device,coredump_device_interface}
Definition coredump.h:69
bool(* coredump_device_register_memory_t)(const struct device *dev, struct coredump_mem_region_node *region)
Register a memory region to be stored in the core dump.
Definition coredump.h:75
void(* coredump_dump_callback_t)(uintptr_t dump_area, size_t dump_area_size)
Callback that occurs at dump time, data copied into dump_area will be included in the dump that is ge...
Definition coredump.h:56
static bool coredump_device_register_callback(const struct device *dev, coredump_dump_callback_t callback)
Register a callback to be invoked at dump time.
Definition coredump.h:157
bool(* coredump_device_register_callback_t)(const struct device *dev, coredump_dump_callback_t callback)
Register a callback to be invoked at dump time.
Definition coredump.h:89
bool(* coredump_device_unregister_memory_t)(const struct device *dev, struct coredump_mem_region_node *region)
Unregister a memory region from being stored in the core dump.
Definition coredump.h:82
static bool coredump_device_unregister_memory(const struct device *dev, struct coredump_mem_region_node *region)
Unregister a region of memory to be stored in core dump at the time it is generated.
Definition coredump.h:142
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:44
Header file for the single-linked list API.
#define bool
Definition stdbool.h:13
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
@driver_ops{Coredump pseudo-device}
Definition coredump.h:95
coredump_device_register_callback_t register_callback
@driver_ops_mandatory Register a callback to be invoked at dump time.
Definition coredump.h:111
coredump_device_register_memory_t register_memory
@driver_ops_mandatory Register a region of memory to be stored in core dump at the time it is gener...
Definition coredump.h:103
coredump_device_unregister_memory_t unregister_memory
@driver_ops_mandatory Unregister a region of memory to be stored in core dump at the time it is gen...
Definition coredump.h:107
coredump_device_dump_t dump
@driver_ops_mandatory Add the device's data into the core dump being generated.
Definition coredump.h:99
Structure describing a region in memory that may be stored in core dump at the time it is generated.
Definition coredump.h:38
sys_snode_t node
Node of single-linked list, do not modify.
Definition coredump.h:40
size_t size
Size of memory region.
Definition coredump.h:46
uintptr_t start
Address of start of memory region.
Definition coredump.h:43
Runtime device structure (in ROM) per driver instance.
Definition device.h:513