1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 01:09:47 +01:00
Commit Graph

1061 Commits

Author SHA1 Message Date
Mikolai Gütschow
850a827c24
core/msg: re-enable IRQs before printing for highlevel_stdio
copy message queue information to stack before
2024-11-28 12:49:11 +01:00
benpicco
77c4a24bcf
Merge pull request #20938 from derMihai/mir/fix_runqueue_pop
core/sched.c: fix _runqueue_pop() removing wrong thread
2024-11-14 12:05:45 +00:00
Mihai Renea
ba71ba72a3 core/sched.c: fix _runqueue_pop() removing wrong thread 2024-11-14 11:05:40 +01:00
benpicco
d65dec6ab5
Merge pull request #20960 from maribu/build_system/xfa/fix-alignment
build_system/xfa: change API to fix alignment
2024-11-07 16:16:28 +00:00
Marian Buschsieweke
2b6f65a08a
build_system/xfa: change API to fix alignment
This changes the API of xfa from

    XFA(array_name, prio) type element_name = INITIALIZER;

to

    XFA(type, array_name, prio) element_name = INITIALIZER;

this allows forcing natural alignment of the type, fixing failing tests
on `native64`.
2024-11-07 16:30:01 +01:00
Benjamin Valentin
46ecf82e24 core/mutex: add mutex_init_locked() 2024-11-06 12:53:17 +01:00
mguetschow
a54ba26285
Merge pull request #20893 from benpicco/THREAD_CREATE_STACKTEST-cleanup
treewide: clean up remnants of THREAD_CREATE_STACKTEST
2024-10-08 09:55:52 +00:00
Benjamin Valentin
97128eef48 treewide: clean up remnants of THREAD_CREATE_STACKTEST 2024-10-07 17:31:31 +02:00
Marian Buschsieweke
1d99f4f758
core/mutex: use thread_yield_higher() in mutex_unlock()
Using `sched_switch()` in `mutex_unlock()` can result in crashes when
`mutex_unlock()` is called from IRQ context. This however is a common
pattern in RIOT to wake up a thread from IRQ. The reason for the crash
is that `sched_switch()` assumes `thread_get_active()` to always return
a non-`NULL` value. But when thread-less idle is used, no thread may be
active after the last runnable thread exited. Using
`thread_yield_higher()` instead solves the issue, as
`thread_yield_higher()` is safe to call from IRQ context without an
active thread.

This fixes https://github.com/RIOT-OS/RIOT/issues/20812
2024-10-05 22:02:28 +02:00
benpicco
41204c8b81
Merge pull request #20450 from benpicco/THREAD_CREATE_STACKTEST-delete
core/thread: always use THREAD_CREATE_STACKTEST when DEVELHELP is enabled
2024-07-29 11:52:06 +00:00
Benjamin Valentin
0fbc10fb45 core/thread: introduce THREAD_CREATE_NO_STACKTEST 2024-07-29 11:45:58 +02:00
Benjamin Valentin
312a550f1a treewide: remove THREAD_CREATE_STACKTEST from thread creation 2024-07-29 11:45:58 +02:00
Benjamin Valentin
b1d3825c27 core/thread: always use THREAD_CREATE_STACKTEST with DEVELHELP 2024-07-29 11:45:58 +02:00
Benjamin Valentin
3237ed911e core/panic: don't use LOG_ functions in panic handler 2024-07-17 16:18:19 +02:00
Marian Buschsieweke
70f5747712
core/native_shed: Fix compilation with musl
On musl, `spu_set_t` is provided by system headers, so only provide
that with glibc.
2024-06-05 21:57:43 +02:00
Marian Buschsieweke
11e273c4db
core/thread: "fix" valgrind erros in thread_measure_stack_free()
The dark magic used used in thread_measure_stack_free() is frowned upon
by valgrind. E.g. valgrind may deduce (by monitoring the stack pointer)
that a specific value was at some point allocated on the stack, but has
gone out of scope. When that value is now read again to estimate stack
usage, it does look a lot like someone passed a pointer to a stack
allocated value, and that pointer is referenced after that value has
gone out of scope.

