Commit Graph

1062 Commits

Author SHA1 Message Date
Gregory Nutt
ccbf514233 Add task state to information recorded when a task is suspended 2016-03-21 15:24:15 -06:00
Gregory Nutt
f7b58e9dfd sched/: Move location (and form) of context switch instrumentation. 2016-03-21 14:08:31 -06:00
Gregory Nutt
242f8ff25f drivers/syslog/note_driver.c: Add a driver that will allow an application to read buffered scheduler instrumentation data 2016-03-17 14:46:00 -06:00
Gregory Nutt
7f19631338 sched/: Add option to buffer scheduler instrumentation data in memory. 2016-03-17 09:49:43 -06:00
Gregory Nutt
2225940155 SMP: Add per-CPU initialization logic 2016-03-13 07:16:56 -06:00
Gregory Nutt
79c1fa5bd7 SMP: Simplified SMP interfaces 2016-03-12 15:29:33 -06:00
Gregory Nutt
320b70ebad Update submodules 2016-03-12 13:24:38 -06:00
Gregory Nutt
24468128de TLS: Simplify 2016-03-11 07:17:32 -06:00
Gregory Nutt
934069e422 TLS: Add logic to get/set arbitrary TLS values 2016-03-10 19:31:22 -06:00
Gregory Nutt
30b6ee96c9 Add basic definitions for TLS support 2016-03-10 11:56:33 -06:00
Gregory Nutt
9b5e88af71 Update some comments 2016-03-06 13:50:26 -06:00
Gregory Nutt
5d63cd85c7 sched/semaphore: Add an internal interface to reset a semaphore count. 2016-03-05 07:33:24 -06:00
Gregory Nutt
d0c09771db sched: Recent change of ASSERT to DEBUGASSERT causes a crash when debug is diabled because there is a critical function call within the assertion 2016-02-23 10:27:40 -06:00
Gregory Nutt
7cb35587a3 Correct minor typos in a Kconfig file 2016-02-22 08:28:33 -06:00
Gregory Nutt
0fb035f76b Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
Gregory Nutt
143d287f11 Fix some missing header file inclusions and a misplaced semi-colon from recent commits 2016-02-21 11:27:55 -06:00
Gregory Nutt
c929db42f9 Fix some bad SMP logic in sched_removereadytorun.c 2016-02-20 08:07:54 -06:00
Gregory Nutt
883a1adfe2 Implement sched_setaffinity() and sched_getaffinity() 2016-02-19 19:18:54 -06:00
Gregory Nutt
5a590e99b9 Add SYSCALLS for pthread_setaffinity() and pthread_getaffinity() 2016-02-19 18:13:06 -06:00
Gregory Nutt
1b5e296cf2 Add pthread_setaffinity() and pthread_getaffinity() 2016-02-19 17:59:19 -06:00
Gregory Nutt
a633353ec3 Add a CPU affinity set to the TCB if SMP is enable and use this CPU set as a mask for determining which CPUs the thread may run on. Add an affinity field to the attrributes to permit controlling which CPUs a pthread may run on. Implements pthread_att_setaffinity_np() and pthread_attr_getaffinity_np(). 2016-02-19 17:33:35 -06:00
Gregory Nutt
72d3920295 Rename cpuset_t to cpu_set_t which is the type used in some non-standard Linux/GNU interfaces. Move definitions of cpu_set_t to include/sys/types.h. Add prototypes for sched_setaffinity(), sched_getaffinity(), pthread_attr_setaffinity_np(), pthread_attr_getaffinity_np(), pthread_setaffinity_np(), and pthread_getaffinity_np(). No implementation is yet in place. 2016-02-19 15:57:07 -06:00
Gregory Nutt
3994b094c5 Remove some empty C file section comments; Update some text in TODO file 2016-02-19 10:01:15 -06:00
Gregory Nutt
94bea6547b Fix two unterminated strings in Kconfig files 2016-02-18 17:13:03 -06:00
Gregory Nutt
6d97249348 Trivial, cosmetic changes 2016-02-18 14:56:48 -06:00
Gregory Nutt
1780000777 SMP: Setting bit for wrong CPU. Assertion has cause false alarm crashes.. 2016-02-18 12:31:21 -06:00
Gregory Nutt
7d9287958f Minor simplication to last commit; Update TODO list 2016-02-18 09:21:43 -06:00
Gregory Nutt
52fbbaf778 1. SMP: Fix an assertion. SMP-specific change accidentally made in non-SMP code
2. Move list of signal actions from the task TCB to the task group.  Signal handlers are a property of the entire task group and not of individual threads in the group.  I know, I preferred it the other way too but this is more compliant with POSIX.
2016-02-18 08:34:54 -06:00
Gregory Nutt
720343612b Remove some empty file section section header comments 2016-02-17 18:05:03 -06:00
Gregory Nutt
6543c570d4 Remove some empty file section section header comments 2016-02-17 17:38:39 -06:00
Gregory Nutt
970b34ae8f Remove some empty file section section header comments 2016-02-17 17:17:44 -06:00
Gregory Nutt
a20863f6c0 Remove some empty file section section header comments 2016-02-17 17:15:08 -06:00
Gregory Nutt
b71907888e Remove some empty file section section header comments 2016-02-17 17:04:51 -06:00
Gregory Nutt
269c242f7b Update TODO list 2016-02-17 16:51:58 -06:00
Gregory Nutt
95735519dd SMP: Cosmetic renaming to clarify functionality of SMP interfaces. Update comments. 2016-02-17 13:36:25 -06:00
Gregory Nutt
b50325bb38 SMP: Add funtions to perform atomic bit set/clear operations; fix two errors in SMP macros 2016-02-17 13:20:01 -06:00
Gregory Nutt
8ac12839c3 leave_critical_section: Fix text of whether spinlock should be released or not 2016-02-17 10:55:18 -06:00
Gregory Nutt
d6912d0b00 Fix some bad conditional compilation and other typos in last commit 2016-02-16 20:11:25 -06:00
Gregory Nutt
6aeb4a52e8 Performance improvement: Idle loop should not take MM semaphore if there is not garbage to be collected. This can cause loss of performance and thrashing in tasking 2016-02-16 19:33:22 -06:00
Gregory Nutt
6dfa72d038 SMP: Fix some dumb but difficult to debug errors 2016-02-16 16:43:19 -06:00
Gregory Nutt
384e51cb05 Add some additional schedule instrumentation 2016-02-16 15:21:45 -06:00
Gregory Nutt
7f18b515f4 SMP: Fix a typo in last commit 2016-02-16 10:40:25 -06:00
Gregory Nutt
a442245479 SMP: Fix some non-SMP errors that crept in; fix a recursion problem; re-partition some functionality to improve design and readability 2016-02-16 10:14:33 -06:00
Gregory Nutt
8774e7a4a0 SMP: Fix missing initialization value 2016-02-15 18:35:05 -06:00
Gregory Nutt
fccef49305 Cosmetic changes to comments 2016-02-15 13:48:08 -06:00
Gregory Nutt
cfcd98ca89 SMP: Used wrong point to wrong TCB 2016-02-15 11:45:34 -06:00
Gregory Nutt
fc842d740a SMP: os_start needs to hold the KMM semaphore to prevent threads from allocating memory until the bring-up is complete 2016-02-15 11:07:42 -06:00
Gregory Nutt
8ea1bc3188 SMP: Fix backward spinlock test 2016-02-15 11:06:54 -06:00
Gregory Nutt
8399938138 SMP: I think we have to spinlock before we are possibly suspended 2016-02-15 10:15:07 -06:00
Gregory Nutt
3c46fa3f9f Fix a contention problem in the previous critical section design 2016-02-15 08:50:20 -06:00
Gregory Nutt
c7df82147f SMP: First cut integration of enter/leave_critical_section and the scheduler. There are some issues. 2016-02-15 08:06:17 -06:00
Gregory Nutt
9cb2a6b1f9 Rename irqsave() and irqrestore() to up_irq_save() and up_irq_restore() 2016-02-14 16:19:15 -06:00
Gregory Nutt
e6bd3544f6 Fix a name collision introduced in last commit 2016-02-14 08:20:35 -06:00
Gregory Nutt
6e3107650d nuttx/sched: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 08:17:46 -06:00
Gregory Nutt
a604a86980 Fix an error introduced in a previous commit 2016-02-13 10:48:30 -06:00
Gregory Nutt
d017e3eb2e SMP: Forgot to add a file before the last commit 2016-02-13 10:25:36 -06:00
Gregory Nutt
97cbd7112f SMP: Implement enter/leave_critical_section 2016-02-13 10:23:16 -06:00
Gregory Nutt
8ac699b63d SMP: Need to perform all IDLE task memory allocations on initializatin thread prior to starting the other CPUs 2016-02-13 09:04:54 -06:00
Gregory Nutt
f45166af32 SMP: Fix a IDLE task semaphore operation 2016-02-12 18:03:08 -06:00
Gregory Nutt
3f7f58de9d SMP: Fix some debug assertion problems when DEBUG is enabled; Partial fix for one bring-up issue 2016-02-12 17:13:38 -06:00
Gregory Nutt
64b3ce8775 SMP: Add up_cpustart and up_cpurestart protoypes; fix some problems in sched_addreadytorun; first cut at SMP version of up_mergepending. 2016-02-12 16:13:14 -06:00
Gregory Nutt
85f663a8ee SMP: Add non-reentrant spinlocks, fix pre-emption controls with SMP, and most of the basic scheduler support for SMP (still missing a few things) 2016-02-12 14:55:31 -06:00
Gregory Nutt
7d7f4e140c OS: Add a RUNNABLE attribute to the tasklists to indicate if the task list includes the currently executing task. Use this additional bit of information to determine if a context switch could really occur when removing a TCB from a task list 2016-02-12 08:15:16 -06:00
Gregory Nutt
76e88c8963 SMP: Removed unused macros, update comments, update sched_removereadytorun for SMP 2016-02-11 17:24:19 -06:00
Gregory Nutt
c315479a04 SMP: Move IDLE thread init logic from sim to OS; need to assign unique IDs to each IDLE task 2016-02-11 14:11:26 -06:00
Gregory Nutt
ddbc948895 SMP: Minor SMP-related clean-up/improvements 2016-02-11 12:18:54 -06:00
Gregory Nutt
49227fa554 Scheduler: Replace the boolean 'prioritized' with a uint8_t bit set so that additional attributes of a list can be specified without adding more boolean values. 2016-02-11 08:06:33 -06:00
Gregory Nutt
0a7e136a5a SMP: Idle thread must be assigned to a CPU 2016-02-11 08:01:09 -06:00
Gregory Nutt
89bea6917c Kconfig: Architecture must indicate that it support multiple CPUs in order to enable SMP 2016-02-10 17:31:16 -06:00
Gregory Nutt
292d2fe648 Correct naming of a TCB flag; update some comments 2016-02-10 16:53:34 -06:00
Gregory Nutt
96223cedf1 SMP: A little more 2016-02-10 15:43:05 -06:00
Gregory Nutt
3147dfc7d5 SMP: Add some tentative initialization logic 2016-02-10 13:49:27 -06:00
Gregory Nutt
47a5663f8c SMP: A few preliminary data structure definitions 2016-02-10 11:45:26 -06:00
Gregory Nutt
f5a3b1e89d Add EXPERIMENTAL configuration option to investigate some SMP issues 2016-02-10 10:27:48 -06:00
Gregory Nutt
bf8120d51d Fix some odd logic in CC3000 semaphore handling. Noted by Vladimir Komendantskiy 2016-02-10 09:50:28 -06:00
Gregory Nutt
2c0ad2564f Add CONFIG_SPINLOCK. Also need spinunlock() and spinlock_initialize() 2016-02-09 15:31:14 -06:00
Gregory Nutt
74db48202e sched/: Replace explict references to g_readytorun with indirect references via the this_task() macro 2016-02-06 17:44:41 -06:00
Gregory Nutt
2dc258986d Add a state variable that provides the current level of OS initialization. This is needed by some logic that may attempt to run early in the start-up sequence, but cannot run if a sufficient level of initializaitn has not not yet occurred 2016-02-05 08:34:03 -06:00
Gregory Nutt
61819c0e3e Fix a typo in last commit that was not noticed until CONFIG_SIG_EVTHREAD was enabled 2016-01-28 16:50:20 -06:00
Gregory Nutt
da5115e3e6 Correct an error in timer_created intoduced when SIGEV_THREAD support was added. 2016-01-28 16:38:54 -06:00
=?UTF-8?Q?Manuel_St=c3=bchn?=
2bacc40350 Fix mismatched prototype error in work_queue() 2016-01-24 12:48:24 -06:00
Gregory Nutt
84d4cb007b clock_systimer: 64-bit timer accesses are not atomic. Noted by Freddie Chopin. 2016-01-22 12:24:36 -06:00
Gregory Nutt
2de5be34e5 Update ChangeLog 2016-01-21 19:29:43 -06:00
Gregory Nutt
032ad1b70b Remove clock_systimer32 and clock_systimer64. There is now only clock_systimer 2016-01-21 16:49:24 -06:00
Gregory Nutt
b04e2ea021 Trivial improvement to comments 2016-01-21 16:28:36 -06:00
Gregory Nutt
a4f5254cbe Fix a typo introduced into the last commit 2016-01-21 13:48:35 -06:00
Gregory Nutt
e001f37593 sched/clock/clock_timespec.c: Fix an error in the time conversion 2016-01-21 13:31:00 -06:00
Gregory Nutt
f348e68069 Update to use 64-bit timer when available 2016-01-21 11:54:26 -06:00
Gregory Nutt
8ee75a96fe Update TODO list and Kconfig help 2016-01-13 07:44:44 -06:00
Dimitry Kloper
b48ca00cd5 The delay parameter has 'int' type while explicit int32_t is used in sigtimedwait() (sig_timedwait.c) This can lead to wrong argument for systems that have default int size different than int32 (namely AVR). 2016-01-05 07:58:04 -06:00
Gregory Nutt
c1fff4706c signals: Adds a very limited, minimal implementation for SIGEV_THREAD 2015-12-30 15:01:14 -06:00
Gregory Nutt
849df03d22 Update dates on files modified for SIGEV_THREAD support 2015-12-30 13:28:39 -06:00
Gregory Nutt
9835eeb181 signals: Basic framework to support SIGEV_THREAD 2015-12-30 13:20:31 -06:00
Gregory Nutt
198cfd0224 Forgot to add a file needed in the last commit 2015-12-22 12:06:05 -06:00
Gregory Nutt
b90da3f27b waitpid: CRITICAL BUGFIX. Add a reference counting mechansim to prevent wait from using stale memory that was freed by the exiting task 2015-12-22 11:48:17 -06:00
Gregory Nutt
8f540fd81a Trivial fix to typo in a comment 2015-12-21 22:24:43 -06:00
Gregory Nutt
a2e1ece873 RTC: Handle RTC failures. If mktime is called with garbage, it may crash 2015-12-21 14:39:40 -06:00
Gregory Nutt
e8d0f85c8b Modules: Add mod_setsymtab to set global symtol table once. Now we can remove symbol table parameters from the insmod call. This will make implementing an NSH insmod command much easier 2015-12-13 08:10:01 -06:00
Gregory Nutt
076f382f79 Module: Remove some unused members of a structure 2015-12-13 06:48:30 -06:00
Gregory Nutt
917dbc8540 modules: Add more information to registry just for procfs 2015-12-12 18:56:32 -06:00
Gregory Nutt
795ddd7e80 OS modules: Add basic procfs support. A module registry that will eventually be used to support lsmod 2015-12-12 17:42:25 -06:00
Gregory Nutt
a908a61c5a Various module-related cosmetic changes 2015-12-12 12:55:50 -06:00
Gregory Nutt
303123deb9 Add syscall support for insmod and rmmod 2015-12-12 11:11:09 -06:00
Gregory Nutt
040835de00 Add an implementation of rmmod 2015-12-12 10:51:54 -06:00
Gregory Nutt
9ef33d8ebc Merge remote-tracking branch 'origin/master' into module 2015-12-12 09:38:44 -06:00
Gregory Nutt
0efcb5445b Fix compile error when cache coherency logic is enabled 2015-12-12 09:38:06 -06:00
Gregory Nutt
49554fe4fc Move module support from binfmt/ to sched/ so that it can be configured and built independently from binfmt features 2015-12-12 07:09:17 -06:00
Gregory Nutt
f45e2a247e Cosmetic fix to comment 2015-12-11 10:06:40 -06:00
Gregory Nutt
c9925305b5 Same important bug as c623af03a0ee8ac041fc22051781047d6cb9cc75, but in a different location 2015-12-09 10:17:33 -06:00
Gregory Nutt
c16648b3fd Most cosmetic but also includes a fix for a compile problem from Ken Pettit 2015-12-01 12:54:57 -06:00
Gregory Nutt
48da5aa496 sched/pthread/: CRITICAL BUGFIX: Logic was wiping out the indication that of the type of a pthread. Hence, it could be confused as a task. Found because this was causing a crash when /proc/nnn/cmdline was printed. 2015-11-28 10:05:36 -06:00
Gregory Nutt
4b29bcee7f Rename up_rtcinitialize to up_rtc_initialize so that it looks like other RTC interfaces 2015-11-20 08:27:52 -06:00
Gregory Nutt
892ba4f26a DS1307: Change year bias to 1968 which is a leap year juse like 2000 2015-11-19 15:12:40 -06:00
Gregory Nutt
c34b5108a7 RTC: Fix system time initialization when using an exernal RTC. Fix some bugs in the DS1307/DS3231 RTC driver 2015-11-19 14:54:30 -06:00
Lok
da8950fe5b Fix an error in clock_timespec_subtract 2015-11-03 07:28:46 -06:00
Gregory Nutt
78ae661223 One more trivial spacing issue 2015-10-07 20:13:49 -06:00
Gregory Nutt
79d554939e sched/: Fix some spacing issues 2015-10-07 19:59:14 -06:00
Gregory Nutt
af086c40ff Remove dangling whitespace 2015-10-04 15:28:54 -06:00
Gregory Nutt
0b12dbf95d Fix some spacing problems 2015-10-04 15:04:00 -06:00
Gregory Nutt
16b32bbadd Standardize the width of all comment boxes in C files 2015-10-03 07:25:53 -06:00
Gregory Nutt
0f90500f72 Standardize the width of all comment boxes in header files 2015-10-02 17:48:24 -06:00
Gregory Nutt
5b51a9fcdd Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
Gregory Nutt
cb9e27c3b0 Standardize naming used for public data and function groupings 2015-10-02 16:30:35 -06:00
Gregory Nutt
a813baef0a User workqueue, cosmetic changes 2015-09-30 14:03:55 -06:00
Gregory Nutt
4cd57e1e4e Work queues: Logic that sets the queued indication and the logic that does the actual queuing must be atomic 2015-09-30 11:04:29 -06:00
Paul A. Patience
9f108b7b63 Fix issues detected by clang 2015-09-10 20:59:43 -04:00
Gregory Nutt
cb2f84e288 Loosen up restriction a little in sched_ufree() 2015-09-07 15:28:58 -06:00
Gregory Nutt
d78d3ef4ab Logic for delayed memory garbage collection for the case of user space memory will not work as implemented for the case of the kernel build. That is because the correct context is in place in order to free the user memory when sched_kufree is called, but will not be in place later when the memory garbage collection runs. If this feature is really needed, then some more substantial redesign is required 2015-09-07 14:40:18 -06:00
Paul A. Patience
3b89eabd50 Correct #if to #ifdef when the macro can be undefined. Fix bug in AT24XX driver: it should compare AT24XX_ADDRSIZE to 2. 2015-09-01 13:52:29 -04:00
Gregory Nutt
0b2fbd7a2c Fix a DEBUGASSERTion 2015-08-21 12:33:14 -06:00
Gregory Nutt
89b5ef8d35 wdogs: Fix counting of free, pre-allocated wdog timers. The could could get decremented below zero in some situations 2015-08-21 11:30:22 -06:00
Gregory Nutt
51f386d08a Fix more common typos 2015-08-16 11:07:23 -06:00
Gregory Nutt
768d892188 Add si_errno to siginfo_t 2015-08-14 10:10:32 -06:00
Sebastien Lorquet
89c81f6c08 FIX typo in DEBUASSERTion 2015-08-03 09:14:15 -06:00
Gregory Nutt
15db2a45a4 drivers/net/slip.c: Fix another compilation error 2015-08-02 07:20:36 -06:00
Gregory Nutt
3a109315ed Fix a logic error in last change to sem_tickwait() 2015-08-01 16:00:23 -06:00
Gregory Nutt
ffec6124f2 Add a start time to sem_tickwait() to account for any elapsed time before the timer is actually started 2015-08-01 14:57:31 -06:00
Gregory Nutt
030573ba5c More improvements to the sporadic scheduler 2015-08-01 09:08:48 -06:00
Gregory Nutt
12cbe147a0 Forget to add files before last commit 2015-08-01 07:34:27 -06:00
Gregory Nutt
2c66e0eb2a sem_tickwait(): Add a new, non-standard function to perform timed semaphore waits. It is functionally equialent to the standard sem_timedwait(), but more efficient for use in higher performance device drivers. Requested by Max Neklyudov 2015-08-01 07:31:09 -06:00
Gregory Nutt
5772813d29 Change the name of the local variable sigset to set to prevent name collisions with the function of the same name 2015-07-31 13:32:10 -06:00
Anton D. Kachalov
4a16bc6924 [sched/pthread/pthread_kill] Add missed header for enabled CONFIG_SCHED_HAVE_PARENT
Signed-off-by: Anton D. Kachalov <mouse@yandex-team.ru>
2015-07-30 18:51:37 +03:00
Gregory Nutt
3a93be8902 Add strictly limit check: The current sporadic scheduler cannot handler duties > 50% 2015-07-30 07:36:01 -06:00
Gregory Nutt
a6ccb7f308 Sporadic scheduler: Third design. Now it looks closer to what I want 2015-07-28 14:26:31 -06:00
Gregory Nutt
dd5b065753 Sporadic: This interim version works pretty well, but the things that I had to do were nasty and mean that -- sigh -- there will be another redesign coming 2015-07-28 08:03:40 -06:00
Gregory Nutt
95ca3a1d1e Fixes several more sporadic scheduler bugs 2015-07-27 18:08:21 -06:00
Gregory Nutt
a7322f5a6d Sporadic scheduler: Fix how suspension time is calculated 2015-07-27 15:54:19 -06:00
Gregory Nutt
e33c727520 Sporadic scheduler: Move pending time into each timer instance 2015-07-27 14:48:21 -06:00
Gregory Nutt
e66e2f5c0f Use the last budgeted time from the last timer started 2015-07-27 13:13:30 -06:00
Gregory Nutt
8c754ccd4f Sporadic scheduler: misc bug fixes 2015-07-27 11:55:52 -06:00
Gregory Nutt
cc1c7731da Sporadic scheduler: Fix budget computations when replenishment intervals are nested 2015-07-27 09:35:52 -06:00
Gregory Nutt
484f148001 Sporadic scheduler: Add instrumentation hooks to support GPIO outputs 2015-07-27 08:37:25 -06:00
Gregory Nutt
7c04ad8209 Sporadic scheduler: Cosmetic change to debug output and to comments 2015-07-26 15:33:27 -06:00
Gregory Nutt
99664b7811 Sporadic scheduler: Add logic to collection the partial timer expiration when a sporadic thread is suspended in tickless mode 2015-07-26 15:03:47 -06:00
Gregory Nutt
4bdbc387f5 Update TODO list; Fix a few errors introduced withe the last changes to the sporadic scheduler 2015-07-26 10:51:04 -06:00
Gregory Nutt
3e88b77540 Sporadic scheduler: Handle a case when the scheduler is resumed before it has even had a chance to run 2015-07-26 08:08:45 -06:00
Gregory Nutt
26fd7a7ccf The redesigned sporadic scheduler now seems to be functional 2015-07-25 13:22:46 -06:00
Gregory Nutt
27e21710fd This is basically a complete redesign of the sporadic scheduling logic due to limitations in the initial design 2015-07-25 12:50:53 -06:00
Gregory Nutt
a1031417e8 Comment out part of sporadic scheduler logic: Part of replenishment logic is bogus 2015-07-24 18:18:58 -06:00
Gregory Nutt
1d88dc1fb6 Fix some compilation error when both TICKLESS mode and the SPORADIC scheduler are enabled 2015-07-24 14:35:07 -06:00
Gregory Nutt
ed031388ad sched/Kconfig: The sporadic scheduler option is no longer EXPERIMENTAL 2015-07-24 14:19:18 -06:00
Gregory Nutt
411941d8cd Fix an syntax error in a debug asserion 2015-07-24 13:02:19 -06:00
Gregory Nutt
12cdd2a8fe Fix some bad conditional compilation 2015-07-24 12:27:15 -06:00
Gregory Nutt
0d71260bf2 sched/: Separate the round-robin logic into a separate file so that it is symmetric with the sporadic stuff. Integrate the sporadic scheduler into the time tick interrupt handling and into the tickless operation. 2015-07-24 11:49:28 -06:00
Gregory Nutt
c6c424583d Fix a test for valid scheduling policies 2015-07-24 10:20:22 -06:00
Gregory Nutt
4490744def Add logic to reset the replenish the sporadic scheduler when a task is resumed 2015-07-24 09:55:02 -06:00
Gregory Nutt
ea7dbc984b Add basic sporadic schedule state machine 2015-07-24 09:03:21 -06:00
Gregory Nutt
3b1306078b Sporadic Scheduler: Ensure that the replenishment period is greater than or equal to the budget period 2015-07-23 15:08:41 -06:00
Gregory Nutt
5baa738019 Most cosmetic, but includes some fixes to some range checking 2015-07-23 14:36:49 -06:00
Gregory Nutt
53a17bfd99 Fix a newly introduced compilation error when round roben scheduling is disabled 2015-07-23 13:35:48 -06:00
Gregory Nutt
9095e8eab4 include/, sched/, and libc/: Add support for sporadic scheduling parameters in struct sched_param, posix_spawnattr_t, and pthread_attr_t. Update all user interfaces to pass sporadic scheduling parameters. Feature is dependent on EXPERIMENTAL and no changes have yet been made to core scheduling logic. 2015-07-23 13:16:32 -06:00
Gregory Nutt
13e837b957 Merge remote-tracking branch 'origin/master' into sporadic 2015-07-23 11:25:52 -06:00
Gregory Nutt
aa90da2bc8 pthread_create: Fix an (unlikely) error in fallback value in the event of a failure (which should never occur) 2015-07-23 11:25:25 -06:00
Gregory Nutt
2b3aae0ddc Add basic configuration options for SCHED_SPORADIC 2015-07-23 10:33:30 -06:00
Gregory Nutt
146bdc3c93 TCB: Increase the size of the scheduling policy field from 1 to 2 bits to allow additional, planned scheduling policies 2015-07-23 10:15:07 -06:00
Gregory Nutt
e69d14d89b Fix some warnings/errors detected by nuttx/tools/testbuilds.sh 2015-07-10 18:41:26 -06:00
Max Neklyudov
14e742b108 Implement WNOHANG for waitpid() only and for the case of CONFIG_SCHED_HAVE_PARENT not selected. From Max Neklyudov. 2015-07-02 09:34:58 -06:00
Jussi Kivilinna
13d9383679 Group binding needs to be cleared before sched_releasetcb(), as otherwise group_leave() will be called and group->tg_nmembers decremented or group being released. group_leave() should be called only after group_join() is called, not after group_bind(). From Jussi Kivilinna. 2015-07-01 06:24:34 -06:00
Gregory Nutt
342f5fe33d Fix references to the no-longer-existent misc/ directory in comments, README files, and documentation 2015-06-28 08:08:57 -06:00
Max Neklyudov
61af0d511f Use up_timer_gettime for CLOCK_MONOTONIC in tickless mode. From Max Neklyudov. 2015-06-22 06:37:26 -06:00
Juha Niskanen
e1846dff82 sched/pthread: Implement pthread_mutex_trylock() for recursive mutexes 2015-06-16 08:32:20 -06:00
Juha Niskanen
d16053c33c sched/pthread: Use -1 instead of 0 as PID for unclaimed mutexes 2015-06-16 08:27:38 -06:00
Gregory Nutt
d8db596b3b POSIX message queues: Move mq_setattr() and mq_getattr() from nuttx/libc/mqueue to nuttx/sched/mqueue. Also add sysyscall support for mq_setattr() and mq_getattr(). This is necessary in protected and kernel builds because in those cases the message queue structure is protect and cannot be accessed directly from user mode code. Noted by Jouko Holopainen. 2015-06-03 09:24:17 -06:00
Gregory Nutt
84f0303fc0 mq_timedreceive() move the location where the errno value is set; the TIMEDOUT errno setting was being overwritten by subsequent actions before returning. Noted by Freddie Chopin. 2015-06-03 07:24:50 -06:00
Gregory Nutt
4adda9d428 Fix numerous typos in configuration variable names. Tracked down by Alan Carvalho de Assis 2015-05-23 17:08:35 -06:00
Gregory Nutt
3adcae8ffb Update the type passed to watchdog timer handlers. Using uint32_t is a problem for 64-bit machines. 2015-05-18 08:53:42 -06:00
Gregory Nutt
16276a4793 Change the order of some operations to prevent a debug assertion from firing. 2015-05-18 06:34:54 -06:00
Gregory Nutt
cc77a28f40 If HAVE_GROUP_MEMBERS is not defined, then pthread_kill() really is the same as kill() 2015-05-13 20:34:21 -06:00
Gregory Nutt
4417728955 Re-implemened pthread_kill(). It as just a simple wrapper around kill() but since the correct dispatching of singles for multi-threaded task groups has been implemented, calling kill() does no work. The corrected implementation of pthread_kill() will direct the signal specifically to the specific pthread and no other. 2015-05-13 14:43:43 -06:00
Gregory Nutt
8cb4e78a1a Complete implementation of the IPv6 routing logic. From Max Neklyudov. 2015-05-13 07:22:02 -06:00
Gregory Nutt
071658bb6d Another missing semicolon 2015-04-23 07:18:59 -06:00
Gregory Nutt
093a144934 sem_wait(): Missing comma on debug statement caused compile error with DEBUG on. Why hasn't that been noted before? 2015-04-23 07:15:55 -06:00
Gregory Nutt
f161a1d0f7 atexit: Fix reference to undefined variable in certain configurations. From Juha Niskanen 2015-04-14 07:31:35 -06:00
Gregory Nutt
b4423c1eed Make some file section headers more consistent with standard 2015-04-08 06:47:36 -06:00
Gregory Nutt
af6d9e2684 sched: Do not use uninitialized boolean in waitpid(). From Juha Niskanen 2015-03-12 07:45:10 -06:00
Gregory Nutt
caea44a624 Fix a case in mq_timedsend() where the return errno value was being overwritten 2015-03-10 12:05:33 -06:00
Gregory Nutt
7d46801f46 Reorder some operations to minimize a race condition 2015-03-10 10:41:21 -06:00
Gregory Nutt
4c6057eca1 mq_timedsend(): Do check for time errors if the message queue is not full. Noted by Freddie Chopin 2015-03-10 09:42:35 -06:00
Gregory Nutt
12d61531aa Move board_ prototypes from arch.h to board.h 2015-02-27 20:02:03 -06:00
Gregory Nutt
127951e029 Fix places where the errno value was being overwritten by subsequent actions so that the returned errno value was incorrect. From Max Neklyudov. 2015-02-25 07:45:04 -06:00
Gregory Nutt
c99d927527 When an RTC is used, clock_systimespec() must subtract the basetime from the RTC time 2015-02-25 07:24:03 -06:00
Gregory Nutt
cded7ea682 Fix some time value changes; mostly changing greater than 1000000000 to greater than or equal to 1000000000. From Juha Niskanen 2015-02-20 07:07:36 -06:00
Gregory Nutt
8840102554 Networking: Divide net_intiialize() into net_setup() and net_initialize() to solve a chicken-and-egg problem. net_setup() must be caleld before up_initialize() is called so that networking data structures are ready to register new network devices.
net_initialize() now does only timer related operations and is called AFTER up_initialize() where the timers are configured.  This is really.
2015-02-14 06:36:53 -06:00
Gregory Nutt
a1d3faaa8a Update ChangeLog 2015-02-13 18:39:43 -06:00
Gregory Nutt
bc273596bb Back out commit d998cbdfa6c10dbd8074dd43c39c23a006505987 2015-02-13 18:32:15 -06:00
Gregory Nutt
0fcd620404 Move the initialization of the networking subsystem to AFTER up_initialize is called. Fromo Macs Neklyudov. 2015-02-13 13:41:21 -06:00
Gregory Nutt
3724a5e98e RTC: Remove all backdoor interfaces from rtc.h 2015-02-13 08:41:34 -06:00
Gregory Nutt
d9f960e97b Fix a problem in clock_systimer64 that occurs when (1) the 64-bit system time is enabled, and (2) the value of CONFIG_USEC_PER_TICK is less than 1 millisconds (such as when using the tickless mode of operation). In that case, the convertion of time to 64-bit millisecond value in clock_systmer64() causes some bad times to be returned. Time was converted to milliseconds, then to configured ticks. Precision was lost in the millisecond convertion.
The fix is to first convert time to a 64-bit microsecond value, then to the configured tick value.

