Commit Graph

61 Commits (13832d8e621027bfbd636b32d4c29ede32178e9d)

Author SHA1 Message Date
Joakim Gebart 13832d8e62 everything: Remove filename from @file Doxygen command 8 years ago
Ludwig Ortmann 0adba81d2e core/thread: use disableIRQ/restoreIRQ 9 years ago
Kaspar Schleiser feb550f17a Merge pull request #1885 from OlegHahm/thread_yield_higher_cleanup
core: thread_yield_higher cleanup
9 years ago
Oleg Hahm 9a61d8cf1c core: move optional tcb members to DEVELHELP 9 years ago
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.
9 years ago
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
9 years ago
Oleg Hahm 9b819c4dd6 Merge pull request #1836 from Kijewski/yield-less
core: introduce sched_yield(), yield less
9 years ago
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.
9 years ago
Oleg Hahm db8f3d2650 cpu: use typed function pointer for thread_arch_init 9 years ago
René Kijewski 862000b715 core: align stack on a 32bit boundary
Fixes #1267.
9 years ago
Ludwig Ortmann 2fe2a39602 core: refactor check for valid pid
move into header and remove redundant condition
9 years ago
Kaspar Schleiser 003dd1969c Merge pull request #1566 from Kijewski/undef_is_null
core: let PIDs begin with 1
9 years ago
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.
9 years ago
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.
9 years ago
René Kijewski b31e5a8675 core: introduce KERNEL_PID_FIRST and KERNEL_PID_LAST 9 years ago
René Kijewski a7e5157fd9 core: add `thread_get()`
Remove PID check duplication in `thread_getstatus()` and
`thread_getname()`.
9 years ago
René Kijewski f7bdc7e4fe core: thread_measure_stack_free() is only useful for DEVELHELP 9 years ago
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.
9 years ago
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.
9 years ago
Ludwig Ortmann 3ca4f18479 doc: use lgplv2.1-short license header instead of lgpl-short-riot 9 years ago
René Kijewski 4032a22719 queue: add queue_t root type 9 years ago
Ludwig Ortmann a585eaf752 core/sched: remove MODULE_NSS helpers (API CHANGE)
remove thread_getlastpid and last_pid from the API, it is unused
9 years ago
René Kijewski ba1a15535b core: remove extra thread_create_arg() function 9 years ago
René Kijewski 867246a09f Add argument to thread_create 9 years ago
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.
9 years ago
Oleg Hahm ef5ec344fd core: prefix API functions correctly
Also changed names for bitarithm functions and rename thread_pid to sched_active_pid.
9 years ago
René Kijewski 9a9caf2c68 Exterminate old-style function definitions 10 years ago
Oleg Hahm 25a2122f83 core: documentation: updated, improved, and completed doxygen comments 10 years ago
René Kijewski 83988b2d03 Merge pull request #725 from kaspar030/optimize_thread_status_usage
core: sched: thread: optimize thread status field usage
10 years ago
René Kijewski 791f1cb90f Changes to `thread_wakeup`
`thread_wakeup` did not check if target pid is invalid.

`thread_wakeup` used `dINT` and `eINT` directly.
It should use `disableIRQ` and `restoreIRQ` instead, because there might
be other (good) reasons why one might want to call `thread_wakeup` with
interrupts disabled.

`thread_wakeup` yielded even if the other thread had a lower priority
than the current thread.
10 years ago
Oleg Hahm 24f5ec929c removed duplicate inISR prototype 10 years ago
Kaspar Schleiser 36981c95b9 core: sched: thread: optimize thread status field usage
see PR #716 for discussion
10 years ago
Kaspar Schleiser 56ee585c81 update Kaspar's email address
kaspar.schleiser@fu-berlin.de is obsolete.
(2nd try, first try was overwritten by some overzealous documenter)
10 years ago
Ludwig Ortmann bcbe6bf5c8 thread_measure_stack_ usage -> free
Rename the function as its name suggests the opposite of what it does.
10 years ago
Ludwig Ortmann 81608bdab5 thread_measure_stack_usage documentation
fix documentation - the return value is the opposite of what it said
add and improve comments
renamed space to space_free (the name is documentation as well)
10 years ago
Hauke Petersen 3785fe956b Fixed doxygen comments, focused on file headers and group definitions 10 years ago
Kaspar Schleiser f85adf608f change my email address
kaspar.schleiser@fu-berlin.de will be obsoleted soon. Replace it with
kaspar@schleiser.de, which will (hopefully) stay.
10 years ago
Ludwig Ortmann d6c213fb47 fix grammar in license header 10 years ago
Christian Mehlis 495246d2d4 add thread_getname function 10 years ago
Oleg Hahm 599e266b55 Revert "removed redefined ENABLE_DEBUG"
This reverts commit 69c526f44d.

Instead of removing ENABLE_DEBUG, define it as zero and replacing the
ifdef preprocessor commands by a simple #if
10 years ago
Christian Mehlis 837bad38eb rename kernel_intern.h
german "intern" to english "internal"
10 years ago
Christian Mehlis 69c526f44d removed redefined ENABLE_DEBUG 10 years ago
Oliver Hahm c8bee9e554 fixed coding style (space after most keywords) 10 years ago
Oliver Hahm ffeb6f8523 fixed coding conventions (correctly this time) 10 years ago
Oliver Hahm 0d6d8390c0 * updated copyright and license headers in various files 10 years ago
Ludwig Ortmann d65536f77b native cpu initial import 11 years ago
Oliver Hahm a20088f6e8 [core sched]
* fixed thread_getlastpid()
* enable interrupts again in thread_sleep() to avoid getting stuck w/
    disabled interrupts

[cpu lpc2387]
* added hwtimer as dependency for MCI driver

[project test_*]

* fixed some expect scripts
11 years ago
Oliver Hahm 2109f7dc86 [core thread]
* added thread_getlastpid
11 years ago
Stephan Zeisberg 5abef6daf2 changed types irq_callback, hashtable, posix_io, s_display_flags, seq_buffer_entry, tcb, toprint to type_t" 13 years ago
Kaspar Schleiser 3a83ef0824 * msg queue optimization 13 years ago