The previous implementation relied on `thread_flag_set()` to defer the
context switch when called with IRQs disabled until `irq_restore()` is
called. This however can only be the case when `thread_yield_higher`
triggers an IRQ and performs the context switch within the ISR. This
allowed the previous implementation to continue calling
`thread_flag_set()` for the remaining group members.
This however is an implementation detail that is not part of the API
contract. Platforms that do not have a service request IRQ may have to
use other means for context switching that do not get deferred until
an `irq_restore()` is called. In that case, the first call to
`thread_flags_set()` even with IRQs disabled may directly trigger a
context switch to the unblocked thread, even if other group members
would also be unblocked and have a higher priority.
This changes the implementation to manually set the flags and update
the thread status without yielding and keep track whether any thread
has been awoken. Only once the states of all threads have been updated,
the adapted implementation will now call `thread_yield()` (unless no
thread was awoken).
All uses of thread_flags_wake() also had to set the flags anyway, so
we can just combine those operations into a new
thread_flags_set_internal() and update the users to use that instead.
Running `BUILD_IN_DOCKER=1` in an application folder outside of RIOT
created empty `1` folders by adding
-v '<path/to/external/app>/1:/data/riotbuild/0:delegated' -e 'BUILD_IN_DOCKER=/data/riotbuild/0'
to the docker command line.
This changes the invocation to add just `-e 'BUILD_IN_DOCKER=0'` instead.
GCC requires symbols to first be declared before they can be renamed.
So we move the `#pragma redefine_extname` just to the bottom of the
compilation unit.
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: Mikolai Gütschow <mikolai.guetschow@tu-dresden.de>
Another endpoint that was forgotten to overwrite. This fixes the
output of the `i2c_scan` shell command that is e.g. included in the
test app in `tests/periph/i2c`.
On 8-bit and 16-bit platforms `uint32_t` is wider than `void *`, as
pointers are (typically) only 16 bit in size. This causes output like:
Message queue of thread 2
size: 8 (avail: 8)
* 0: sender: 2, type: 0x0000, content: 2701197312 (0)
* 1: sender: 2, type: 0x0001, content: 2701197313 (0x1)
As seen here, the leading two bytes of `msg.content.value` contain
"random" bits, as those bytes are not explicitly initialized.
This fixes the issue by explicitly initializing the whole `msg_t` via
an initializer list.
Reduce size of list nodes to sort to 64 on 8 bit and 16 bit systems
to reduce the time the test takes. On 8 bit systems sorting 256 list
items a thousand times takes more than 2 minutes, which is way above
the 30 seconds timeout the test waits to receive the next expected
output.
Starting from clang 21 (see [release notes][1]) clang also supports
`-Wunterminated-string-initialization` and the corresponding
`__attribute__((nonstring))`. Hence, also provide `NONSTRING` as the
corresponding `__attribute__((nonstring))` for clang starting with
clang version 21.
[1]: https://releases.llvm.org/21.1.0/tools/clang/docs/ReleaseNotes.html
The test data is not intended to be a zero terminated C string. Just
a bunch of bytes that are easy to trace with a logic analyzer, in
case someone as to debug a test failure.
Until now OpenThread CLI and RIOT shell could not be used at the same
time. Now it is possible to use all CLI command with the prefix "ot". To
get an overview use "ot help".