Gregory Nutt
399f306744
A few cosmetic changes
2017-03-11 08:58:42 -06:00
David Sidrane
6cc8f9100b
Priority Inversion fixes:typo
2017-03-10 06:37:46 -10:00
Gregory Nutt
360539afac
Priority inheritance: When CONFIG_SEM_PREALLOCHOLDERS==0, there is only a single, hard-allocated holder structure. This is problem because in sem_wait() the holder is released, but needs to remain in the holder container until sem_restorebaseprio() is called. The call to sem_restorebaseprio() must be one of the last things the sem_wait() does because it can cause the task to be suspended. If in sem_wait(), a new task gets the semaphore count then it will fail to allocate the holder and will not participate in priority inheritance. This fix is to add two hard-allocated holders in the sem_t structure: One of the old holder and one for the new holder.
2017-03-10 09:30:15 -06:00
Gregory Nutt
a93e46d00c
Cosmetic
2017-03-10 08:54:50 -06:00
Gregory Nutt
c976a66f8d
net/drivers/skeleton.c: Back out serialization changes of the last commit. They are not necessary in the skeleton.c example because the calls to net_lock() at the beginning of each worker function will enforce serialization.
2017-03-04 11:33:36 -06:00
Gregory Nutt
b55a98e900
Olimex-STM32-P407: Enable task names
2017-03-04 08:49:24 -06:00
Gregory Nutt
47ebe1e320
Update some comments
2017-03-03 12:48:58 -06:00
Gregory Nutt
e1218c4b4b
Smaller vector tables: Add irq_mapped_t.
2017-03-03 10:20:40 -06:00
Gregory Nutt
04c9ccdd2d
Update TODO list and some Kconfig comments.
2017-03-03 09:20:25 -06:00
Gregory Nutt
c2b620b4f8
Implements support for smaller interrupt tables as described at http://www.nuttx.org/doku.php?id=wiki:howtos:smallvectors . This is largely the work of Mark Schulte. However, I have made several changes to match with the Wiki document. If you like the change, thanks go to Marc. For any errors you can blame me.
2017-03-03 09:20:25 -06:00
Masayuki Ishikawa
d78113e4ad
Revert "CONFIG_START_YEAR/MONTH/DAY not required if an RTC is used"
...
This reverts commit 4035ed8c6c
.
2017-03-03 10:42:10 +09:00
Masayuki Ishikawa
54b1f5ce2a
Merged in masayuki2009/nuttx.nuttx/remove_unused_variable (pull request #233 )
...
Remove unused variable
Approved-by: Gregory Nutt
2017-03-02 12:39:32 +00:00
Gregory Nutt
094795e0ed
Review parameter usage in sigtimedwait(); update some comments.
2017-03-02 06:39:05 -06:00
Masayuki Ishikawa
237e041fba
Remove an unused variable when calling sigwaitinfo()
2017-03-02 13:14:00 +09:00
Masayuki Ishikawa
4043239cfc
Remove an unused variable when calling sigtimedwait()
2017-03-02 13:13:53 +09:00
Gregory Nutt
02b1e1ec1a
Fixes for coding standard: '*' needs to 'snuggle' with following variable name
2017-02-28 18:22:57 -06:00
Gregory Nutt
840c5935a3
Correct a typo from one of the preceding commits.
2017-02-27 11:58:20 -06:00
Mark Schulte
b3222bbc8a
irq_dispatch: Add argument pointer to irq_dispatch
...
Provide a user defined callback context for irq's, such that when
registering a callback users can provide a pointer that will get
passed back when the isr is called.
2017-02-27 06:27:56 -06:00
Gregory Nutt
4dbc0a27c6
pthread_create: g_pthreadname[] is not used if CONFIG_TASK_NAME_SIZE==0.
2017-02-26 18:15:16 -06:00
Gregory Nutt
12a4a58aa6
Update some wdog-related comments
2017-02-24 10:58:37 -06:00
Gregory Nutt
dca77fa06a
sigtimedwait: When timer expires, up_unblock_task() is called. This is okay in the single CPU case because interrupts are disable in the timer interrupt handler. But it is insufficient in the SMP case. enter_ and leave_critical_section() must be called in order to manage spinlocks correctly.
2017-02-24 10:07:23 -06:00
Gregory Nutt
cb7c5f9921
Implement strings.h macros as inline functions when possible for better C++ compatibility.
2017-02-22 10:20:58 -06:00
Gregory Nutt
4f5879f998
C library: Add ffs(). Add strings.h. Move strcasecmp, strncasecmp, bzero, bcmp, and bcopy to where they belong in strings.h.h, not string.h. bzero, bcmp, and bcopy are legacy functions; the contemporary counterparts should be used instead.
2017-02-16 16:10:09 -06:00
Gregory Nutt
74189d84e2
Cancellation points: Fix some backward logic in conditional compilation.
2017-02-02 06:42:41 -06:00
Gregory Nutt
e0f199e42e
Missing semicolon in previous commit
2017-01-31 14:18:20 -06:00
Gregory Nutt
154873a3d0
Timer logic: Add private function prototypes to eliminate a warning; Functions should not be inline because the may recurse.
2017-01-31 13:45:22 -06:00
Gregory Nutt
e30b2617e3
Shared Libs: Implement module based shared libraries for the PROTECTED mode build
2017-01-29 13:03:53 -06:00
Gregory Nutt
2c45f482b1
Module names are not needed in libc/modlib when the module library is used only for shared library support.
2017-01-29 12:23:24 -06:00
Gregory Nutt
86bdd0a4c7
Modules: Move last of many C files from sched/module to libc/modlib
2017-01-29 11:54:54 -06:00
Gregory Nutt
6da66fb5c8
Modules: Move next five of many C files from sched/module to libc/modlib
2017-01-29 11:17:29 -06:00
Gregory Nutt
5e94dd22bb
Modules: Move first five of many C files from sched/module to libc/modlib
2017-01-29 10:05:15 -06:00
Gregory Nutt
00e46b5966
Move gnu-elf.ld from sched/module to libc/modlib. Update paths in Make.defs files to account for new location of file
2017-01-29 09:03:01 -06:00
Gregory Nutt
2717e781f0
libc/modlib: Add build a configuration logic for a shared module library.
2017-01-29 08:55:27 -06:00
Gregory Nutt
b79ca9dcdd
Modules: Move sched/module/module.h to include/nuttx/lib/modlib.h
2017-01-29 08:24:42 -06:00
Gregory Nutt
68a7110195
sched/modules: Add support for dependencies between modules.
2017-01-27 11:43:27 -06:00
Gregory Nutt
6a4880f415
SMP: Fix timer related issues: Round robin and sporadic scheduling were only being performed for tasks running on the CPU that processes the system timer interrupt. Similary, CPU load measurements were only be processed for running on the CPU that receives the sampling interrupt.
2017-01-23 12:14:01 -06:00
Gregory Nutt
4574a1ca42
Modules: Extend the module interface so that we can access symbols exported by the module.
2017-01-22 14:26:22 -06:00
Gregory Nutt
d90e66a024
Kernel Modules: Module initializer may now return a symbol table (not yet used for anything)
2017-01-22 11:37:49 -06:00
Gregory Nutt
1823c78663
Update some comments
2017-01-22 10:17:51 -06:00
Gregory Nutt
686041f8e7
CPU load: Correct computation of the nominal period to use when the source is a oneshot timer.
2017-01-22 07:12:22 -06:00
rg
1e38884088
Fix a compile error: in sched_cpuload.c:Line136, the variables ts and secs are not defined if CONFIG_CPULOAD_ONESHOT_ENTROPY = 0. However, these variables are used regardless of CONFIG_CPULOAD_ONESHOT_ENTROPY at lines~180:onwards.
2017-01-22 06:48:11 -06:00
Gregory Nutt
edd9186540
ELF: Move ARMv7-A and ARMv7-R versions of ELF relocation logic to libc/machine
2017-01-21 14:40:26 -06:00
Gregory Nutt
fba247b119
Update some comments
2017-01-13 16:32:09 -06:00
Gregory Nutt
99bb2dda5d
i.MX6: Corrects behavior of last SMP patch with i.MX6
2017-01-13 12:29:57 -06:00
Gregory Nutt
a51b5b7e17
Add REVISIT to comments.
2017-01-13 09:40:17 -06:00
Gregory Nutt
37e6e6a52e
Eliminate a warning
2017-01-13 06:56:13 -06:00
Gregory Nutt
9ce4022096
SMP: Fix an error in critical section logic when performing a context switch from an interrupt handler. The g_cpu_irqset bit was not being set for the CPU so other CPUs did not know about the critical section.
2017-01-13 06:48:10 -06:00
Masayuki Ishikawa
acbfa47f70
sched_note: Fix spinlock instrumentation
2017-01-12 08:04:28 -06:00
Gregory Nutt
d5b1ca14e2
Update README and some comments.
2017-01-02 13:54:07 -06:00
Gregory Nutt
04557a1198
Eliminate a warning
2016-12-31 14:47:32 -06:00
Gregory Nutt
8f716a386b
SMP: Use irq_cpu_locked() in sched_removereadytorun() and sched_setpriority()
2016-12-29 10:40:58 -06:00
Gregory Nutt
af92a67fc5
SMP: Use irq_cpu_locked() in sched_mergepending()
2016-12-29 08:53:31 -06:00
Gregory Nutt
e7d2b9f0e8
SMP: Move sharable function to common file as irq_cpu_locked(). Use irq_cpu_locked() in sched_unlock()
2016-12-29 08:17:10 -06:00
Gregory Nutt
96394f339e
SMP: Fix a gap where we may try to make modifications to the task lists without being in a critical sections. That permits concurrent access to the tasks lists and many subtle problems. This fix just remains in the critical section throughout the operation (and possible until the task is restore in the event of a context switch). Makes a big difference in stability
2016-12-28 13:58:24 -06:00
Gregory Nutt
88da65ad8a
sched_cpulocked: Avoid use of spinlock. That has been reported to cause a deadlock.
2016-12-28 12:10:17 -06:00
Gregory Nutt
72490f84e6
SMP: Make checks for CPU lock set more robust. There are certains conditions early in initialization on during interrupt handling where things need to be done a little differently.
2016-12-28 10:21:05 -06:00
Gregory Nutt
cfb876263a
SMP: There were certain conditions that we must avoid by preventing releasing the pending tasks while withn a critical section. But this logic was incomplete; there was no logic to prevent other CPUs from adding new, running tasks while on CPU is in a critical section.
...
This commit corrects this. This is matching logic in sched_addreadytorun to avoid starting new tasks within the critical section (unless the CPU is the holder of the lock). The holder of the IRQ lock must be permitted to do whatever it needs to do.
2016-12-27 08:49:07 -06:00
Gregory Nutt
e0f3f4ae19
Update some coments
2016-12-26 16:12:27 -06:00
Gregory Nutt
849a5dc2a9
SMP: Enforce this rule: Tasks which are normally restored when sched_unlock() is called must remain pending (1) if we are in a critical section, i.e., g_cpu_irqlock is locked , or (2) other CPUs still have pre-emption disabled, i.e., g_cpu_schedlock is locked. In those cases, the release of the pending tasks must be deferred until those conditions are met.
2016-12-26 08:15:02 -06:00
Gregory Nutt
d45a81d643
Revert "SMP: Fix a error introduced in 36b676eea6
and fully decouple disabling of pre-emption from critical sections."
...
This reverts commit 9aedf1bdec
.
2016-12-26 07:48:22 -06:00
Gregory Nutt
9aedf1bdec
SMP: Fix a error introduced in 36b676eea6
and fully decouple disabling of pre-emption from critical sections.
2016-12-25 06:54:43 -06:00
Gregory Nutt
efb86382c3
SMP: Back out deferred IRQ locking. This was accidentally merged into master and it looks like it is going to be more work than I thought to get it working again. Changes will go to the irqlock branch.
2016-12-24 19:53:37 -06:00
Gregory Nutt
3af6b2a9a6
Update a comment
2016-12-24 19:01:07 -06:00
Gregory Nutt
f55bad863b
SMP: Fix logic error in last change: Deferred restoration of IRQ lock only applies if the context switch was on this CPU.
2016-12-24 18:52:58 -06:00
Gregory Nutt
36b676eea6
SMP sched_unlock: Should merging depend on g_cpu_irqlock or not? Let's at least be consistent. And don't use irqcount; use g_cpu_irqlock.
2016-12-24 13:45:11 -06:00
Gregory Nutt
d75a7643d0
Fix a trivial typo
2016-12-23 13:01:20 -06:00
Gregory Nutt
e6fff09ef8
Implement deferred IRQ locking. So far only form ARMv7-M.
2016-12-23 07:55:41 -06:00
Gregory Nutt
d648f9c8b4
Add task_testcancel()
2016-12-10 16:34:14 -06:00
Gregory Nutt
f132960789
Add task_setcanceltype()
2016-12-10 16:06:14 -06:00
Gregory Nutt
5fb207eb36
Add task_setcancelstate()
2016-12-10 15:16:46 -06:00
Gregory Nutt
698597a838
task_delete() now obeys all cancellation point semantics.
2016-12-10 14:39:19 -06:00
Gregory Nutt
6997cda1b5
Grrr... cloned typos!
2016-12-10 09:45:55 -06:00
Gregory Nutt
842ec7e612
ifdef out some non-reachable code
2016-12-10 09:43:04 -06:00
Gregory Nutt
b52e4e5ecd
Move cancellation point definitions to their own header file.
2016-12-10 09:08:26 -06:00
Gregory Nutt
bc3ca25cc7
Cancellation points: Close up some logic to eliminte some race conditions.
2016-12-10 08:36:58 -06:00
Gregory Nutt
e62b3bccd3
pthread_setcanceltype() and pthread_testcancel() do not have to be system calls if cancellation points are not enabled.
2016-12-10 07:40:48 -06:00
Gregory Nutt
a0f567f4a3
Update TODO, cosmetic changes, spelling -- US English spells it canceled and canceling vs cancelled and cancelling. No idea why.
2016-12-09 18:39:40 -06:00
Gregory Nutt
018eb7c1d2
Cancellation points no longer depend on EXPERIMENTAL
2016-12-09 17:44:37 -06:00
Gregory Nutt
a76e729b0d
Trivial, cosmetic
2016-12-09 17:27:57 -06:00
Gregory Nutt
113d8bdcca
Fix some SMP-related compilation errors
2016-12-09 17:10:59 -06:00
Gregory Nutt
78cdc9f113
Fix a typo in a debug assertion.
2016-12-09 16:59:10 -06:00
Gregory Nutt
7ee0862e67
Merge remote-tracking branch 'origin/master' into cancelpt
2016-12-09 16:54:15 -06:00
Gregory Nutt
b07964461e
pthread_mutex_destroy(): Fix an error in destorynig a mutex which can occur after a pthread has been canceled while holding the mutex.
2016-12-09 16:53:29 -06:00
Gregory Nutt
7fce8022c6
Finishes all cancellation point logic
2016-12-09 16:50:34 -06:00
Gregory Nutt
d8783a7345
Update Documentation
2016-12-09 14:41:54 -06:00
Gregory Nutt
3eba0acb1c
More cancellation points.
2016-12-09 13:49:36 -06:00
Gregory Nutt
c9ca97b4b5
cancellation points are basically function. More tested is needed and additional cancellation points must be implemented before this can be merged back to master.
2016-12-09 12:01:18 -06:00
Gregory Nutt
018db84567
Flesh out more cancellation point logic.
2016-12-09 10:31:40 -06:00
Gregory Nutt
d35e589d56
Flesh basic cancellation point support
2016-12-09 09:44:23 -06:00
Gregory Nutt
82a79b9c1b
Add framework for cancellation point support.
2016-12-09 08:13:28 -06:00
Gregory Nutt
acaae12e8b
Add pthread_testcancel(), pthread_testcancel(), and definitiions for cancellation types.
2016-12-09 07:23:00 -06:00
Gregory Nutt
6224e47533
pthread cleanup stack: Replace critical section with sched_lock/unlock(). The cleanup stack modification only needs to have the TCB stationary. The stack is never modified from interrupt level logic
2016-12-08 14:33:02 -06:00
Gregory Nutt
ab43681f15
Update TODO and some comments.
2016-12-08 10:24:40 -06:00
Gregory Nutt
a1fbc2ad0d
pthreads: Add pthread_cleanup_push() and pthread_cleanup_pop()
2016-12-08 09:27:13 -06:00
Gregory Nutt
7632dfd6c7
Update some comments.
2016-12-08 07:52:02 -06:00
Gregory Nutt
a7b688e87b
sched notes: Add additional note to see if/when CPU is started in SMP mode.
2016-12-07 09:08:20 -06:00
Gregory Nutt
9ed0387379
Olimex-LPC1766-STK: Enable procfs in NSH configuration. Automount /proc on startup.
2016-12-05 08:52:40 -06:00
Masayuki Ishikawa
13c9031a8d
Fix DEBUGASSERT() in group_signal.c
2016-12-04 06:52:08 -06:00
Gregory Nutt
b78c3fcc30
Finish backing out previous change
2016-11-30 08:13:43 -06:00
Gregory Nutt
e6eb2e8bfa
Back out the last change. I just noticed some complexities that need to be verified before this is released onto the world.
2016-11-30 07:41:48 -06:00