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
SimonIT
d778e2eb5f
core: Express -1 as ~0 in thread_status_t cast 2023-10-15 23:54:16 +02:00
Benjamin Valentin
8100203e95 core/thread, mutex: provide dummy implementation for riotboot
This is intended for the bootloader module where we don't enter thread
mode, so mutex must never attempt to switch context.

Instead use a simple busy wait that is enough to make the possible mutex
users (e.g. interrupt based SPI) in bootloader mode work.
2022-05-02 13:18:39 +02:00
benpicco
5a57dec71a
Merge pull request #17093 from maribu/core/change_prio
core/sched: add sched_change_priority()
2022-01-28 20:01:20 +01:00
Martine Lenders
f08989a3c8
core: make SCHED_TEST_STACK boolean and default to 1 with DEVELHELP 2021-11-05 09:27:00 +01:00
Hauke Petersen
3d7d797a57
core/sched: add sched_change_priority() function
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2021-11-02 20:44:32 +01:00
Karl Fessel
3508012942 core/sched: name inspection functions the same as the used clist fns 2021-08-09 14:18:18 +02:00
Karl Fessel
9f00528a58 core/sched: add runq_callback hook and runq inspection functions 2021-05-10 15:01:58 +02:00
Karl Fessel
1dde0f42d4 core/sched: keep scheduler clist internal to sched
adds sched_runq_advance(prio)
used it in core/thread and
test malloc_thread_safety
2021-04-14 09:53:04 +02:00
7fa8b69912 core: include inttypes.h in sched.h
sched.h now defines PRIkernel_pid to PRIi16, which in turn is defined in
inttypes.h.
2020-11-23 16:56:34 +01:00
369e9b30e2 core: move scheduler defines to sched.h 2020-11-23 16:56:34 +01:00
Marian Buschsieweke
2d8bdf9b83
core/sched: Drop declaration of sched_active_{pid,thread}
This should increase odds that developers use thread_get_active() and
thread_getpid() instead.
2020-09-07 12:59:55 +02:00
495644adc0
sched: return the new thread on sched_run 2020-09-02 13:32:14 +02:00
Benjamin Valentin
4d34cee72f core: add comments to symbols used by OpenOCD
OpenOCD makes assumptions about those symbol names / enum entries,
so add a note about it as a comment.
2020-07-27 16:14:42 +02:00
e3f6c0f340 core: make idle thread optional 2020-06-25 16:02:28 +02:00
c4b4e66422
sched_cb: Add function documentation 2020-06-23 15:40:57 +02:00
8efe5960aa core: uncrustify 2020-03-30 17:02:08 +02:00
Karl Fessel
4445faaa3a core/shed: remove not needed bitarithm include add missing
bitarithm.h is not needed for the interface of shed but may cause conflicts
due to different definitions of SETBIT and CLRBIT

common implementations are: (value, offset) xor (value, mask) bitarithm
implements the later

frac.c and nrf52/usbdev.c use bitarithm.h but where missing the include

sam0/rtt.c defined a bit using mask from bitarithm,
changed that to the soulution used in sam0/rtc.c
2020-02-05 12:45:29 +01:00
JulianHolzwarth
6b0156eac5 core/include/sched.h: new thread_status_t thread state 2019-12-11 15:44:59 +01:00
9dfcabf0d8 core: fix typos 2019-11-23 22:39:38 +01:00
Francisco Molina
1caf6610cb sys: add schedstatistics module 2019-09-13 11:37:44 +02:00
Francisco Molina
fc58ebbd97 core/sched: separate sched_cb from schedstatistics 2019-09-10 17:08:21 +02:00
francisco
3d62fa05b8 core/schedstatistics: refactor
- add init_schedstatistics function to be called after
  auto_init, that way xtimer_is init is called before
  the first call to xtimer_now
- register schedstatics code as a callback to be executed
  on each sched_run()
2019-09-10 17:07:54 +02:00
Martine Lenders
db20a057ae core: rename thread_state_t to thread_status_t
This way it can't come to name collisions on `native` with Mac OSX'
threading library [1].

[1]: https://opensource.apple.com/source/xnu/xnu-792/osfmk/mach/thread_status.h.auto.html
2019-05-11 12:25:07 +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
Joakim Nohlgård
5b68bbb2cf core: Rename typedef schedstat -> schedstat_t
To follow naming conventions
2018-10-26 09:10:21 +02:00
smlng
e7136e2dde schedstats: revert #6975, use 32Bit again 2017-06-08 14:33:47 +02:00
0fcc7d3834 cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
Vincent Dupont
6d5b95517d ps: fix schedstatistics
Fix xtimer_now() usage and fix columns alignment in ps command when
module schedstatistics is used.
2017-05-16 10:33:42 +02:00
f9f6adb48d core: clist: make singly linked 2016-03-30 00:27:49 +02:00
DipSwitch
0bb4748a94 core: Fix/refactor function naming in core/incude/irq.h 2016-03-20 16:47:34 +01:00
Oleg Hahm
bdcf8879fd core: merged kernel_macros.h and attributes.h
Merged into new kernel_defines.h and updated all includes.
2016-03-09 22:29:06 +01: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
6fc26f8d18 core: fixed include guards for selected headers 2015-12-02 11:08:23 +01:00
085383bfae core: remove hwtimer, switch schedstatistics to xtimer 2015-09-16 10:58:51 +02:00
Joakim Gebart
13832d8e62 everything: Remove filename from @file Doxygen command 2015-05-22 07:34:41 +02:00
Joseph Noir
bddaee751d Add replacement headers for thread, mutex and cond
These headers do not provide full stl functionality,
but a small subset:
* thread and this_thread
* condition_variable (some timed functions are missing)
* mutex, lock_guard and unique_lock
2015-05-18 13:57:02 +02:00
Ludwig Ortmann
cec87139a5 core, cpu, drivers, tests: remove trailing space 2015-02-18 13:52:48 +01:00
René Kijewski
370f926bad core: sched_switch() switch if not on runqueue
Fixes #1935.

`sched_switch()` should not only switch if the other priority is higher,
but also if the current thread was moved from the runqueue.
2014-12-11 17:39:17 +01:00
Oleg Hahm
5adb43cc75 doc: add some references 2014-12-04 16:50:21 +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
René Kijewski
9ddbf57709 core: refactor sched_run
`sched_run()` was cluttered. Many individual changes were done without a
proper refactoring.
2014-10-30 21:00:09 +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
Oleg Hahm
6f53cd484d core: make sched_runqueue public
Reverting b604832, because thread_yield() needs to access this
information.
2014-10-28 00:56:14 +01: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
René Kijewski
b604832777 core: make sched_runqueues static
PR #1000 overlooked to rename `runqueues` into `sched_runqueues` in
 `sched.h`. This shows that the variable is not used outside of
 `sched.c`.

 As the list should not be accessed outside of the scheduler, so it
 can be `static`.
2014-10-22 16:55:50 +02:00
BytesGalore
74161f0f2d core: moved #includes outside the extern "C" guards 2014-10-21 13:46:04 +02:00
Pham Huu Dang Nhat
2ded32dee7 c++: core: add extern C in header files 2014-10-09 06:18:16 +07:00
Ludwig Ortmann
b7992922ce fix license headers in non-.c files 2014-08-23 16:16:26 +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