Repository navigation
Added opt-in pointer callback mode and pointer creation APIs - #819
Merged
fdesbiens merged 5 commits intoNov 26, 2026
Merged
Conversation
Dev10-sys
force-pushed
the
feature/pointer-callback-mode
branch
from
October 23, 2026 05:41
64d91fb to
47344b9
Compare
Contributor
|
Thanks @Dev10-sys. I will look into it next week. |
…-threadx#771, eclipse-threadx#772) Support passing full pointer-width context arguments to thread and timer callbacks on 64-bit architectures without truncation, while maintaining full backward compatibility for existing 32-bit ULONG callbacks. - Added tx_thread_create_ptr and tx_timer_create_ptr APIs for direct pointer context callbacks. - Added pointer entry and timeout fields in thread and timer control blocks with automatic dispatch in shell entry and timer threads. - Added TX_ENABLE_POINTER_CALLBACKS configuration option to allow transparent pointer passing with standard create APIs. - Preserved existing ULONG callback signatures across all ports and module manager interfaces. - Added regression tests covering 64-bit pointer argument transmission, error detection paths, and backward compatibility in both standard and SMP builds. Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
Dev10-sys
force-pushed
the
feature/pointer-callback-mode
branch
from
October 24, 2026 07:01
47344b9 to
688f56a
Compare
Adding callback fields inside the thread and internal timer control blocks moved fields used by existing port assembly. Build-wide API aliases also changed signatures used by middleware. Kept the explicit native pointer APIs under TX_ENABLE_POINTER_CONTEXT. It appends storage to TX_THREAD and TX_TIMER, preserving member offsets and the internal timer layout. The default build retains the legacy sizes. Timer processing snapshots the typed callback and context before unlocking. Six Linux pointer tests passed across 32-bit and 64-bit UP and SMP, including timer-thread and ISR processing. Cortex-M4 passed 4/4 module QEMU tests in each configuration. The default M4 manager instructions and relocations matched dev. Cortex-R52 passed the assembly-offset checks in both builds. Assisted-by: Codex (GPT-6.2-Sol) <noreply@openai.com> Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
A module thread can complete while its kernel stack is active. Resetting it used that stack and the privileged mode left by the kernel call. Restored the saved module stack and configured mode, and rebuilt the initial frame using the original module entry information. The Cortex-M3 and Cortex-M4 QEMU lifecycle tests completed and restarted protected workers with the original scalar argument and user mode. Assisted-by: Codex (GPT-6.2-Sol) <noreply@openai.com> Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
Fixes eclipse-threadx#771 The pointer creation services had native entry points only. Modules need to carry the callback and context through the manager dispatch ABI and run the callback in module context. Added module requests for both services. The module thread shell calls the typed entry with its original argument. The timer path snapshots the callback and context and queues delivery to the module callback thread. The option preserves existing member offsets and increases the sizes of enabled thread, timer, and module entry structures. Linux covered 146/146 changed kernel lines and 56/56 branches. Cortex-M4 QEMU covered 83/83 changed shared module lines and 16/16 branches. Cortex-M3/M4 passed 20/20 QEMU tests, including M4 ISR timers. Cortex-R52 and Cortex-A35 UP/SMP manager builds passed. FreeRTOS passed 6/6 tests across both option settings. Assisted-by: Codex (GPT-6.2-Sol) <noreply@openai.com> Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
The generated Cortex-M3, M4, and M7 module shells dispatched pointer thread entries, but the ARMv7-M sources still used the scalar call. Applied the same dispatch to the four toolchain sources. Regenerating the 12 ports with the module copy script produced identical files. Assisted-by: Codex (GPT-6.2-Sol) <noreply@openai.com> Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
Contributor
|
@Dev10-sys Thanks for adding the pointer-context APIs. I kept I left the build-wide aliases in #772 for separate evaluation. The aliases caused compile errors at five FreeRTOS compatibility call sites that use All nine CI workflows passed on |
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #771
On ports with 64-bit addresses and a 32-bit
ULONG, passing a pointer through the scalar argument to a thread entry or timer callback can truncate the address.Added
tx_thread_create_ptrandtx_timer_create_ptrfor ThreadX, ThreadX SMP, and loadable modules. SetTX_ENABLE_POINTER_CONTEXTconsistently when building the kernel, applications, and modules. The option appends callback storage and preserves the offsets used by port assembly. Module thread reset restores the saved module stack and user mode.Cortex-M3 and Cortex-M4 passed 20/20 QEMU tests, including ISR timer processing. A host test verified full-width arguments using the A35 module ABI. Coverage was 146/146 changed lines and 56/56 branches in the shared kernel code, and 83/83 lines and 16/16 branches in the shared module code. All nine CI workflows passed.