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

1011 Commits

Author SHA1 Message Date
495644adc0
sched: return the new thread on sched_run 2020-09-02 13:32:14 +02:00
f68f19a73f
Merge pull request #14722 from bergzand/pr/sched/runqueue_clz
sched: Reverse runqueue order when CLZ is available
2020-09-01 22:57:30 +02:00
Cenk Gündoğan
538155c344
Merge pull request #14904 from leandrolanzieri/pr/kconfig/change_prefix_convention
treewide: modify Kconfig symbol prefixes
2020-09-01 15:57:06 +02:00
c83b78a567
Merge pull request #14762 from maribu/move_byteorder
core/byteorder: Moved to sys
2020-09-01 15:02:11 +02:00
Vincent Dupont
96b018d8dd core/panic: callback app during panic 2020-08-31 16:45:13 +02:00
Leandro Lanzieri
2e79e00ca7
treewide: change Kconfig prefix for module symbols
This changes the prefix used for the symbols that reprensent modules
(not the ones generated from USEMODULE).

MOD_ => MODULE_
2020-08-31 09:57:28 +02:00
dd45eaa472
sched: simplify MODULE_CORE_IDLE_THREAD conditional 2020-08-25 14:00:01 +02:00
764b3102e4
sched: Early exit when scheduling same thread after sleep 2020-08-25 13:59:58 +02:00
benpicco
f3e1032f6e
Merge pull request #14827 from keith-packard/pr/libc/picolibc
Pr/libc/picolibc
2020-08-24 18:06:56 +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
8745d820ba
core/thread_flags: Fix code indention
Apply coding convention on the indent in the single switch statement within
core.
2020-08-23 21:18:10 +02:00
e6fd3630eb
sched: Remove extra mpu_enable during context switch 2020-08-19 20:13:28 +02:00
Marian Buschsieweke
164d2ac8f2
core/byteoder: Moved to sys
The byteorder utilities are never used in `core`, but extensively in `sys`.
They seem to be better located in `sys`.
2020-08-14 16:28:59 +02:00
Marian Buschsieweke
81d40d3f66
core/byteorder: Add byteoder_htobebufll & inverse
- Add `byteorder_bebuftohll()` to read an 64 bit value from a big endian buffer
- Add `byteorder_htobebufll()` to write an 64 bit value into a big endian buffer
2020-08-14 13:36:40 +02:00
Leandro Lanzieri
f5e57fbca4
core: Add modules to Kconfig 2020-08-12 12:22:35 +02:00
ab1d0b6f98
sched: Reverse runqueue order when CLZ is available
This commit reverses the runqueue_cache bit order when the architecture
has a CLZ (count leading zeros) instruction. When the architecture
supports CLZ, it is faster to determine the most significant set bit of
a word than to determine the least significant bit set. Unfortunately
when the instruction is not available, it is more efficient to determine
the least significant bit set.

Reversing the bit order shaves off another 4 cycles on the same54-xpro.
From 147 to 143 ticks when testing with tests/bench_sched_nop.
Architectures where no CLZ instruction is available are not affected.
2020-08-06 20:39:14 +02:00
Marian Buschsieweke
13575b2131
core/thread_flags: Avoid using inline w/o static
Apparently clang doesn't like static variables / functions being accessed called
from inline function (-Wstatic-in-inline). This commit results in the same
binary being generated while making clang happy.
2020-08-06 17:54:32 +02: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
4a31578982
core/thread: Add/change helper access functions
- Add `thread_get_active()` to access the TCB
- Add `thread_get_unchecked()` as fast alternative to `thread_get()`
- Drop `volatile` qualifier in `thread_get()`
    - Right now every caller of this function does this. It is better to
      contain this undefined behavior to at least one place in code
2020-08-06 14:35:43 +02:00
e81d0050d1
Merge pull request #14717 from kaspar030/optim_msg_active_thread
core/msg: sched_threads[sched_active_pid] -> sched_active_thread
2020-08-06 14:18:17 +02:00
5dbcfa3391
Merge pull request #14698 from benpicco/core/bitarithm-msb_clz
core/bitarithm: use __builtin_clz() for bitarithm_msb()
2020-08-06 13:00:34 +02:00
1bb3d56bd5 core/msg: sched_threads[sched_active_pid] -> sched_active_thread
Same result, but only a single volatile read.
2020-08-06 12:46:26 +02:00
c9883cebfd core/atomic_c11: fix I2 typedef for 16bit platforms 2020-08-05 14:32:57 +02:00
Marian Buschsieweke
315cdcdb5f
core/thread: Make thread_get inlineable 2020-08-05 10:51:16 +02:00
Benjamin Valentin
14144030fa core/bitarithm: use __builtin_clz() for bitarithm_msb()
The `clz` instruction pretty much implements getting the most significant bit
in hardware, so use it instead of the software implementation.

This reults in both a reduction in code size as in a speedup:

master:

  text    data     bss     dec     hex filename
 14816     136    2424   17376    43e0 tests/bitarithm_timings/bin/same54-xpro/tests_bitarithm_timings.elf

 + bitarithm_msb: 3529411 iterations per second

this patch:

  text    data     bss     dec     hex filename
 14768     136    2424   17328    43b0 tests/bitarithm_timings/bin/same54-xpro/tests_bitarithm_timings.elf

 + bitarithm_msb: 9230761 iterations per second
