arch, sched/signal: Fix compilation with ENABLE_PARTIAL_SIGNALS=y#19116
Conversation
dd35b7a to
f876eff
Compare
f876eff to
9a98865
Compare
|
@xiaoxiang781216 : I believe all the options are now properly working (ENABLE_ALL_SIGNALS, ENABLE_PARTIAL_SIGNALS and DISABLE_ALL_SIGNALS). I have been running these on qemu and stm32f7 real hw. The signal wakeup path didn't work with PARTIAL_SIGNALS at all, also there were build errors in DISABLE_ALL_SIGNALS. So hopefully it is more proper now... All signal actions (signal handlers) have been disabled in CONFIG_ENABLE_PARTIAL_SIGNALS, but basic signal delivery & wakeup works. I also made a PR in apps/ostest, so that it is actually possible to test these different signal configurations. |
|
There was incomplete flagging for CONFIG_DISABLE_ALL_SIGNALS in the button driver, added that into this same PR. I also disabled the signals support from the one FOC board, where flash was overflowing. The signals are not used in foc demo, it only reads (samples) the buttons, so this is fine. And the signals didn't work in CONFIG_ENABLE_PARTIAL_SIGNALS (default for CONFIG_DEFAULT_SMALL) anyways before this commit, so nothing actually changed. |
This small board doesn't use the signals, so it is safe to disable them to save flash. Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
…_SIGNALS The optional signal delivery should be disabled when signals support is disabled for the board. Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
d249031 to
da6ad52
Compare
|
@jlaitine please squash the last three patches into one, and remove the check of CONFIG_DISABLE_ALL_SIGNALS from nuttx/libs/libc/pthread/pthread_mutex_destroy.c |
da6ad52 to
fd0219c
Compare
76c4ac7 to
0cb3262
Compare
|
@xiaoxiang781216 : I addressed your review requests, thank you for thorough reviews. Current version is now re-tested with qemu armv8 in all signal configuration modes, and the original compilation issues are fixed in protected mode as well. |
0cb3262 to
2f91b55
Compare
2f91b55 to
86cb0b7
Compare
Correct build errors when CONFIG_ENABLE_ALL_SIGNALS is not defined - sched makefiles: Move pending-signal helpers from the ENABLE_ALL_SIGNALS-only list to the !DISABLE_ALL_SIGNALS list so signal dispatch is available in PARTIAL builds sched: make SIG_PREALLOC_ACTIONS, SIG_ALLOC_ACTIONS and SIG_DEFAULT depend on ENABLE_ALL_SIGNALS - sched: fix ifdefs around pending-signal queue access and signal-mask for PARTIAL/DISABLE modes - arch: gate SYS_signal_handler / _return calls and SYSCALL_LOOKUP(signal) with ENABLE_ALL_SIGNALS Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
86cb0b7 to
d8e54e0
Compare
Summary
Correct build errors when CONFIG_ENABLE_ALL_SIGNALS is not defined
The current master doesn't compile for CONFIG_BUILD_PROTECTED with the following setup:
The first errors occur from the svcall:
Fixing that, leads to linker errors with undefined symbols with "nxsig_unmask_pendingsignal" etc.
There are reasons why it compiles for CONFIG_BUILD_FLAT (partially by luck, perhaps partially by design):
The two commits in this PR fix the compilation, and also correct the functionality in CONFIG_ENABLE_PARTIAL_SIGNALS. With that flag, signal actions are now disabled, but simple signal delivery and wakeup works.
Impact
No impact on any of the current boards; the ENABLE_FULL_SIGNALS is enabled on !DEFAULT_SMALL, and for all the DEFAULT_SMALL boards currently in mainline, the full signals are enabled explicitly in defconfig.
Testing
Tested the compilation and partial signals using a custom application, with the partial signal configuration, with protected and flat builds. With the fixes, the code builds and runs properly. Without the fix, the build and link errors mentioned in the description, occur on protected build.
The ENABLE_FULL_SIGNALS, ENABLE_PARTIAL_SIGNALS and DISABLE_ALL_SIGNALS configurations have been tested on ostest on qemu-armv8a, together with PR apache/nuttx-apps#3538. The logs are in that PR.
Here is an ostest logfile from stm32f7 real hw, using ENABLE_PARTIAL_SIGNALS
ostest_pixhawk4_partial_signals.txt