This is "fixed" by temporarily disabling valgrind error reporting while
iterating over the stack.
2024-06-05 14:31:58 +02:00
Benjamin Valentin
02fe256a06 core/thread: don't try to align end of stack 2024-06-04 16:57:05 +02:00
Marian Buschsieweke
e93b5e4b98
core/thread: fix thread_measure_stack_free()
`thread_measure_stack_free()` previously assumed that reading past the
stack is safe. When the stack was indeed part of a thread, the
`thread_t` structure is put after the stack, increasing the odds of
this assumption to hold. However, `thread_measure_stack_free()` could
also be used on the ISR stack, which may be allocated at the end of
SRAM.

A second parameter had to be added to indicate the stack size, so that
reading past the stack can now be prevented.

This also makes valgrind happy on `native`/`native64`.
2024-05-31 19:54:10 +02:00
Mikolai Gütschow
d5d5e9f602
core/lib/assert: consistify output and cleanup documentation 2024-05-27 17:12:49 +02:00
Marian Buschsieweke
2e9ce4d6b4
Merge pull request #20633 from dylad/pr/cpu/cortexm33/add_splim_support
cpu/cortexm: add stack limit support for Cortex-M33
2024-05-06 17:05:20 +00:00
Dylan Laduranty
683d4a249d cpu/cortexm: add stack limit support for CM33
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-05-06 17:14:49 +02:00
benpicco
6c154958a3
Merge pull request #20627 from benpicco/assert-zombi
core/assert: halt running thread instead of panic
2024-04-29 09:16:46 +00:00
Benjamin Valentin
731ada03e5 core/assert: halt running thread instead of panic 2024-04-28 01:43:18 +02:00
Benjamin Valentin
9e0a32e011 core/panic: make reboot on panic configurable 2024-04-26 15:44:49 +02:00
Benjamin Valentin
3359f26689 core/assert: move common code to inline function 2024-04-26 14:07:24 +02:00
Marian Buschsieweke
cf6fa4edf0
tree wide: add IWYU pragma: export where needed
We occasionally have some public `foo.h` header that includes a private
`foo_arch.h` header. Users are expected to include the `foo.h` header
and not the `foo_arch.h`. However, clangd will claim that the `#include`
of `foo.h` is unused if only functions / macros/ types / ... from
`foor_arch.h` is used and nothing from `foo.h`.

This adds the `IWYU pragma: export` comment to the include of
`foo_arch.h` in `foo.h`, so that clangd treats functions / macros /
types provided by `foo_arch.h` as if they were instead provided by
`foo.h`, which fixes the false positives.
2024-04-14 14:26:05 +02:00
MrKevinWeiss
1fcdb107ba
core/lib: guard pm_off 2024-04-02 11:47:50 +02:00
Marian Buschsieweke
04620d471c
Merge pull request #20438 from MrKevinWeiss/pr/kconfig/dep/removal
Remove Kconfig dependency modelling
2024-03-27 16:39:56 +00:00
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
benpicco
84bf9215b7
Merge pull request #20508 from Teufelchen1/core/guard_pm
core: Guard pm_set_lowest with module_periph_pm
2024-03-26 23:19:46 +00:00
Teufelchen1
e3da305ae2 core: Guard pm_set_lowest with module periph_pm 2024-03-26 19:56:33 +01:00
Teufelchen
52425330a3
Merge pull request #15485 from miri64/mbox/enh/mbox-unset
mbox: provide function to unset initialized mbox
2024-03-19 13:23:22 +00:00
Martine Lenders
12194ad9e6
mbox: provide function to unset initialized mbox 2024-03-19 12:27:33 +01:00
Joshua DeWeese
b6481654ba core/lib/cib: add several new peek functions
This patch adds calls to be able to peek at items other than just the
oldest item in a cib based FIFO. It also adds an "unsafe" peek to match
the existing "unsafe" put and get functions.
2024-03-18 10:14:34 -04:00
Joshua DeWeese
e2b4e4160a core/lib/cib: apply doc best practice
This patch updates the doxygen comments to follow suggested practice of
using retval.
2024-03-12 12:54:46 -04:00
Benjamin Valentin
deaa17cc27 core/init: set _native_retval to retval of main() 2024-03-04 14:41:20 +01:00
Benjamin Valentin
d39dc587f5 core/init: clean up !core_thread init path 2024-02-16 17:14:57 +01:00
Joshua DeWeese
45c1441e4d macros/utils: add ABS() macro
This patch adds the classic ABS() macro to exist along side of the
MAX/MIN macros.
2024-02-08 09:52:22 -05:00
Joshua DeWeese
78a1a18683 macros/utils: add LIMIT() macro
This patch adds a macro that can be used to limit a value to a given
range.
2024-02-08 09:52:22 -05:00
Frederik Haxel
0c2cfe99e6 native64: Add Linux/x86_64 board
Adds a separate board for native64 instead of the `NATIVE_64BIT` workaround.
The files in `boards/native64` are more or less dummy files and just include
the `boards/native` logic (similar to `openlabs-kw41z-mini-256kib`).
The main logic for native is in `makefiles/arch/native.inc.mk`, `cpu/native`
and `boards/native`.

