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

748 Commits

Author SHA1 Message Date
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
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