Commit fee4f63
committed
Added the PMSAv8-R region setup and fault handler for the module port
Two of the module manager's port-specific sources, both derived from the
Armv8-M versions for the reasons given in the previous commit.
The region setup needed two substantive changes and they are the ones worth
reviewing.
The address mask is 64-byte where Armv8-M is 32-byte, and it is now a named
constant, TXM_MODULE_MPU_ADDRESS_MASK, rather than a literal repeated six times.
PRBAR and PRLAR hold attributes in the bits below the granule, so masking to the
wrong boundary does not fault: it writes address bits into the shareability and
permission fields, and the region comes up with attributes nobody asked for.
That failure is silent, which is why the constant is named and the reason is
recorded where the code uses it.
Regions are non-shareable where the M33 port marks module memory
inner-shareable. The RTU here is a single Cortex-R52 and every region in the
board support package's map is non-shareable, so matching it keeps one memory
model across the kernel and its modules. A multi-core RTU configuration would
need to revisit this, and much else besides.
The fault handler needed almost nothing, which was worth finding out. It is
architecture-neutral: it terminates the faulting thread and calls the
notification callback. The register capture happens before it, in the abort
vector, and that part is still to be written -- DFSR, DFAR, IFSR and IFAR have
to be read before anything else can fault and overwrite them, and on this core
the abort is taken in Abort mode with its own banked lr and sp, so the capture
belongs there rather than in C. The file now says so, so the next person does
not look for it here.
Both files compile clean against the module headers, which also confirms the
header work: the new mask and the DFSR, DFAR, IFSR and IFAR fault fields all
resolve.
Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>1 parent 3294dd3 commit fee4f63
3 files changed
Lines changed: 329 additions & 0 deletions
File tree
- ports_module/cortex_r52/gnu
- inc
- module_manager/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
208 | 214 | | |
209 | 215 | | |
210 | 216 | | |
| |||
Lines changed: 116 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
0 commit comments