2020-08-04 17:50:09 +02:00
benpicco
2d4d29367e
Merge pull request #14642 from maribu/fix-byteorder-big-endian
core/byteorder: Fix be byte buffer conversion on big endian systems
2020-07-29 01:25:03 +02:00
Marian Buschsieweke
e4387c84fd
core/byteorder: Fix from/to be buffers on be
Big endian buffers on big endian systems are already in big endian byte order,
so no byte shuffling is needed. However, byte buffers might be unaligned, so
copy operations that are safe with unaligned memory accesses need to be
used.
2020-07-28 22:34:25 +02:00
Martine Lenders
b1bf8ab981
Merge pull request #14565 from bergzand/pr/sched/fix_retrigger
sched: Prevent retriggering the scheduler interrupt during idle sleep
2020-07-28 22:11:25 +02:00
Leandro Lanzieri
72d6d9047f
Merge pull request #14429 from benpicco/core/boot_msg
core/init: make boot message configurable
2020-07-28 16:40:08 +02:00
Benjamin Valentin
25e67e019e core/init: make boot message configurable
It can be desirable to not have the boot message printed each time
(e.g. logs are transferred over a wireless link on battery) while
still retaining the ability to receive INFO level logs.

This adds the option to disable the boot-up message (and also to customize
it if that is desireable).
2020-07-28 11:04:55 +02:00
benpicco
6ef4276c35
Merge pull request #14621 from benpicco/core/byteorder-be
core/byteorder: add Big Endian implementations
2020-07-28 10:30:27 +02:00
d59233baf1
Merge pull request #14556 from benpicco/bitarithm_test_and_clear
core/bitarithm: add bitarithm_test_and_clear()
2020-07-28 10:11:47 +02:00
Benjamin Valentin
df18bfb459 core/byteorder: add Big Endian implementations 2020-07-27 18:36:07 +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
Benjamin Valentin
46b89eb723 core/msg_bus: fix shift on 8-bit platforms
The previous shift would wrap if the compiler defaults to 16 bit words.
Use explicit `unsigned long` integer constants to mitigate that.

before:

2020-07-22 15:25:17,063 # THREAD 1 start
2020-07-22 15:25:17,063 # THREAD 2 start
2020-07-22 15:25:17,065 # THREAD 3 start
2020-07-22 15:25:17,066 # THREADS CREATED
2020-07-22 15:25:17,068 # Posted event 22 to 0 threads
2020-07-22 15:25:17,071 # Posted event 23 to 0 threads
2020-07-22 15:25:17,076 # Posted event 24 to 0 threads
2020-07-22 15:25:17,076 # SUCCESS
2020-07-22 15:26:00,188 # Exiting Pyterm

after:

2020-07-22 15:26:10,374 # THREAD 1 start
2020-07-22 15:26:10,374 # THREAD 2 start
2020-07-22 15:26:10,377 # THREAD 3 start
2020-07-22 15:26:10,377 # THREADS CREATED
2020-07-22 15:26:10,380 # Posted event 22 to 0 threads
2020-07-22 15:26:10,383 # T1 recv: Hello Threads! (type=23)
2020-07-22 15:26:10,386 # T3 recv: Hello Threads! (type=23)
2020-07-22 15:26:10,388 # Posted event 23 to 2 threads
2020-07-22 15:26:10,391 # T2 recv: Hello Threads! (type=24)
2020-07-22 15:26:10,394 # Posted event 24 to 1 threads
2020-07-22 15:26:10,396 # SUCCESS
2020-07-22 15:27:31 +02:00
Benjamin Valentin
a8904edd7d core/bitarithm: add bitarithm_test_and_clear() 2020-07-21 16:03:59 +02:00
2d74651237
sched: Clear context_switch_request after potential idle sleep
An interrupt serviced during the idle sleep can re-request a context
switch while the scheduler is already going to switch contexts after the
idle sleep. Thi sched_context_switch_request should thus be cleared
after the idle sleep and not before where it could be modified during
the idle sleep and get out of sync.
2020-07-21 11:27:08 +02:00
e1b810b613
core/sched: tiny logic optimization in idle case
In the case that the no_thread_idle feature is active, the
runqueue_bitcache is checked twice in the case no thread is available to
schedule. This changes the inner while loop to a do-while loop to save
one check from the initial loop iteration, saving a cycle or so in the
idle case.
2020-07-20 23:26:47 +02:00
benpicco
e2e51ae7ef
Merge pull request #14368 from jia200x/pr/byteorder_bebuftohs
core/byteorder: add uint32 from/to buffer funcs
2020-07-13 12:31:43 +02:00
Jose Alamos
244d5191c8 core/byteorder: add uint32 from/to buffer funcs 2020-07-13 11:21:30 +02:00
Benjamin Valentin
b71fde68e9 core/panic: launch USB bootloader for easy recovery
If a board was flashed via USB bootloader, a crash means the user has to
perform a procedure to manually enter the bootloader again for recovery.

