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

76 Commits

Author SHA1 Message Date
Joakim Nohlgård
e088403ce0 Merge pull request #4082 from daniel-k/pr/msg_reply_missing_irq_restore
core/msg: add missing irq restoration in msg_reply()
2016-03-04 15:59:06 +01:00
daniel-k
4295d028ec core/msg_reply: only assert target tcb, no error handling 2016-03-01 21:34:01 +01:00
9082273746 core: header cleanup 2016-02-28 22:46:28 +01:00
bdfc76a052 core: msg: fix msg_try_receive not checking msg_waiters 2016-02-23 14:43:42 +01:00
Hauke Petersen
7f5ab0cd5f core: moved flags.h to thread.h 2015-12-07 22:09:46 +01:00
DipSwitch
15e8f4e3d1 core: add support to see if there are messages available for the current thread 2015-12-02 09:08:15 +01:00
Oleg Hahm
bb306038ae core: disallow msg_send_receive() on same thread 2015-09-29 12:45:27 +02:00
Oleg Hahm
e15bdd257a debug: replace __FILE__ by RIOT_RELATIVE_FILE 2015-09-20 01:51:47 +02:00
Oleg Hahm
49917a5797 core: cpu: fix check for DEVELHELP 2015-09-12 12:43:15 +02:00
Lucas Jenss
426170b064 Improve naming of thread stacksize/priority constants
As discussed in #2725, this commit renames a number of stacksize constants to
better convey their intended usage. In addition, constants for thread priority
are given a `THREAD_` prefix. Changes are:

* KERNEL_CONF_STACKSIZE_PRINTF renamed to THREAD_EXTRA_STACKSIZE_PRINTF
* KERNEL_CONF_STACKSIZE_DEFAULT renamed to THREAD_STACKSIZE_DEFAULT
* KERNEL_CONF_STACKSIZE_IDLE renamed to THREAD_STACKSIZE_IDLE
* KERNEL_CONF_STACKSIZE_MAIN renamed to THREAD_STACKSIZE_MAIN
* Move thread stacksizes from kernel.h to thread.h, since the prefix changed
* PRIORITY_MIN renamed to THREAD_PRIORITY_MIN
* PRIORITY_IDLE renamed to THREAD_PRIORITY_IDLE
* PRIORITY_MAIN renamed to THREAD_PRIORITY_MAIN
* Move thread priorities from kernel.h to thread.h since the prefix has changed
* MINIMUM_STACK_SIZE renamed to THREAD_STACKSIZE_MINIMUM for consistency
2015-05-21 00:14:23 +02:00
Martine Lenders
4e7a32efc1 core: Allow debug messages without DEVELHELP 2015-04-10 09:15:34 +02:00
René Kijewski
5f29fed076 core: introduce msg_sent_by_int()
msg_send_int() sets `m->sender_pid = target_pid`. This was used to flag a
message as having been sent by an ISR.

This PR introduces a static inline function `msg_sent_by_int()` and a
specific define for this purpose.
2014-12-18 23:04:03 +01:00
Martine Lenders
c0b0110de9 core: Fix msg_send_receive
Fixes #1935
2014-12-03 15:42:37 +01:00
Ludwig Ortmann
b4d9c9e6b7 core/msg: coding convention cleanup 2014-11-25 19:38:36 +01:00
Ludwig Ortmann
535839f2d5 core/msg: use disable/restoreIRQ
* needed to change internal `msg_send` to allow external disabling of interrupts
2014-11-25 19:38:36 +01:00
René Kijewski
ff2a1dc61b core: remove needless test in msg.c
`thread.c` initializes a thread with an empty message queue. `cib_put()`
will `return -1` for an empty CIB, so there is no need to test if
`thread->msg_array != NULL`.
2014-11-14 10:54:33 +01:00
Oleg Hahm
a262de0678 core: always set sender_pid in msg_send_int 2014-11-10 09:29:16 +01:00
René Kijewski
c3ba66781d core: put more intelligence into queue_msg()
Fixes #1942.

There were two instances were it was not checked the target thread has a
message queue before queuing the message.