The remaining changes concern the build system, and change native board checks
to native CPU checks to cover both boards.
2024-02-05 22:01:40 +01:00
Marian Buschsieweke
a1d2089e04
Merge pull request #20253 from maribu/tests/periph/uart_locate_pins
tests/periph/uart_locate_pins: new test/utility app
2024-01-18 11:20:02 +00:00
Marian Buschsieweke
b17b2b0444
core/lib/init: skip boot message if stdio_null is used
With `stdio_null` no one is reading the boot message anyway, so let's
safe some ROM.
2024-01-18 10:42:14 +01:00
Frederik Haxel
394cd0e3a8 sys: 64 bit compatibility
* priority_queue_t: Replaced `-1U` literal with PRIORITY_QUEUE_DATA_SIGNALING define
* architecture.h: Added 64-bit
* bloom.h: Fixed typedef for the hashfp_t function pointer
* vfs.h: Increased default vfs buffer sizes for 64 bit
* bytes.h: Check if socklen_t is already defined
* ztimer: Use PRIxPTR format specifier
2024-01-17 16:05:12 +01:00
Frederik Haxel
cb83a2ea8a core: 64 bit compatibility
Only minor changes are required to make the kernel 64 bit compatible.
Most of the changes are either DEBUG/printf formatting or different types for void pointer casting.

The only other change is the type of the `data` member in priority_queue_node_t, as `data` must be able to store a pointer.
For current architectures, the assumption `sizeof(unsigned int) == sizeof(void *)` holds, but not for 64 bit.
Therefore, the type is changed to `uintptr_t', which has the same size for the current architectures, but can also store a pointer in 64 bits.
2024-01-15 10:16:30 +01:00
benpicco
31da90ea7f
Merge pull request #20246 from benpicco/microkernel
doc/mainpage: don't claim to be a microkernel
2024-01-12 08:37:49 +00:00
Benjamin Valentin
ce36ca50ab core/panic: fix build with !periph_pm 2024-01-11 21:21:30 +01:00
Benjamin Valentin
ca97f8ab2b doc/mainpage: don't claim to be a microkernel
We are clearly not and this just sets wrong expectations.
2024-01-11 16:59:50 +01:00
benpicco
2e3037c3aa
Merge pull request #20240 from benpicco/cpu/atmega-no_thread
cpu/avr8_common: fix build with !core_thread
2024-01-09 22:13:30 +00:00
Benjamin Valentin
b9a76ea094 core/init: avoid context switch with !core_thread 2024-01-09 18:59:28 +01:00
Frederik Haxel
0fe0a6d957 core/mutex: fix debug message for mutex priority inheritance
Fixed wrong variable in debug output in `core/mutex.c` when
using MODULE_CORE_MUTEX_PRIORITY_INHERITANCE.
2023-12-14 16:43:28 +01:00