Commit graph

154 commits

Author SHA1 Message Date
Benoît Thébaudeau 81805129f8 mt: Fix preemption
Preemption was supposed to be supported, but it had no means of safely
updating the state of a thread, so mt_exec() could fail to resume a
preempted thread.

mt_exec() is allowed to be called only from the main Contiki thread, so
the mt threads passed to it may be only ready or exited, not running.
Consequently, there is no need for a distinction between the ready and
running states, so merge them as a started state, which avoids having to
update the state of a thread upon preemption.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Benoît Thébaudeau 927e9b8150 mt: Fix missing call to mtarch_pstop()
If mt_yield() needs it, then mt_exit() too. A thread could indeed be
preempted while calling mt_exit().

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Benoît Thébaudeau 82afa72c13 mt: Remove unused code
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Simon Duquennoy 84b51461e9 Merge pull request #1597 from rgrr/remove_static_from_process_c
Removed some unnecessary statics in do_event() and process_post().
2016-06-03 14:16:14 +02:00
Simon Duquennoy bb5e5d5c6b TSCH: use RTIMER_CLOCK_DIFF to compute estimated drift, fixing a bug that would occur on 16-bit rtimer platforms 2016-04-27 14:13:33 +02:00
Hardy b3f2bba3ec Removed some unnecessary statics in do_event() and process_post().
This allows the optimizer to put the corresponding variables into registers.
See also discussion about other static variables:
https://sourceforge.net/p/contiki/mailman/message/35010460/
2016-04-13 18:12:47 +02:00
Benoît Thébaudeau 6166693a11 Merge pull request #1133 from bkozak-scanimetrics/cc-gcc
put gcc specific stuff into seperate .h
2015-12-05 00:39:59 +01:00
Atis Elsts b5d17bb620 ContikiMAC: use RTIMER_GUARD_TIME #define to avoid accidentally scheduling a rtimer in the past on platforms with fast rtimer ticks 2015-12-03 17:37:26 +01:00
Oliver Schmidt 1639b712bb Removed CC_FASTCALL.
CC_FASTCALL was introduced many years ago for the cc65 tool chain. It was never used for another tool chain. With a798b1d648 the cc65 tool chain doesn't need CC_FASTCALL anymore.
2015-11-01 18:10:17 +01:00
Simon Duquennoy ee37b4b293 Merge pull request #884 from cmorty/pull/ringbuf-order
Ensure that the data in ringbuff is accessed in the right order
2015-09-28 13:24:44 +02:00
Simon Duquennoy ef176bad33 Merge pull request #716 from hexluthor/isr-safe-pt-sem
Make protothread semaphores interrupt-safe.
2015-09-28 13:20:24 +02:00
Billy Kozak 8e5f0bc36a Defining gcc specific macros in seperate header 2015-09-22 14:17:10 -06:00
Moritz 'Morty' Strübe d68cbb2980 Ensure that the data in ringbuff is accessed in the right order 2015-09-21 09:38:45 +02:00
Atis Elsts eac1973073 Introduce ENERGEST_SWITCH macro. It allows to switch between energest modes without running into the risk of losing a tick in the process 2015-09-04 11:49:02 +02:00
Valentin Sawadski 2cd74d043d CTIMER API extension to explictly state the process a ctimer belongs to 2015-08-31 10:31:36 +02:00
Moritz 'Morty' Strübe 9b77aac542 Add function etimer_reset_set.
This new function is similar to reset, but allows to also set a new
timeout. Thus long-term accuracy with changing timeouts is now possible.
2015-08-25 17:03:44 +02:00
Adam Dunkels 730bda2001 Merge pull request #883 from cmorty/pull/global-macros
Move MAX, MIN and ABS to contiki-macros
2015-05-18 21:33:00 +02:00
Ulf Knoblich a388a1bcd7 CC2538: added support for SSI1 2015-05-18 10:02:55 +02:00
Moritz 'Morty' Strübe 0dab6926b3 Move MAX, MIN and ABS to sys/cc.h 2015-05-18 08:53:17 +02:00
George Oikonomou aedffb6c87 Merge pull request #767 from ejoerns/pull-req/timer-note
Note that timer_reset() must not be executed before timer expired
2015-03-29 00:46:30 +00:00
George Oikonomou e596d5104d Fix minor typos 2015-02-15 20:11:11 +01:00
George Oikonomou 35be05071c Fix some unresolved references
* Either by removing them
* Or by resolving them
2015-02-15 20:11:10 +01:00
George Oikonomou 0b382a933a Fix warnings caused by unescaped special doxygen chars 2015-02-15 20:11:09 +01:00
George Oikonomou fb22e15844 Fix warnings caused by incorrect param names / undocumented params 2015-02-15 20:11:08 +01:00
marcas756 b787b27d5b Moved thread states from module to header 2014-11-22 15:49:45 +01:00
Nicolas Tsiftes eb0676212c Merge pull request #858 from simonduq/cleanup-ctimer
Remove unnecessary list_remove in ctimer.c (list_add automatically remov...
2014-11-18 08:59:41 +01:00
Enrico Joerns 85b494c16b [doc] Give files a common structure by placing license first (partial)
Followed by doxyen file and group tags.
This patch is only a first attempt to make provide a clean structure,
many more files require rework, too.
2014-11-10 23:54:49 +01:00
Simon Duquennoy 239207c8c6 Remove unnecessary list_remove in ctimer.c (list_add automatically removes first) 2014-11-10 13:41:33 +01:00
Adam Dunkels 62b8aafb03 Merge pull request #722 from royscheefhals/contiki-fix
char * data to void * data parameter in process_start
2014-07-28 22:04:36 +02:00
Rémy Léone 8c3fa17ec0 Correct several doxygen tags (\file) 2014-07-28 11:11:45 +02:00
Enrico Joerns 1654152193 [core] timer: Added note that timer_reset must not be executed before timer expired
Should save some users debugging time while adding no computation overhead
that would be needed for range checks
2014-07-10 11:33:00 +02:00
Roy Scheefhals 1058ea986a Changed the parameter 'char * data' of process_start to the
type process_data_t. This was an artifact when the choice was
made to use the void * type for the data parameter in processes.

Changed parameter 'void * data' of process_post_synch to
process_data_t for consistency.

Checked all the uses of process_start() in contiki and fixed casts
of the data parameter.
2014-06-12 13:40:28 +02:00
Ian Martin e5add3d1f8 Make protothread semaphores interrupt-safe. 2014-06-11 18:44:59 -04:00
Rémy Léone 25c8b0835d Closing doxygen groups 2014-05-30 11:01:20 +02:00
Adam Dunkels bb2dcaa057 A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
Adam Dunkels 563c9d1577 Removed old unused sys/ files 2013-11-19 00:23:13 +01:00
Oliver Schmidt ff5d6e091d Recent changes in telnetd make exporting of those two necessary. 2013-07-31 00:04:43 +02:00
hardy ae62a0d142 one blank less 2013-02-18 20:34:24 +01:00
rgrr 7cb8148226 add_timer() does not set owning process 2013-02-13 09:15:11 +01:00
Adam Dunkels ec8c7e9be0 Cleanup of the node-id.h files. The node-id.h file contains
declarations of functions for setting and getting a node ID number, a
functionality that exists on many platforms. Since this functionality
was not considered part of the Contiki core, each platform defined its
own node-id.h file. This commit attempts to clean this up by
collecting the node-id.h into a core/sys/node-id.h file that replaces
the old node-id.h files from the platform directories.
2012-11-20 19:59:46 +01:00
Adam Dunkels 944537fccf Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
David Kopf cac4e9a222 Add clock_delay_us and clock_set_seconds to clock.h. Modify clock_wait to use clock_time_t.
Remove the troublesome avr/dev/delay.* files.
Add PLATFORM_NAME and combine the confusing *_REVISION defines into a single PLATFORM_TYPE
2012-04-09 15:49:53 -04:00
David Kopf 745f071c98 Eliminate unused variable warnings. Dummy test of PT_YIELD_FLAG does not change program size. 2012-02-21 11:23:54 -05:00
Adam Dunkels 8edd86da5e Bugfix: PROCESS_PAUSE() must explicitly check the event type, otherwise we may cause the process event queue to fill up if we repeatedly call PROCESS_PAUSE() while other (broadcast) events are posted as well, such as timer events. 2011-11-22 09:36:27 +01:00
David Kopf 2feed121d2 Account for 16 bit rtimer wraparound, else ENERGEST way underreports AVR times. 2011-08-17 16:51:22 -04:00
Adam Dunkels 0e792fb742 Flush before computing accumulative power 2011-05-08 22:25:38 +02:00
Lionel Debroux 5cb49e8b07 Several compiler warning fixes:
* msp430: fix "implicit declaration of function" warnings in clock.c, by including watchdog.h;
     * sky: fix a couple pointer target signedness warnings;
     * core: fix several signed/unsigned comparison warnings;
     * framer-802154: "const static" -> "static const" to fix compiler warnings;
     * core: comment or remove unused variables and function definitions.

Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
Signed-off-by: Mariano Alvira <mar@devl.org>
2011-02-20 19:28:14 -05:00
adamdunkels 06123fefe2 Defensive programming: make sure that a process is actually running before we try to kill it. 2010-10-20 22:24:46 +00:00
dak664 b9a9e7695d Add option to remove process name strings to save RAM 2010-09-14 18:55:04 +00:00
nifi 095f700b63 Moved down inclusion of rtimer-arch.h to allow rtimer_clock_t to be used in rtimer-arch.h 2010-09-13 20:46:02 +00:00