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

90 Commits

Author SHA1 Message Date
Jim O'Brien
bd149e7db9 thread: Add THREAD_NAMES make flag
Separate thread names from DEVELHELP so thread names can be
enabled in non-development/debug builds when required/desired.
THREAD_NAMES will be enabled by default then DEVELHELP is set to 1.
2020-09-10 10:08:27 +02:00
Keith Packard
531050ada2 picolibc: Enable TLS support [v4]
Allocate and initialize a thread-local block for each thread at the
top of the stack.

Set the tls base when switching to a new thread.

Add tdata/tbss linker instructions to cortex_m and risc-v scripts.

Signed-off-by: Keith Packard <keithp@keithp.com>

---

v2:
	Squash fixes

v3:
	Replace tabs with spaces

v4:
	Add tbss to fe310 linker script
2020-08-24 08:26:16 -07:00
Marian Buschsieweke
57264c5059
core: Access internal vars via helper funcs
Replace accesses to `sched_active_thread`, `sched_active_pid`, and
`sched_threads` with `thread_get_active()`, `thread_get_active_pid()`, and
`thread_get_unchecked()` where sensible.
2020-08-06 16:47:33 +02:00
Marian Buschsieweke
315cdcdb5f
core/thread: Make thread_get inlineable 2020-08-05 10:51:16 +02:00
8efe5960aa core: uncrustify 2020-03-30 17:02:08 +02:00
JulianHolzwarth
ebe1bf1889 core/thread.c:thread_zombify always enables interrupts before yield 2020-02-05 18:00:13 +01:00
JulianHolzwarth
2655c97fd5 core/thread.c: new function for zombie state 2019-12-11 16:48:31 +01:00
JulianHolzwarth
fbf6a665e1 core/thread.c: change thread_getstatus return type
thread_status_t instead of int
2019-10-15 15:55:05 +02:00
JulianHolzwarth
1d16b3d5dc core/thread.c: thread_create fix priority type
Bugfix: changing type of priority to uint8_t to be consistent with struct _thread
2019-09-11 17:42:48 +02:00
87c72a8fe1 core/thread: unify thread_t variable naming
thread_t variables were named t, other_thread, cb. For consistency sake,
change all occurences to just "thread".
2019-05-11 11:39:32 +02:00
Marian Buschsieweke
4c3e92f183
core: Made thread state an enum
- Introduced enum type `thread_state_t` to replace preprocessor macros
- Moved thread states to `sched.h` for two reasons:
  a) Because of the interdependencies of `sched.h` and `thread.h` keeping it in
     `thread.h` would result in ugly code.
  b) Theses thread states are defined from the schedulers point of view, so it
     actually makes senses to have it defined there
2019-02-13 13:31:52 +01:00
e6a9a760a7 core/thread: add thread_getname() dummy available without DEVELHELP 2018-01-15 14:37:04 +01:00
Ian Martin
28a7ddc9a8 core: save the stack_start in the thread context for mpu_stack_guard 2016-10-24 12:36:15 -04:00
d86c141842 core, tests: adapt to changed clist function names 2016-07-18 16:20:40 +02:00
dc8f55df7e core: msg: use new list instead of priority_queue 2016-04-10 00:16:48 +02:00
58a12e5034 core: make messaging optional 2016-03-30 23:27:09 +02:00
f9f6adb48d core: clist: make singly linked 2016-03-30 00:27:49 +02:00
7c39134d5d core: introduce intrusive singly linked list 2016-03-29 21:50:17 +02:00
DipSwitch
0bb4748a94 core: Fix/refactor function naming in core/incude/irq.h 2016-03-20 16:47:34 +01:00
IldarValiev
4f5bea7d99 core: thread: Added stack size validation 2016-03-07 18:56:51 +05:00
IldarValiev
bad2b5c187 core: thread: Added validation of pid 2016-03-07 18:56:47 +05:00
2b010b5337 core: rename tcb_t -> thread_t, move into thread.h 2016-03-05 18:20:17 +01:00
9082273746 core: header cleanup 2016-02-28 22:46:28 +01:00
Hauke Petersen
cf53aeddd8 Merge pull request #4382 from haukepetersen/rm_core_flagsh
core: move thread flags from flags.h to thread.h
2015-12-08 11:36:43 +01:00
Hauke Petersen
22428f6cfb core: adapted to renamed THREAD_FLAGS 2015-12-07 22:09:46 +01:00
Oleg Hahm
a82835a72b core: mute compiler warning 2015-12-07 20:28:52 +01:00
Ian Martin
2579e64e9f core: fix stack test when SCHED_TEST_STACK=1 but DEVELHELP=0 2015-09-22 11:59:21 -04:00
085383bfae core: remove hwtimer, switch schedstatistics to xtimer 2015-09-16 10:58:51 +02:00
ximus
5f422a9d07 Fix write of thread stack end marker
Only the lower half of the stack end marker is being writtem
to the stack buffer end.
2015-06-12 16:02:40 -07:00
Joakim Gebart
13832d8e62 everything: Remove filename from @file Doxygen command 2015-05-22 07:34:41 +02:00
Ludwig Ortmann
0adba81d2e core/thread: use disableIRQ/restoreIRQ 2014-12-03 20:45:00 +01:00
feb550f17a Merge pull request #1885 from OlegHahm/thread_yield_higher_cleanup
core: thread_yield_higher cleanup
2014-10-30 23:22:27 +01:00
Oleg Hahm
9a61d8cf1c core: move optional tcb members to DEVELHELP 2014-10-30 16:37:10 +01:00
Oleg Hahm
93ac114bc3 core: move thread_yield*() to thread.[ch]
Although it might conceptionally rather belong to the scheduler, the
yield functions are prefixed with thread_ and thus, belong there.
2014-10-28 00:56:37 +01:00
Ludwig Ortmann
eceb656c49 core,sys: fix storage types for irq API usage
* should not have any effect as long as `unsigned` and `int` are compatible
* also fix two cosmetic `unsigned int` -> `unsigned` for consistency
2014-10-27 16:25:23 +01:00
Oleg Hahm
9b819c4dd6 Merge pull request #1836 from Kijewski/yield-less
core: introduce sched_yield(), yield less
2014-10-24 10:05:37 +02:00
René Kijewski
677d690e2b core: introduce thread_yield_higher(), yield less
Fixes #1708.