This PR centralizes the check into `queue_msg()`.
2014-11-07 12:32:15 +01:00
Oleg Hahm
8dab420321 Merge pull request #1835 from OlegHahm/msg_receive_yield
core: msg_receive should yield
2014-11-06 16:27:32 +01:00
Oleg Hahm
4fd3d62f2a core: msg_receive should yield
If a thread sends blocking, but the target thread is not currently in
receive mode, the sender gets queued. If it has a higher priority it
should run again as soon as the target goes into receiving mode.
2014-11-06 15:35:28 +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
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
5146c66786 core: adapt to msg_try_send 2014-10-22 12:37:33 +02:00
bdcac07faa core: msg: introduce msg_try_send 2014-10-22 12:37:33 +02:00
Ludwig Ortmann
cd3dff3f2e core/msg: add DEVELHELP checks for valid pid 2014-10-13 19:44:35 +02:00
Ludwig Ortmann
c2b2e4554b core/queue: queue -> priority_queue
Rename queue to priority queue, because that's what it is.
2014-08-05 17:57:45 +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
2a859c78cd SQUASHME: do it right 2014-07-08 18:00:54 +02:00
Ludwig Ortmann
d8a5ee1ec8 core/msg: set m->sender_pid before it is used
fixes `msg_send_to_self` condition
2014-07-08 17:49:16 +02:00
Ludwig Ortmann
b6f2426d16 core/msg: revert part of #1285
use m->sender_pid instead of sched_active_pid again
undoes the optimization intended by #1285
fixes uint/int warning
2014-07-08 17:26:25 +02:00
Ludwig Ortmann
5c9a975afb core/msg: fix, optimize and improve
fixes:
fix race conditions by reordering dINTs
prevent null pointer dereference by adding forgotten target check
add forgotten eINTs
replace printf with DEBUG
fix debug messages

optimizations:
optimize pid access
reorder msg_send switches

improvements:
add debug statements
add missing return value to msg_send_to_self documentation
2014-07-08 11:57:38 +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
Christian Mehlis
7b91ea9349 core: fix warning about discarding volatile 2014-04-18 12:11:05 +02:00
Kévin Roussel
24f5cfafbb Add the ability to send a message to the current thread's message queue
(without raising an error)
2014-04-11 10:43:11 +02:00
622d473eb3 core: msg: yield after queueing of a message if REPLY_BLOCKED
When setting the running task reply_blocked, it is implicitly removed
from the runqueue. But if queueing of a msg is actually successful, the
thread exits msg_send without yielding, continuing to run even if it's
not supposed to.

Nice example of why multiple function exit points lead to weird
errors...
2014-02-13 11:33:18 +01:00
8d07b131db core: msg: add some debug statements 2014-02-12 19:16:42 +01:00
210a20b807 core: msg: don't wake up sender after receive if it's REPLY_BLOCKED
solves issue #100

If the sender is reply-blocked, waking it up after its message has been
delivered is wrong. It needs to stay reply-blocked until the reply has
been delivered.
2014-02-12 19:16:41 +01:00
56ee585c81 update Kaspar's email address
kaspar.schleiser@fu-berlin.de is obsolete.
(2nd try, first try was overwritten by some overzealous documenter)
2014-01-28 11:53:19 +01:00
Oleg Hahm
903ec54a43 making include directives consistent 2013-12-19 15:31:37 +01:00
Hauke Petersen
3785fe956b Fixed doxygen comments, focused on file headers and group definitions 2013-12-16 14:00:24 +01:00
aaf325c290 Merge pull request #400 from kaspar030/msg_cleanup
msg.c cleanup
2013-12-05 04:16:00 -08:00
23ecbde1a3 core: msg: whitespace fixes 2013-12-04 20:36:21 +01:00
94283789a7 core: msg: rename "n" to something more expressive ("queue_index") 2013-12-04 20:33:53 +01:00
af542058ee core: msg: whitespace fixes 2013-12-04 20:33:53 +01:00
f85adf608f change my email address
kaspar.schleiser@fu-berlin.de will be obsoleted soon. Replace it with
kaspar@schleiser.de, which will (hopefully) stay.
2013-12-04 15:09:56 +01:00
Ludwig Ortmann
d6c213fb47 fix grammar in license header 2013-11-23 13:11:56 +01:00
Oleg Hahm
e44412d0c1 added debug information to msg_send (similar to msg_send_int) 2013-11-03 06:46:13 -08:00
Ludwig Ortmann
f1b89df8d8 explain the "brainfuck condition" 2013-10-28 12:57:02 +01:00