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
smlng
0d4855c256 core: fix osx compile issue 2017-02-01 09:06:48 +01:00
Oleg Hahm
c5abb08316 Merge pull request #4058 from daniel-k/pr/gdb_threads_openocd
cortex_m: Add debug symbols for OpenOCD/GDB thread support
2017-01-25 17:49:42 +01:00
daniel-k
9d403d95ce cortex_m: Add debug symbols for OpenOCD/GDB thread support 2017-01-16 20:50:35 +01:00
Joakim Nohlgård
0ba6c9f3a4 core/sched: Use xtimer ticks for sched statistics 2016-11-28 11:00:42 +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
25a6ef5273 core: sched: mark sched_run() as used 2016-08-29 13:30:17 +02:00
d86c141842 core, tests: adapt to changed clist function names 2016-07-18 16:20:40 +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
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
085383bfae core: remove hwtimer, switch schedstatistics to xtimer 2015-09-16 10:58:51 +02:00
Joakim Gebart
555085acdc core/sched: Add missing inttypes.h include when debugging. 2015-07-07 00:53:26 +02:00
Joakim Gebart
13832d8e62 everything: Remove filename from @file Doxygen command 2015-05-22 07:34:41 +02:00
c944d54171 core: log: introduce logging API 2015-05-17 21:49:22 +02:00
René Kijewski
310ea35018 Don't evaluate inISR() if not needed 2014-12-11 17:39:17 +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
Ludwig Ortmann
86189d600e core: remove remaining dINT occurences 2014-12-04 17:17:24 +01:00
Ludwig Ortmann
e4fec18bdc core/sched: unify DEBUG text syntax, nomenclature 2014-11-11 17:55:09 +01:00
René Kijewski
12d157247c core: sched.c did not compile with DEBUG=1 2014-11-07 12:45:12 +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
c0ce346a12 cppcheck: don't needlessly assign sched_active_pid 2014-10-23 20:50:31 +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
René Kijewski
1df0b5644a core: sched_switch only switch for higher priority
sched_switch() is called by some library functions when a call unblocks
another thread. Then it needs to be tested if the current thread should
be preempted for the newly runnable thread.

A non-volutarily yield should only happen if the unblocked thread has a
_higher_ priority than the current thread. The current implementation,
which tests if the other thread has the same or a higher priority, does
not fit the documentation.
2014-09-25 10:16:33 +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
427a5fbaef core: let valid PIDs start with 1 2014-08-17 19:51:03 +02:00
Oleg Hahm
c2b0423918 core: renamed KERNEL_PID_NULL to KERNEL_PID_UNDEF
As @authmillenon pointed out the "null" in the old name is somewhat
misleading, since the actual value is -1.
2014-08-07 16:31:27 +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
Ludwig Ortmann
b6846e31fc doc: fix most occurences of FU as an author
.. but only if there are other authors as well
2014-07-29 17:23:11 +02:00
Ludwig Ortmann
a585eaf752 core/sched: remove MODULE_NSS helpers (API CHANGE)
remove thread_getlastpid and last_pid from the API, it is unused
2014-07-12 07:30:31 +02:00
Ludwig Ortmann
147c285365 core/sched: fix pid/tcb & refactor SCHEDSTATISTICS
pid and tcb_t were compared instead of pid and pid

SCHEDSTATISTICS:
- reduce hwtimer_now calls
- dont use thread_last_pid anymore
- increase readability
2014-07-12 07:29:52 +02:00
Ludwig Ortmann
9cabdb3043 core/sched: clean up
- remove stray spaces
- remove TODOs:
    - MODULE_HWTIMER is not a module anymore
    - checking for NULL is necessary, at least without API changes:
      `sched_task_exit` sets `sched_active_thread` to `NULL`, then exits,
      afterwards `cpu_switch_context_exit` calls `sched_run`
2014-07-12 06:51:51 +02:00
René Kijewski
a21c3f45bc core: remove unnecessary tests in sched.c
The scheduling gets activated by `kernel_init()` calling
`cpu_switch_context_exit()`. Before this `sched_run()` won't be called.
When it gets called, at least the main thread and the idle thread are
spawned. The idle thread won't die / get killed. So there always is at
least one thread in `runqueue_bitcache`.

Closes #19.
2014-06-10 17:04:39 +02:00
René Kijewski
05a4bf7f04 Merge pull request #1057 from Kijewski/sched_switch-current_prio
core: imply current_prio in `sched_switch()`
2014-06-03 15:59:23 +02:00
Martin Lenders
2362623490 Fix trailing whitespaces
Fixes #1138
2014-05-26 14:54:23 +02:00
René Kijewski
a6fd5bff92 core: imply current_prio in sched_switch()
There is no need to supply the current priority to `sched_switch()`,
when this function can easily tell the value of
`active_thread->priority` itself.
2014-05-24 16:48:35 +02:00
Oleg Hahm
ef5ec344fd core: prefix API functions correctly
Also changed names for bitarithm functions and rename thread_pid to sched_active_pid.
2014-05-18 08:53:20 +02:00
Oleg Hahm
5d7f7dd686 Merge pull request #1079 from BytesGalore/add_NORETURNs
core: and cpu: Added NORETURN to functions that should not return
2014-05-16 00:33:20 +02:00
René Kijewski
9a9caf2c68 Exterminate old-style function definitions 2014-05-12 21:57:09 +02:00
Hauke Petersen
608afc4777 Introduced a cleaned-up cpu/core interface
- Included a collection of cpu-dependent headers in core/include/arch
- Extracted all interfaces that need to be implemented for a cpu
- Created a mapping between those interfaces and the old ones
- added flag for disabling arch interface
- added missing state to lpm_arch interface
- added arch interface for reboot
- fixed newline issues that were pointed out
- documentation fixes to cpu-core interface
2014-05-09 16:01:13 +02:00
Martin
4e73169b38 added NORETURNs to functions that should not return
and added `UNREACHABLE();` to hint the compiler unreachable lines

added right signature for first parameter of `thread_stack_init()`
added `UNREACHABLE();` macro to `cpu/lpc1768/atom.c` and `cpu/msp430-common/cpu.c`
2014-05-08 06:25:25 +02:00
Oleg Hahm
25a2122f83 core: documentation: updated, improved, and completed doxygen comments 2014-05-05 14:09:01 +02:00
René Kijewski
83988b2d03 Merge pull request #725 from kaspar030/optimize_thread_status_usage
core: sched: thread: optimize thread status field usage
2014-03-05 17:30:31 +01:00