Currently involuntary preemption causes the current thread not only to
yield for a higher prioritized thread, but all other threads of its own
priority class, too.

This PR adds the function `thread_yield_higher()`, which will yield the
current thread in favor of higher prioritized functions, but not for
threads of its own priority class.

Boards now need to implement `thread_yield_higher()` instead of
`thread_yield()`, but `COREIF_NG` boards are not affected in any way.

`thread_yield()` retains its old meaning: yield for every thread that
has the same or a higher priority.

This PR does not touch the occurrences of `thread_yield()` in the periph
drivers, because the author of this PR did not look into the logic of
the various driver implementations.
2014-10-24 00:09:56 +02:00
Oleg Hahm
db8f3d2650 cpu: use typed function pointer for thread_arch_init 2014-10-23 18:26:21 +02:00
René Kijewski
862000b715 core: align stack on a 32bit boundary
Fixes #1267.
2014-10-17 18:22:37 +02:00
Ludwig Ortmann
2fe2a39602 core: refactor check for valid pid
move into header and remove redundant condition
2014-10-13 19:44:35 +02:00
003dd1969c Merge pull request #1566 from Kijewski/undef_is_null
core: let PIDs begin with 1
2014-08-22 00:43:04 +02:00
René Kijewski
a5c9d4572d core: clist without explicit thread
Right now the core component `clist` is a generic cyclic doubly-linked list.
In the core it is used in `tcb_t::rq_entry`.
Further it is used `net_if.c`.

This commit removes the member `clist_node_t::data` which stored the
pointer to the `tcb_t` instance of which the clist is already a member.
The needless member added `sizeof (int)` bytes to every instance of
`tcb_t`.

In `net_if.c` the clist was used in a type-punned way, so that the
change won't affect it.
2014-08-21 21:10:04 +02:00
René Kijewski
2cb4166c3e all over the place: use sched_active_pid
In many places we needlessly use `sched_active_thread->pid` whilst we
already have `sched_active_pid` with the same value, and one less
indirection.

`thread_getpid()` is made `static inline` so that there is no penalty in
using this function over accessing `sched_active_pid` directly.
2014-08-17 21:04:25 +02:00
René Kijewski
b31e5a8675 core: introduce KERNEL_PID_FIRST and KERNEL_PID_LAST 2014-08-17 19:50:34 +02:00
René Kijewski
a7e5157fd9 core: add thread_get()
Remove PID check duplication in `thread_getstatus()` and
`thread_getname()`.
2014-08-15 01:16:13 +02:00
René Kijewski
f7bdc7e4fe core: thread_measure_stack_free() is only useful for DEVELHELP 2014-08-02 00:35:41 +02:00
René Kijewski
9e3830a72b core: only store the stack size for DEVELHELP
`tcp_t::stack_size` is only examined by the shell command `ps` and
`DEBUG_PRINT`. For the latter one only if `DEVELHELP` was enabled.

This PR guards the member `tcp_t::stack_size` in `#ifdef DEVELHELP`.
Only if DEVELHELP was activated its value get printed by `ps`.

Closes #1287.
2014-08-02 00:35:41 +02:00
Oleg Hahm
983d056c75 core: harmonizes the data type for the process ID
Instead of using differing integer types use kernel_pid_t for process
identifier. This type is introduced in a new header file to avoid
circular dependencies.
2014-08-01 12:02:54 +02:00
Ludwig Ortmann
3ca4f18479 doc: use lgplv2.1-short license header instead of lgpl-short-riot 2014-07-31 22:57:20 +02:00
René Kijewski
4032a22719 queue: add queue_t root type 2014-07-30 21:10:22 +02:00