Noted by David Sidrane.
2015-02-13 06:13:47 -06:00
Gregory Nutt
147042218b gettimeofday() and settimeofday(): Move gittimeofdady() from sched/clock to libc/time. All remove gettimeofday() from NuttX system calls. It is only a wrapper around clock_settime() and does not need a trap. gettimeofday() is no longer tried as a core OS interface.
gettimeofday has been decremented in POSIX 2008.  settimeofday() was never part of POSIX, but I decided to add it to libc as well just for symmetry.
2015-02-12 11:10:46 -06:00
Gregory Nutt
1d534ff896 Convert the 64-bit usec limit to a 32-bit tick limit 2015-02-03 07:18:17 -06:00
Gregory Nutt
c5ab7c39d3 Eliminates a warning. From Macs N 2015-02-03 06:44:59 -06:00
Gregory Nutt
a448e0f69f On my platform I have just 16-bit timer clocked at 32kHz. As result oneshot timer max delay is 2s. The patch adds limit of maximum ticks in sched_timer_start (nuttx/sched/sched/sched_timerexpiration.c). From Macs N. 2015-02-03 06:25:19 -06:00
Gregory Nutt
e69003cbf7 clock_systimespec(): Fixes for compilation errors in certain configurations. From Macs N. 2015-01-30 08:19:40 -06:00
Gregory Nutt
6bc9a0c9c6 Fix backward calculation in the work queue timing. From Liio Chen via the PX4 repository 2015-01-27 06:17:02 -06:00
Gregory Nutt
826f5516ff Semaphores: sem_waitirq.c must be built when signals are disabled. That is because not handles not only the case of semaphore wait being awakened by a signal, but also the case with sem_timedwait.c when the semaphore wait is awakened by a timeout. 2014-12-28 15:03:12 -06:00
Gregory Nutt
78b755961f Semahores: Remove a warning with SIGNALS are disabled 2014-12-28 14:54:40 -06:00
Gregory Nutt
937f9f23f1 strncpy will not copy the terminating \0 into the destination if the source is larger than the size of the destination. Ensure that the last byte is always zero and let strncpy only copy CONFIG_TASK_NAME_SIZE bytes. The issue of unterminated names can be observed in ps when creating a pthread while CONFIG_TASK_NAME_SIZE is set to 8. 2014-12-17 12:24:02 -06:00
Gregory Nutt
b3a1939020 Sempahores: Add logic to clean up after task_delete() or pthread_cancel() if the task happens to be waiting on a semaphore when it is cancelled 2014-12-13 12:02:25 -06:00
Gregory Nutt
1003ee3e9a Costmetic change to a comment 2014-12-13 10:41:57 -06:00
Gregory Nutt
ff87e2e02a In message queue created return ENOSPC error if size exceeds the configured size of pre-allocatd messages; Use ENOSPC vs ENOMEM per OpenGroup.org. From Pierre-Noel Bouteville 2014-12-06 07:18:48 -06:00
Gregory Nutt
ad05793c0f msg type should be char * not void * in mq_send, mq_timedsend, mq_receive, and mq_timedreceive. Noted by Pierre-Noel Bouteville 2014-12-05 19:16:14 -06:00
Gregory Nutt
2ab604f74f Fix more issues detected by cppcheck 2014-11-25 14:25:02 -06:00
Gregory Nutt
1aa528a572 More fixes to problems noted by cppcheck. Some are kind of risky; some are real bugs. 2014-11-25 14:10:35 -06:00
Gregory Nutt
6f94e5e4be Cosmetic chnages to comments 2014-11-20 07:10:48 -06:00
Gregory Nutt
8c28718bcb alling mq_timedreceived with immediate timeout was getting stuck and not
timeout. Immediate timeout is achieved by setting absolute timeout value to
past time, for example abstime={ .tv_sec=0, .tv_nsec=0 }. However absolute
time was converted to relative time using unsigned integer arithmetic and
resulted large ticks count by clock_abstime2ticks, instead of expected negative
ticks value.