To allow for easier recovery, automatically lauch the bootloader on crash
if `DEVELHELP` is enabled.
2020-07-01 20:36:59 +02:00
d199865a12 core: sched: correctly unschedule when there's no idle thread 2020-06-25 16:02:29 +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
Martine Lenders
379d113af7
Merge pull request #14076 from miri64/cib/doc/fix-max-size
core/cib: fix documented maximum size restrictions
2020-06-19 17:18:20 +02:00
Martine S. Lenders
c2e1b8afea
core/cib: fix documented maximum size restrictions
MAXINT is not a defined value and since the types are unsigned also
misleading.
2020-06-19 15:08:58 +02:00
benpicco
7ea26cb118
Merge pull request #14295 from benpicco/core/include/macros/units_convenience
core/include: don't use 64 bit for MHZ & MiB macros
2020-06-17 15:01:44 +02:00
Benjamin Valentin
0862a3c512 core/include: Don't use 64 bit for MHZ & MiB macros
Those macros are all about convenience. However, always using 64 bit makes casts
nececcary that goes against the idea of having a convenience macro.

E.g. when printing a frequency in KHZ one might want to do

	printf("freq: %lu kHz\n", freq / KHZ(1));

leads to an error

> error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'long long unsigned int'

Now we would have to cast - `%llu` is not available with newlib-nano and wholly
uneccecary.

Only use 64 bit artithmetic where necessary (GHZ, GiB), not for smaller units.
2020-06-17 12:50:50 +02:00
Leandro Lanzieri
4d65bc8e0a
cpu: Rename CPU_ARCH to CPU_CORE 2020-06-16 12:05:40 +02:00
Benjamin Valentin
8e83584f1c core/include: add macros for common units
I got tired of counting zeros in frequency defines, so add a few
helper macros to make defining frequency and sizes easier.
2020-06-03 16:00:19 +02:00
Benjamin Valentin
c29f133a63 core/msg_bus: clarify API of msg_bus_post()
Receiving threads must not modify the contents of the message as this
is racy by definition.

Also make `msg_bus_post()` accept `const void*` instead of `char *`.
2020-05-20 10:44:11 +02:00
Francisco Molina
cb5cbe7431
cpu/cortexm_common: add inlined header only def for irq_%
irq_% are not inlined by the compiler which leads to it branching
to a function that actually implement a single machine instruction.

Inlining these functions makes the call more efficient as well as
saving some bytes in ROM.
2020-05-12 16:37:34 +02:00
Benjamin Valentin
b3eb59c30e core/msg: add message bus 2020-04-28 13:35:05 +02:00
Benjamin Valentin
866c37c6b0 core/msg: split msg_send_int() into helper function
So it can be re-used for the message bus.
2020-04-28 11:30:56 +02:00
Francisco Molina
57938de035
core/doc: fix alignment 2020-04-21 15:10:56 +02:00
Francisco Molina
cbcb882454
core/include: add xtstr macro 2020-04-21 15:10:55 +02:00
46b6a95309
Merge pull request #13671 from jia200x/pr/move_thread_flags_error
core/thread_flags: remove #error from header file
2020-03-31 15:48:41 +02:00
8efe5960aa core: uncrustify 2020-03-30 17:02:08 +02:00
f99bc894de core: make some formatting uncrustify friendly (or ignore) 2020-03-30 17:00:32 +02:00
4a31068d15 core: disable uncrustify for atomic_*.c 2020-03-30 17:00:32 +02:00
JulianHolzwarth
dd6e51b1eb core/mutex.c _mutex_lock uses an int pointer
_mutex_lock uses a volatile int pointer for the parameter blocking instead of an int.
2020-03-26 17:26:07 +01:00
benpicco
a3dca87a78
Merge pull request #13300 from JulianHolzwarth/pr/thread_status_t/zombie_fixup
core/thread.c: thread_zombify small fix
2020-03-23 20:53:00 +01:00
Jose Alamos
027a47e3a8 core/thread_flags: remove #error from header file
This commit removes the #error from the thread_flags header.
This #error makes the usage of
if(IS_USED(MODULE_THAT_DEPENDS_ON_THREAD_FLAGS)) pattern harder,
because the error is triggered each time the header is included.
If a module uses any thread_flags function it will fail in link time
anyway.
2020-03-20 16:59:34 +01:00
Sören Tempel
59676a1f5e Make sure the mpu_noexec_ram regions has the lowest priority
From the ARMv7-M ARM section B3.5.3:

	Where there is an overlap between two regions, the register with
	the highest region number takes priority.

We want to make sure the mpu_noexec_ram region has the lowest
priority to allow the mpu_stack_guard region to overwrite the first N
bytes of it.

