-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoredump.h
58 lines (48 loc) · 1.19 KB
/
coredump.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* @file coredump.h
* @author Tomasz Watorowski ([email protected])
* @date 2025-01-05
*
* @copyright Copyright (c) 2025
*/
#ifndef COREDUMP_H
#define COREDUMP_H
#include <stdint.h>
#include "err.h"
/* core dump structure */
typedef struct coredump {
/* two words that shall indicate that this dump is valid */
volatile int32_t valid, valid_neg;
/* stack pointer */
uint32_t sp, ipsr;
/* core registers */
uint32_t r0, r1, r2, r3, r12, lr, pc, psr;
/* scb registers */
uint32_t cfsr, hfsr, mmar, bfar;
} coredump_t;
/**
* @brief store the core dump within ram
*
* @param sp stack pointer
* @param ipsr Interrupt Program Status Register value
*/
void CoreDump_StoreDump(uint32_t *sp, uint32_t ipsr);
/**
* @brief prints the core dump to the debug interface
*
* @param invalidate_after_printing 1 - invalidate, 0 - do not invalidate
* @return err_t error code
*/
err_t CoreDump_PrintDump(int invalidate_after_printing);
/**
* @brief checks if the core dump is valid
*
* @return int 1 - it is valid, 0 - otherwise
*/
int CoreDump_IsValid(void);
/**
* @brief invalidate the core dump
*
*/
void CoreDump_Invalidate(void);
#endif /* COREDUMP_H */