Patch corrects clock_abstime2ticks to return negative ticks, if absolute time
is in the past.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@haltian.com>
2014-11-19 09:25:00 -06:00
Gregory Nutt
9e290c10b5 Fix some compile issues introduces with removal of CONFIG_MAX_TASK_ARGS 2014-11-14 09:53:11 -06:00
Gregory Nutt
838f2053e4 Fix some compile errors introduce in last commits 2014-11-13 07:44:45 -06:00
Gregory Nutt
bc265d74e7 task_create: Don't even try if the accumulated size of the argument list is larger than the stack 2014-11-13 06:44:15 -06:00
Gregory Nutt
bb9b0f572d vfork no longer depends on CONFIG_MAX_TASK_ARGS 2014-11-12 19:01:29 -06:00
Gregory Nutt
4638a97f97 task_start() no longer depends on CONFIG_MAX_TASK_ARGS 2014-11-12 18:54:35 -06:00
Gregory Nutt
ffbd6cf10a task_setup() no longer depends on CONFIG_MAX_TASK_ARGS 2014-11-12 18:49:58 -06:00
Gregory Nutt
fcffafee30 Remove CONFIG_MAX_TASK_ARGS from all Kconfigs and defconfigs 2014-11-12 18:02:19 -06:00
Gregory Nutt
2caeead612 Fix an important bug in the watchdog creation logic 2014-11-10 18:15:26 -06:00
Gregory Nutt
fcc2a1bb4b Fix incorrect comment 2014-11-07 15:54:24 -06:00
Gregory Nutt
2da26f7884 More fixes to tickless operation, alarm/mode code. From Brandon Warhurst 2014-10-23 07:13:57 -06:00
Gregory Nutt
a7a5c8cff3 Fixes to tickless operation code. From Brandon Warhurst 2014-10-23 06:41:31 -06:00
Gregory Nutt
928b0bda3d Default for CONFIG_SCHED_HPWORK should be no 2014-10-14 16:56:37 -06:00
Gregory Nutt
179fabb019 Add description of work queues to the porting guide. Update comments 2014-10-14 10:21:18 -06:00
Gregory Nutt
c9563da832 Missing workqueue logic 2014-10-12 17:19:51 -06:00
Gregory Nutt
e702d9396b Fix one missed name change from last big commit 2014-10-12 07:09:57 -06:00
Gregory Nutt
c9d7472d68 Change naming of HP work queue configuration varaibles to be symmetric with LP work queue naming 2014-10-11 17:03:44 -06:00
Gregory Nutt
1a27a4d4c0 Eliminate warnings 2014-10-11 17:02:35 -06:00
Gregory Nutt
b78fe7c270 Rename CONFIG_SCHED_USRWORK to CONFIG_LIB_USRWORK 2014-10-11 15:59:40 -06:00
Gregory Nutt
9292e3d9de Decouple the user-space work queue from the kernel space work queues 2014-10-11 15:50:22 -06:00
Gregory Nutt
bb1d91bd83 Make building of low-priority work queue independent of also building the high-priority work queue 2014-10-11 14:43:24 -06:00
Gregory Nutt
c0b703ac73 Fix some missing conditional compilation that caused build failures in some configurations 2014-10-11 08:50:00 -06:00
Gregory Nutt
d2424ac65c Fix a couple of problems introduced in the last commmits 2014-10-11 08:29:26 -06:00
Gregory Nutt
0218f01f12 If there mutliple low-priority worker threads, only one needs to perform garbage collection 2014-10-11 07:09:21 -06:00
Gregory Nutt
234f73cb09 Add logic for priority inheritance with multiple worker threads. How should this work? Tentatively, the all get reprioritized together. It would be best to just reprioritize the single thread doing the high priority work, but we don't know which that will be in advance 2014-10-10 17:47:39 -06:00
Gregory Nutt
4a4b3ac537 Add support for multiple low-priority worker threads 2014-10-10 16:24:50 -06:00