This change fixes using mpu_noexec_ram and mpu_stack_guard together.
2020-03-10 11:16:22 +01:00
1b8ec38e34 core/panic: add PANIC_EXPECT_FAIL 2020-02-24 10:48:43 +01:00
Leandro Lanzieri
ea8c85ae8b core/debug: Fix code style errors 2020-02-18 13:20:06 +01:00
Leandro Lanzieri
981b4eb8d0 core/debug: Fix documentation of ENABLE_DEBUG macro 2020-02-18 13:20:06 +01:00
JulianHolzwarth
ebe1bf1889 core/thread.c:thread_zombify always enables interrupts before yield 2020-02-05 18:00:13 +01: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
c2534ad8f3 core: turn panic.c into a submodule 2020-01-31 13:55:26 +01:00
b6703f41dc core: turn kernel_init.c into core_init submodule 2020-01-31 13:52:13 +01:00
dec0870b4e core: cleanup kernel_init.c 2020-01-31 10:12:49 +01:00
mjc
7f44c02f45 core/ringbuffer: compensate 'ringbuffer_remove' underflow error
When rb->start = rb->size, `ringbuffer_get_one(ringbuffer_t *restrict rb)`
will read out of bounds.
2020-01-07 12:56:17 +01:00
JulianHolzwarth
2655c97fd5 core/thread.c: new function for zombie state 2019-12-11 16:48:31 +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
Francois Berder
4a31f94cfc many typo fixes
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-23 22:39:07 +01:00
Benjamin Valentin
a98a9e12e9 core: debug: introduce DEBUG_PUTS()
The DEBUG() function requires a minimal stack size for printf().
This is not always availiable.
To still allow static debug messages, introduce DEBUG_PUTS() that
gets resolved to puts() and does not carry such stack size requirements.
2019-11-20 19:09:47 +01:00
Leandro Lanzieri
0dd776a9e6 core/kernel_defines: Introduce 'IS_ACTIVE' macro.
IS_ACTIVE allows to evaluate macro definitions in non-preprocessor
expressions. It takes a macro that may be defined to 1 or not defined at
all and expands to 1 or 0 respectively.
2019-11-11 12:53:03 +01:00
fenghe
d6227cbc4d core/sched: remove duplicate include of irq.h 2019-10-31 01:28:32 +08:00
Marian Buschsieweke
e0cec17ec8
core/rmutex: Made C++ compatible 2019-10-24 23:08:36 +02:00
Gunar Schorcht
54e915eec5 core/assert: allow multiple static_asserts
Uses an own scope for the definition of the enum const to allow multiple `static_assert` statements within the same function in non-C11 environments.
2019-10-19 16:16:24 +02: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
Francisco Molina
1caf6610cb sys: add schedstatistics module 2019-09-13 11:37:44 +02:00
Martine Lenders
1887e9d3f4
Merge pull request #12203 from JulianHolzwarth/pr/core/thread/hotfix_prio_type
core/thread.c: thread_create fix priority type
2019-09-12 12:41:13 +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
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
Kees Bakker
2a0a36945c core: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
Benjamin Valentin
fcf31724a6 core: add ARRAY_SIZE macro 2019-08-06 19:31:10 +02:00
fdfd3133f7
core/sched_native: fix duplicate core_sched group definition
Introduce core_sched_native group and put this in group in parent
core_sched group
2019-08-05 16:57:37 +02:00
Marian Buschsieweke
7749e621b8
core: Fix undefined behaviour in C11 atomics
Casting pointers to volatile memory to pointers to regular memory is permitted,
but using those pointers to access the memory results in undefined behavior.
This commit changes the casts to no longer drop the volatile qualifier.

References: https://en.cppreference.com/w/c/language/volatile
2019-05-15 15:47:43 +02:00
be66fb0507 core/atomic_c11: fix declarations
gcc 9 started complaining about type mismatches:

1. all int sized return types are expected to be
   "unsigned int" instead of e.g., "uint32_t"

2. all arguments are expected to be passed as (volatile)
   void * pointers

