fault.h¶
Typedefs
-
typedef struct emb_fault_info emb_fault_info_t¶
-
typedef void (*emb_fault_hook_t)(const emb_fault_info_t *info)¶
Enums
-
enum emb_fault_class¶
Values:
-
enumerator EMB_FAULT_NONE¶
-
enumerator EMB_FAULT_API_CONTEXT¶
-
enumerator EMB_FAULT_API_ARGUMENT¶
-
enumerator EMB_FAULT_API_HANDLE¶
-
enumerator EMB_FAULT_API_OWNER¶
-
enumerator EMB_FAULT_API_LIFECYCLE¶
-
enumerator EMB_FAULT_KERNEL_INVARIANT¶
-
enumerator EMB_FAULT_STACK_OVERFLOW¶
-
enumerator EMB_FAULT_IRQ_NESTING¶
-
enumerator EMB_FAULT_SPURIOUS_IRQ¶
-
enumerator EMB_FAULT_HARDWARE¶
-
enumerator EMB_FAULT_CHECK¶
-
enumerator EMB_FAULT_PI_DEPTH¶
-
enumerator EMB_FAULT_LOCK_BUDGET¶
-
enumerator EMB_FAULT_NONE¶
Functions
-
void emb_fault_set_hook(emb_fault_hook_t hook)¶
- Register the function called on every kernel fault.
Context: prekernel thread Blocking: no Timing: O(1) Ownership: none Configuration: Requirements: API-017 Since: 0.2 Stability: yes
- Parameters:
hook – May run in any context with interrupts masked; NULL removes the hook. Must be bounded and ISR-safe. Copy any required info during the call: its pointer refers to a temporary record, not retained crash storage.
-
void emb_fault(uint8_t fault_class, uint16_t code, const char *where)¶
- Raise a kernel fault from application or subsystem code.
Context: thread isr prekernel Blocking: no Timing: O(1) preparation plus trace/hook and the non-returning port action Ownership: none Configuration: Requirements: API-015 API-017 Since: 0.2 Stability: yes
- Parameters:
fault_class – An enum emb_fault_class value.
code – Class-specific code.
where – Source location or description; may be NULL.
-
struct emb_fault_info¶
- #include <fault.h>