|
PebbleOS v4.48.0-75-g7416f78a1
|
Stop the system on an unrecoverable error. More...
Data Structures | |
| struct | pbl_fault_info |
| CPU fault, as handed to the fault handlers. More... | |
Macros | |
| #define | pbl_panic(...) PBL_PANIC_SELECT(__VA_OPT__(MESSAGE))(__VA_ARGS__) |
| Stop the system. | |
Enumerations | |
| enum | pbl_fault_reason { PBL_FAULT_STACK_OVERFLOW , PBL_FAULT_MEMORY , PBL_FAULT_BUS , PBL_FAULT_USAGE , PBL_FAULT_HARD } |
| Cause of a CPU fault. More... | |
Functions | |
| void | pbl_fatal_error_handler (uintptr_t lr) |
| Handle a fatal error. | |
| void | pbl_fault_fatal_record (const struct pbl_fault_info *info) |
| Record a CPU fault the system can't recover from. | |
| void | pbl_fault_fatal_handler (const struct pbl_fault_info *info) |
| Handle a CPU fault the system can't recover from. | |
| void | pbl_fault_thread_handler (const struct pbl_fault_info *info) |
| Handle a CPU fault in an unprivileged thread. | |
Stop the system on an unrecoverable error.
The kernel logs the error with the address of the code that raised it, then hands over to pbl_fatal_error_handler(), which an application may override. CPU faults go to pbl_fault_fatal_handler(), or pbl_fault_thread_handler() when only an unprivileged thread needs to stop.
| struct pbl_fault_info |
CPU fault, as handed to the fault handlers.
| Data Fields | ||
|---|---|---|
| uintptr_t | addr | Data address the fault happened on; 0 if unknown. |
| uintptr_t | lr | Return address of the faulting code; 0 if unknown. |
| uintptr_t | pc | Address of the faulting instruction; 0 if unknown. |
| enum pbl_fault_reason | reason | Cause. |
| #define pbl_panic | ( | ... | ) | PBL_PANIC_SELECT(__VA_OPT__(MESSAGE))(__VA_ARGS__) |
Stop the system.
Without arguments only the address of the caller is logged, the cheapest form, and the call is an expression.
| ... | Optional printf-style message, a string literal, and its arguments. |
| enum pbl_fault_reason |
| void pbl_fatal_error_handler | ( | uintptr_t | lr | ) |
Handle a fatal error.
The kernel calls it once the error is logged. The default flushes the logs and resets; an application overrides it, e.g. to save a core dump first. It must not return.
| lr | Address of the code that raised the error. |
| void pbl_fault_fatal_handler | ( | const struct pbl_fault_info * | info | ) |
Handle a CPU fault the system can't recover from.
The kernel calls it from the fault exception once the fault is recorded and logged. The default flushes the logs and resets; an application overrides it, e.g. to save a core dump. It must not return.
| info | Fault. |
| void pbl_fault_fatal_record | ( | const struct pbl_fault_info * | info | ) |
Record a CPU fault the system can't recover from.
The kernel calls it from the fault exception before logging anything, so the record survives a fault or hang while logging. The default does nothing; an application overrides it, e.g. to record why the system is about to reset. It must not log.
| info | Fault. |
| void pbl_fault_thread_handler | ( | const struct pbl_fault_info * | info | ) |
Handle a CPU fault in an unprivileged thread.
The kernel logs the fault and leaves the faulting code for this function, on the same thread, now privileged. The default is pbl_fault_fatal_handler(); an application overrides it, e.g. to kill only that thread. It must not return.
| info | Fault. |