This commit fixes 1. by doing ifdef'ed typedefs for I2 and I4, an fixes
2. by using void pointers, then casting within the template bodies.
2019-05-13 17:38:10 +02:00
e4fcac91a1 core/atomic_sync: guard by GCC >= 4.7
The documentation states that the implementation is missing for
gcc < 4.7, but then unconditionally compiles it, overriding the
builtins.
(gcc 9 starts complaining about mismatch of declarations.)
2019-05-13 13:18:21 +02:00
0d4f7b2715
Merge pull request #11510 from miri64/core/fix/thread_state-name-collision
core: rename thread_state_t to thread_status_t
2019-05-11 13:03:49 +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
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
0ec9c57b2b add copyrights from IOTPUSH project 2019-05-02 12:09:37 +02:00
Hauke Petersen
c71fb4a435 core/clist: add clist_count() 2019-03-23 23:29:53 +01:00
Marian Buschsieweke
435f798a2b
core/sched: Fixed typo 2019-03-21 22:00:37 +01:00
Vincent Dupont
e8619b327b thread: allow overriding THREAD_PRIORITY_MAIN 2019-03-20 14:09:16 +01: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
82b2362bc3 core/msg: add assert for problem identified in #10881 2019-01-28 17:14:16 +01:00
Kees Bakker
920d8b8805 core: remove redundant casts 2019-01-09 23:00:50 +01:00
Sebastian Meiling
52bc2b86fa doxygen: use initial capitals for group names 2019-01-09 08:42:59 +01:00
Sebastian Meiling
dceff6c22f doxygen: use ingroup instead of addtogroup in core 2019-01-09 08:42:59 +01:00
Sebastian Meiling
81e293422c doxygen: refine core_sync grouping
- Move `@defgroup core_sync` group definition to doc.txt
- Adapt usage of `@ingroup core_sync` accordingly
2019-01-09 08:42:59 +01:00
f2194a8e26 core/irq: fix 2 missing words in documentation 2019-01-07 20:50:59 +01:00
4878cf2119
Merge pull request #10400 from miri64/core/enh/thread_has_queue_func
core: provide function to check msg queue initialization
2018-12-19 18:41:39 +01:00
Martine Lenders
c8937f8d40 core: use thread_has_msg_queue() for message queue check 2018-12-19 15:39:50 +01:00
Martine Lenders
7835db5ec3 core: provide function to check msg queue initialization
This makes it easier to refactor that part of the `thread_t` structure
later on.
2018-12-19 15:39:50 +01:00
2a03e6fdbd
Merge pull request #10264 from gebart/core/schedstats_t
core: Rename typedef schedstat -> schedstat_t
2018-12-18 12:51:29 +01:00
Hauke Petersen
0e4f5bf894 core/clist: add missing function to table in doc 2018-12-11 11:15:18 +01:00
Sebastian Meiling
43d39b7a33
Merge pull request #8333 from samkumar/feature-condition-variable
core: condition variable implementation
2018-11-30 21:15:53 +01:00
Sam Kumar
fb8edbb610 core: condition variable implementation 2018-11-30 11:22:07 -08:00
Martine Lenders
28572d7d21 core: mutex: fix DEBUG pointer output 2018-11-09 08:41:50 +01:00
Joakim Nohlgård
5b68bbb2cf core: Rename typedef schedstat -> schedstat_t
To follow naming conventions
2018-10-26 09:10:21 +02:00
PeterKietzmann
0ecaaf021c core/bitarithm: add explicit 32-bit function 2018-10-08 13:57:21 +02:00
smlng
5b1cd0475f core/clist: add cppcheck-suppress nullPointer
This was found by cppcheck 1.6x used in Travis-CI, however this
seems to be a false positive, as it is not found by newer versions
of cppcheck.
2018-09-25 12:03:58 +02:00
smlng
59e299635b cppcheck: add/correct reason for cppcheck-suppress
Adding and correcting description/rational on why certain cppcheck
warnings or errors are intentionally suppressed.
2018-09-25 12:03:58 +02:00
Martine Lenders
2350c46740
Merge pull request #9826 from kaspar030/fix_byteorder_bebuf
core/byteorder: fix bebuftohs() / htobebufs() on big endian
2018-09-03 14:35:29 +02:00
Joakim Nohlgård
ab05acbf89 core: Mark openocd info variables read-only 2018-08-25 14:44:45 +02:00
2d27b32567
Merge pull request #9364 from gschorcht/thread_arch
core: add architecture dependent thread information
2018-08-24 12:10:20 +02:00
accf50ce07 core/byteorder: fix byteorder_htobebufs, byteorder_bebuftohs
Logic was swapping byte order on Big Endian platforms
2018-08-23 22:07:44 +02:00
Martine Lenders
ec7bf7a854 core: rmutex: include stdint.h
For some reason the LLVM/clang version of `stdatomic.h` does not include
`stdint.h`, though it uses types from it.
2018-08-03 18:34:56 +02:00
Gunar Schorcht
9db03537b9 core/pthread: make them compilable with g++ 2018-07-21 14:24:57 +02:00
Gunar Schorcht
e75e0a5fe6 core: architecture dependent part in thread_t 2018-07-05 09:22:59 +02:00
Gunar Schorcht
c71f40370b core: add architecture dependent extension 2018-07-05 09:22:59 +02:00
Hauke Petersen
36e0d4883d core/byteorder: to/from bufs funcs are big endian 2018-07-04 17:41:04 +02:00
Joakim Nohlgård
69fb02c3fc core: uncrustify thread_flags.h 2018-06-27 12:43:29 +02:00
2b1ed99a49 core: add more stacksize defines 2018-06-14 23:29:03 +02:00
2212850fbb core/mbox: doc typo fixes 2018-06-13 12:13:24 +02:00
bd2845adf6 core: fix doxygen grouping 2018-06-11 19:12:02 +02:00
Hauke Petersen
f68b243dfc core/byteorder: add uint16 from/to buffer funcs 2018-06-06 13:18:48 +02:00
Matthew Blue
2bd1d7f045 core/assert: provide static_assert for c99 2018-06-03 03:15:17 -04:00
Matthew Blue
38a30b68c2 core/debug: fix debug.h use within ISRs 2018-05-17 17:06:44 -04:00
8fd013635f
Merge pull request #9136 from jcarrano/fix-assert
core: make assert() an expression.
2018-05-15 21:38:14 +02:00
Juan Carrano
09d1b2eac7 core: Make assert be an expression.
The "verbose" alternative for assert() is now an expression and
can be used in all the places that a funcion call can be used.
2018-05-15 14:25:55 +02:00
7c7bb45ce7 core/clist: make clist_foreach() return break-causing node 2018-05-12 00:07:13 +02:00
d9993cc8d2
Merge pull request #8642 from OTAkeys/feat/static_assert
assert: add static_assert if using c11
2018-04-03 22:10:46 +02:00
Pieter Willemsen
729441fdb6 assert: add static_assert if using c11 2018-04-03 16:09:31 +02:00
Joakim Nohlgård
1fdfa6480d core/mutex: fix -fpermissive warning in C++ mode
g++ gives the error message "error: invalid conversion from ‘void*’ to
‘list_node*’ [-fpermissive]"
2018-03-25 09:11:26 +02:00
aa57ea5b74 core: instead of cpp-style, use C-style comments 2018-02-06 16:59:58 +01:00
Sebastian Meiling
3bb169307b
Merge pull request #8364 from smlng/osx/debug/fix_output
macOS: fix debug output
2018-01-22 15:14:48 +01:00
smlng
e017f8a5f1 core: fix format errors in debug output 2018-01-17 15:25:11 +01:00
499c1812b2 core/bitarithm: provide multiple implementations for bitarithm_lsb() 2018-01-16 22:55:26 +01:00
e6a9a760a7 core/thread: add thread_getname() dummy available without DEVELHELP 2018-01-15 14:37:04 +01:00
c001e14f9d core: debug: rely on optimizer to kick out unused debug code 2018-01-12 13:38:06 +01:00
Martine Lenders
4013adcf65
Merge pull request #8277 from miri64/doc/fix/must-not-may-not-wording
doc: Fix 'must not'/'may not' wording
2018-01-10 20:34:17 +01:00
MichelRottleuthner
ee17dae5af pkg/fatfs: add vfs integration 2018-01-09 14:46:40 +01:00
Martine Lenders
2e93ba1c50
doc: Fix 'must not'/'may not' wording
I applied the following terminology and changed the wording in the doc
accordingly:

