From 3d62d44e46ce33388e620ead92747f9d56c01b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Desbiens?= Date: Mon, 28 Sep 2026 18:08:46 -0400 Subject: [PATCH] Removed the Cortex-M asides from the Cortex-R52 module port Four comments in the Cortex-R52 module port explained what the Cortex-M ports do instead. A reader working on this port cannot act on any of it: the behaviour described belongs to a different architecture, and the surrounding comments already say what this port does and why. The remaining text is unchanged. The abort vector still explains the three things it owes the fault handler and what omitting the first costs, the fault handler still explains why its two statements are ordered as they are, and the preamble still says that every GNU module port writes the entry-point words the same way. Comment-only. The port builds clean, 203 targets, zero warnings. Assisted-by: Claude Code (Opus 5) --- .../fvp_baser_aemv8r/txm_module_preamble.S | 3 +-- .../example_build/s32z280_evb/txm_module_preamble.S | 3 +-- .../src/txm_module_manager_fault_capture.S | 3 +-- .../src/txm_module_manager_memory_fault_handler.c | 12 +++++------- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ports_module/cortex_r52/gnu/example_build/fvp_baser_aemv8r/txm_module_preamble.S b/ports_module/cortex_r52/gnu/example_build/fvp_baser_aemv8r/txm_module_preamble.S index 19bd89318..54a526449 100644 --- a/ports_module/cortex_r52/gnu/example_build/fvp_baser_aemv8r/txm_module_preamble.S +++ b/ports_module/cortex_r52/gnu/example_build/fvp_baser_aemv8r/txm_module_preamble.S @@ -105,8 +105,7 @@ __txm_module_preamble: @ dereference goes through a register the stack build had zeroed. On silicon @ that read faulted at 0x1C, which is offset 0x1C from a null r3. @ -@ Every other GNU module port writes these the same way; cortex_m33's -@ preamble, which this port was seeded from, spells it "symbol - . - 0". +@ Every other GNU module port writes these the same way. .word _txm_module_thread_shell_entry - . .word demo_module_start - . diff --git a/ports_module/cortex_r52/gnu/example_build/s32z280_evb/txm_module_preamble.S b/ports_module/cortex_r52/gnu/example_build/s32z280_evb/txm_module_preamble.S index 19bd89318..54a526449 100644 --- a/ports_module/cortex_r52/gnu/example_build/s32z280_evb/txm_module_preamble.S +++ b/ports_module/cortex_r52/gnu/example_build/s32z280_evb/txm_module_preamble.S @@ -105,8 +105,7 @@ __txm_module_preamble: @ dereference goes through a register the stack build had zeroed. On silicon @ that read faulted at 0x1C, which is offset 0x1C from a null r3. @ -@ Every other GNU module port writes these the same way; cortex_m33's -@ preamble, which this port was seeded from, spells it "symbol - . - 0". +@ Every other GNU module port writes these the same way. .word _txm_module_thread_shell_entry - . .word demo_module_start - . diff --git a/ports_module/cortex_r52/gnu/module_manager/src/txm_module_manager_fault_capture.S b/ports_module/cortex_r52/gnu/module_manager/src/txm_module_manager_fault_capture.S index 48090ff33..b9b8cafc1 100644 --- a/ports_module/cortex_r52/gnu/module_manager/src/txm_module_manager_fault_capture.S +++ b/ports_module/cortex_r52/gnu/module_manager/src/txm_module_manager_fault_capture.S @@ -71,8 +71,7 @@ @/* dead thread's stack pointer. It looks like it works, because the */ @/* thread is never resumed -- but nothing gives the Abort stack back, */ @/* so each module fault costs it about 56 bytes for the life of the */ -@/* run. The Cortex-M ports do not need step 1: there */ -@/* _tx_thread_system_return only pends PendSV and returns. */ +@/* run. */ @/* */ @/**************************************************************************/ diff --git a/ports_module/cortex_r52/gnu/module_manager/src/txm_module_manager_memory_fault_handler.c b/ports_module/cortex_r52/gnu/module_manager/src/txm_module_manager_memory_fault_handler.c index 62f287e09..729d7456c 100644 --- a/ports_module/cortex_r52/gnu/module_manager/src/txm_module_manager_memory_fault_handler.c +++ b/ports_module/cortex_r52/gnu/module_manager/src/txm_module_manager_memory_fault_handler.c @@ -52,15 +52,13 @@ architecture _tx_thread_system_return switches context immediately and never comes back, so the callback would be unreachable. - The body below is therefore left exactly as the cortex_m33, cortex_a7 and - cortex_m7 ports have it, and the requirement is met where it belongs -- in + The body below is therefore left exactly as the other module ports have it, + and the requirement is met where it belongs -- in txm_module_manager_fault_capture.S, which increments _tx_thread_system_state around this call, clears _tx_thread_current_ptr afterwards and returns into - the scheduler. The Cortex-M ports need no such bracket because their - _tx_thread_system_return only pends PendSV and returns. Anyone tempted to - reorder the two statements below to "fix" a notify callback that does not fire - should look at the abort vector first: the ordering here is upstream's and it - is not the defect. */ + the scheduler. Anyone tempted to reorder the two statements below to "fix" a + notify callback that does not fire should look at the abort vector first: the + ordering here is upstream's and it is not the defect. */ /* Define the user's fault notification callback function pointer. This is setup via the txm_module_manager_memory_fault_notify API. */