* must not: If the parameter is of the value it *must not* be it either
  hits an assert or crashes the system.
* may not: The value can be that value, but the function will return an
  error.
2017-12-19 09:00:12 +01:00
a8ec624ac4 core: cib: fix overflow handling 2017-11-22 17:53:16 +01:00
Martine Lenders
4952ffbae7
Merge pull request #6698 from Lotterleben/doc_thread_h
thread.h: extend doc for msg_waiters and msg_array
2017-11-16 19:25:52 +01:00
Lotte Steenbrink
9cc3641b75 thread.h: extend doc for msg_waiters and msg_array 2017-11-16 10:15:46 -08:00
24e7869484 core/include/panic.h: fix typos 2017-11-16 14:40:16 +01:00
32c10ae2c9 core, cpu: rename thread_start_threading() -> cpu_switch_context_exit() 2017-11-16 14:40:16 +01:00
bb4a5c5cdf core: remove COREIF_NG 2017-11-16 14:39:54 +01:00
615b1e60bc core/clist: add argument to clist_foreach 2017-11-06 12:49:22 +01:00
f142908f4e
Merge pull request #7655 from kaspar030/add_list_sort
core/clist: add clist_sort()
2017-11-06 12:46:01 +01:00
Joe Kroesche
5b6d311830 core/include/ringbuffer.h: add doc ref to tsrb.
Updated file comment header to comply with coding standard;
added brief module description and reference to tsrb to guide reader
who might be looking for thread-safe implementation
2017-10-29 08:08:15 -05:00
Joakim Nohlgård
317b013319 core/thread_flags: Remove unused THREAD_FLAG_MUTEX_UNLOCKED
and improve docs for THREAD_FLAG_TIMEOUT
2017-10-12 14:30:59 +02:00
Travis Griggs
2fd324a52f correct print_stack macro 2017-10-03 14:39:25 -07:00
de784961fa core/clist: add clist_sort() 2017-10-03 00:36:14 +02:00
5cc8204e10 Merge pull request #7048 from smlng/enh/ps/schedstats
schedstats: revert to 32Bit, and enhance output of schedstats
2017-09-28 16:08:51 +02:00
smlng
6ac0922c7d doc: replace dashes 2017-09-06 08:49:05 +02:00
Joakim Nohlgård
a67694a8c0 core: thread_flags: Set sched_status_switch_request after waking a waiting thread 2017-08-31 22:51:28 +02:00
Joakim Nohlgård
5dd38c68e2 Merge pull request #7536 from kaspar030/improve_thread_flags_docs
core: thread_flags: improve documentation
2017-08-30 20:44:04 +02:00
ee945978e9 core: thread_flags: improve documentation 2017-08-30 13:43:02 +02:00
Joakim Nohlgård
ef01efc387 core/msg: Set THREAD_FLAG_MSG_WAITING when queueing messages 2017-08-30 12:04:47 +02:00
Joakim Nohlgård
87d322556a core/thread: fix Doxygen nesting
Everything below the thread states was cut off in the module
documentation because Doxygen does not handle nested @name tags.
2017-08-11 07:47:09 +02:00
68f13467d3 core: remove redundant includes 2017-08-02 14:27:55 +02:00
7a0fcc30c8 sys: add initial SSP support 2017-06-27 18:05:14 +02:00
smlng
e7136e2dde schedstats: revert #6975, use 32Bit again 2017-06-08 14:33:47 +02:00
Raul Fuentes
f21d497be4 tread.h: Minor examples compile 2017-05-30 20:48:57 +02:00
0fcc7d3834 cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
Sebastian Meiling
dd4f8f7704 Merge pull request #6975 from OTAkeys/pr/ps_schedstatistics_fix
ps: fix schedstatistics
2017-05-17 13:50:42 +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
Hauke Petersen
f914ae4876 core/panic: enable panic modes for Cortex-M7 2017-05-08 09:16:11 +02:00
89390a83d4 core: byteorder.h: rename HTON* -> hton*, NTOH* -> ntoh* 2017-04-13 10:59:39 +02:00
smlng
4ffbbfb8f6 doc: correct naming of doxygen group in core 2017-04-10 16:11:49 +02:00
0b10dccf64 core: adapt to Makefile.submodule 2017-03-28 20:50:48 +02:00
smlng
1b69f281f9 core, log: fix tautology compare error with toolchain llvm 2017-03-17 09:04:09 +01:00
Simon Brummer
68581a8fbe core: bugfix: ringbuffer_remove 2017-03-01 22:01:26 +01:00
8d207ca724 Merge pull request #5731 from melshuber/master
core: recursive mutex implementation
2017-02-21 14:03:14 +01:00
Martin Elshuber
6cd3d34686 Removed duplicated code, fixed comment 2017-02-20 12:11:02 +01:00
Joakim Nohlgård
47e970635b core: Fix assert printf format string
cppcheck said: core/assert.c:23: warning (invalidPrintfArgType_sint): %d in
format string (no. 2) requires 'int' but the argument type is 'unsigned
int'.
2017-02-16 17:11:22 +01:00
smlng
f4d9972574 llvm: hide redefines of atomic sync operations 2017-02-14 10:53:12 +01:00
Martin Elshuber
b9c2fc8254 Added reentrant mutex implementation
In contrast to normal mutexes, reeentrant mutexes allow to be relocked
multiple times from the same thread.
2017-02-09 15:17:39 +01:00
Joakim Nohlgård
4fdd2ea41a core: Remove atomic in favour of C11 stdatomic 2017-02-08 16:23:50 +01:00
Joakim Nohlgård
4297e06fe5 core: add __sync_x library helpers for <gcc-4.7 2017-02-08 16:23:47 +01:00
Joakim Nohlgård
fcdb157228 core: rename c11_atomic -> atomic_c11 2017-02-08 16:23:47 +01:00
Joakim Nohlgård
6d20ac084b core/c11_atomic.c: Add remaining C11 atomic library helpers for GCC 2017-02-08 16:23:47 +01:00
Joakim Nohlgård
d322af3fe5 core/include/mutex.h: remove unused #include "atomic.h" 2017-02-08 16:23:47 +01:00
Joakim Nohlgård
985afd8d80 core/mutex.c: remove unused #include "atomic.h" 2017-02-08 16:23:47 +01:00
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
smlng
66c02daeae core: doc typos 2017-01-20 13:35:57 +01:00
Oleg Hahm
7ee7801c10 *: remove trailing underscores from header guards 2017-01-19 18:30:53 +01:00
daniel-k
9d403d95ce cortex_m: Add debug symbols for OpenOCD/GDB thread support 2017-01-16 20:50:35 +01:00
Oleg Hahm
4e068bc1a4 doc: core: fix formatting 2017-01-16 18:04:04 +01:00
Oleg Hahm
d8574c15e9 doc: core: exclude MUTEX_LOCKED from documentation 2017-01-16 18:04:04 +01:00
Hauke Petersen
a7502355b8 core: remove reboot.h
with the new PM, the reboot.h is deprecated and pm_reboot() from
periph/pm.h should be used.
2017-01-13 10:17:58 +01:00
Hauke Petersen
6270283033 Merge pull request #6160 from kaspar030/introduce_new_power_management
Introduce new power management
2017-01-12 17:31:49 +01:00
ca7bf15ac4 core: panic: adapt to pariph/pm 2017-01-12 16:26:01 +01:00
1b31fc75c4 core: reboot: map to periph/pm 2017-01-12 16:26:01 +01:00
6150e2753a drivers: periph: pm: introduce new power management API 2017-01-12 11:24:15 +01:00
0194091673 remove obsolete lpm code 2017-01-12 11:24:15 +01:00
Victor Arino
bba8cf4c03 core/list: uncrustify 2017-01-11 09:00:25 +01:00
Victor Arino
be146741c9 core/list: add remove method 2017-01-11 09:00:25 +01:00
Victor Arino
ea12433a8d core/mutex: support locked initialization 2016-12-14 10:24:45 +01:00
Francisco Acosta
84d0d61279 Merge pull request #5608 from gebart/pr/xtimer-ticks
xtimer: Allow arbitrary timer frequency, second attempt
2016-11-29 23:00:31 +01:00
Martine Lenders
235375f664 native: always assert() verbosely 2016-11-29 19:28:23 +01:00
Joakim Nohlgård
0ba6c9f3a4 core/sched: Use xtimer ticks for sched statistics 2016-11-28 11:00:42 +01:00
Martine Lenders
8406164ece core: fix stdio.h include for assert 2016-11-18 15:44:25 +01:00
Peter Kietzmann
11a8969ab0 Merge pull request #6003 from miri64/core/doc/msg-init-queue-power-of-two
doc: make the 2^x requirement for msg_queue more visible
2016-11-01 12:16:09 +01:00
Martine Lenders
f93ab1a1f6 doc: make the 2^x requirement for msg_queue more visible 2016-11-01 11:07:59 +01:00
Martine Lenders
61daeff04c Merge pull request #5881 from miri64/core/enh/add-verbose-assert
core: define macro for verbose behavior for assert()
2016-10-31 20:13:59 +01:00
Martine Lenders
65a11162fe core: define macro for verbose behavior for assert()
Since this is also done for MSP430 specifically that file can be
removed.
2016-10-31 13:51:54 +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
057274b1fb Merge pull request #5877 from miri64/core/doc/assert-addr2line
core: add documentation on how to get line of failed assert()
2016-10-18 12:06:41 +02:00
Lotte Steenbrink
8bd0bd17f3 thread.h: rearrange docs, add small tutorial 2016-10-16 12:46:54 -07:00
Martine Lenders
d724b7c9aa core: add documentation on how to get line of failed assert() 2016-10-11 09:06:41 +02:00
25a6ef5273 core: sched: mark sched_run() as used 2016-08-29 13:30:17 +02:00
Ludwig Knüpfer
49e76997a5 core/panic: add missing #ifdef NDEBUG
In case NDEBUG is not defined, `crash_code` is used later on
2016-07-26 19:37:35 +02:00
7a3c63fddb core: clist: clist_lpeek(): add missing return statement 2016-07-20 22:25:48 +02:00
Martine Lenders
e16bbda5f6 Merge pull request #5629 from kaspar030/improve_clist
core: improve clist
2016-07-18 19:36:16 +02:00
3a6f95008d core: mbox: introduce thread decoupled message queues 2016-07-18 16:56:41 +02:00
d86c141842 core, tests: adapt to changed clist function names 2016-07-18 16:20:40 +02:00
9bfea9410e cib: add unsafe operations 2016-07-18 16:14:19 +02:00
6d12a9166a core: clist: API enhancements
- renamed clist_insert() -> clist_rpush()
- renamed clist_remove_head() -> clist_lpop()
- renamed clist_advance() -> clist_lpoprpush()
- added clist_lpush(),
    clist_rpop(),
    clist_remove(),
    clist_find(),
    clist_find_before(),
    clist_lpeek(),
    clist_rpeek()

- improved documentation
2016-07-18 13:18:15 +02:00
ec897a868c core, gnrc_netreg: remove redundant or unneeded clist.h include 2016-07-18 13:17:31 +02:00
Victor Arino
de173ff48f core/cib: add peek capabilities 2016-07-14 16:47:03 +02:00
Joakim Nohlgård
b02e0eca47 ps: Add current stack pointer and start of stack to isr_stack ps output (DEVELHELP) 2016-07-12 10:17:49 +02:00
7718f114cb all: remove pointer casts for msg.content.ptr 2016-06-02 23:13:42 +02:00
f0b44d5175 core: change type of msg.content.ptr to void* 2016-06-02 20:17:50 +02:00
MohmadAyman
53df3e8b57 core: cpu: provide function to acquire ISR stack usage 2016-06-01 23:01:35 +02:00
Martine Lenders
c313c26dbb Merge pull request #5444 from OlegHahm/msg_send_receive_fix
core: msg_send_receive if receiver is not ready
2016-05-31 20:45:57 +02:00
Oleg Hahm
dc7d191748 core: msg_send_receive if receiver is not ready 2016-05-31 20:06:35 +02:00
Andreas "Paul" Pauli
c805853c34 Merge pull request #5376 from OlegHahm/doxy_fixes
doc: document THREAD_STACKSIZE correctly and fix PRNG documentation
2016-05-18 15:00:10 +02:00
Oleg Hahm
1319c5e874 doc: add a hint to cpu_conf.h 2016-05-18 12:48:35 +02:00
Martine Lenders
15130e8674 Merge pull request #5298 from cgundogan/pr/cib/cib_get_check_fix
cib: check (write > read) explicitly
2016-05-17 23:02:13 +02:00
Oleg Hahm
435685cf4a doc: add missing information about thread_create 2016-04-21 14:38:13 +02:00
Oleg Hahm
06e5c13b3d core: doc: do not exclude CPU specific values
This patch ensures that doxygen will add the CPU dependent defines for stack sizes.
2016-04-20 18:46:14 +02:00
Hauke Petersen
f977654a70 Merge pull request #5270 from authmillenon/core/fix/mutex-debug
core: allow DEBUG in mutex.c to run without DEVELHELP
2016-04-20 15:05:11 +02:00
Martine Lenders
1750e1bad8 core: mutex: piggy-back some style fixes 2016-04-18 17:23:55 +02:00
Oleg Hahm
8690a888f5 Merge pull request #5295 from OlegHahm/msg_init_queue_assert
core: assert correct msq queue size on creation
2016-04-17 14:49:54 +02:00
Martine Lenders
85dfed3249 Merge pull request #5283 from kaspar030/make_msg_use_list
core: msg: use new list instead of priority_queue
2016-04-17 14:48:50 +02:00
Oleg Hahm
bb35913840 core: assert correct msq queue size on creation
The return value was never checked. Hence, this runtime check was rather
pointless. Better assert the correct size during development.
2016-04-17 13:55:21 +02:00
Martine Lenders
ccb4521599 core: allow DEBUG in mutex.c to run without DEVELHELP 2016-04-17 13:38:49 +02:00
Cenk Gündoğan
e7b86361e2 cib: check (write > read) explicitly 2016-04-12 08:06:13 +02:00