Commit Graph

49 Commits

Author SHA1 Message Date
Gregory Nutt
69e9f8638d Most interrupt handling logic interacts with tasks via standard mechanism such as sem_post, sigqueue, mq_send, etc. This all call enter_critical_section and are assumed to be safe in the SMP case.
But certain logic interacts with tasks in different ways.  The only one that comes to mind are wdogs.  There is a tasking interface that to manipulate wdogs, and a different interface in the timer interrupt handling logic to manage wdog expirations.

In the normal case, this is fine.  Since the tasking level code calls enter_critical_section, interrupts are disabled an no conflicts can occur.  But that may not be the case in the SMP case.  Most architectures do not permit disabling interrupts on other CPUs so enter_critical_section must work differently:  Locks are required to protect code.

So this change adds locking (via enter_critical section) to wdog expiration logic for the the case if the SMP configuration.
2016-11-18 13:57:30 -06:00
Gregory Nutt
78fd358023 Update some comments. 2016-11-18 08:20:52 -06:00
Gregory Nutt
8602e8a8a9 SMP: irq_csection() has a bad assumption. It assumed that the state of certain variables. That was true on entry into the interrupt handler, but might change to the execution of logic within the interrupt handler. 2016-11-18 07:38:16 -06:00
Gregory Nutt
8e029f019b Update comments 2016-11-17 17:30:12 -06:00
Gregory Nutt
47b52a2633 Fix an error in manually bringing in Sebastien's changes; Update some comments. 2016-11-17 16:15:06 -06:00
Gregory Nutt
9acd57c819 Fix up some naming and update some comments. 2016-11-17 15:50:39 -06:00
Gregory Nutt
558f4049d4 sched/irq/irq_csection: Fix a bad DEBUG assertion when SMP is enabled. 2016-11-17 15:36:27 -06:00
Gregory Nutt
2c314464a8 Fix a typo in a comment 2016-11-17 08:03:45 -06:00
Gregory Nutt
ccdc11d8ff Fix typo in variable naming. g_cpu_irqset should be g_cpu_irqlock. 2016-11-17 06:37:24 -06:00
Gregory Nutt
1c1564f0c1 Add logic to handled nested calls to enter_critical_section() from interrupts handlers (with SMP). 2016-11-16 22:45:08 -06:00
Gregory Nutt
0c3207e86e Fix backward logic in an assertion. 2016-11-16 21:48:27 -06:00
Gregory Nutt
16f0b8fa96 Fix typos in DEBUASSERT statements 2016-11-16 19:58:51 -06:00
Gregory Nutt
f1e4951a8d Fix some comments 2016-11-16 19:11:31 -06:00
Gregory Nutt
4ca653a1cc Add some experimental changes to enter/leave_critical_section to deal with the case where interrupts are disabled only on the local CPU 2016-11-16 18:28:35 -06:00
Gregory Nutt
5ce3b399d5 Correct some typos in comments 2016-11-15 16:48:40 -06:00
Gregory Nutt
40d7216a22 Back out 65ab12 and parts of 21f92b 2016-11-15 15:44:43 -06:00
Gregory Nutt
6683f01444 Trivial change to comment 2016-11-15 13:38:43 -06:00
Gregory Nutt
21f92ba601 Review some SMP logic; update comments; refresh configuration. 2016-11-15 09:24:00 -06:00
Gregory Nutt
65ab12fbb9 If SMP is enabled, if any interrupt handler calls enter_critical_section(), it should take the spinlock. 2016-11-15 08:37:58 -06:00
Gregory Nutt
b53866c872 sched/irq: Change order for SMP case in enter_critical_section: Disble local interrupts BEFORE taking spinlock. 2016-11-15 07:54:18 -06:00
Sagitta Li
9fa1024eef vector table should have dimension NR_IRQS, not NR_IRQS+1 2016-09-22 07:56:12 -06:00
Gregory Nutt
2a751068e6 Without lowsyslog() *llerr() is not useful. Eliminate and replace with *err(). 2016-06-20 12:44:38 -06:00
Gregory Nutt
0c8c7fecf0 Add _ to the beginning of all debug macros to avoid name collisions 2016-06-16 12:33:32 -06:00
Gregory Nutt
13cac3b592 sched/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 16:42:42 -06:00
Gregory Nutt
e99301d7c2 Rename *lldbg to *llerr 2016-06-11 14:55:27 -06:00
Gregory Nutt
07acd5327a SMP: Clean CPU0 D-Cache before starting new CPU; Invalidate D-Cache when new CPU started. 2016-05-20 12:39:02 -06:00
Gregory Nutt
32838fcc2c enter/leave_critical_section: In SMP configuration, may attempt to access the task lists before they have been initialized 2016-05-18 09:17:01 -06:00
Gregory Nutt
d20db82fcb Scheduler instrumentation: Fix some associated with monitoring critical sections 2016-03-21 17:08:07 -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
320b70ebad Update submodules 2016-03-12 13:24:38 -06:00
Gregory Nutt
0fb035f76b Standardize some naming in code section comments 2016-02-21 18:09:04 -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
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
384e51cb05 Add some additional schedule instrumentation 2016-02-16 15:21:45 -06:00
Gregory Nutt
fccef49305 Cosmetic changes to comments 2016-02-15 13:48:08 -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
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
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
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
b4423c1eed Make some file section headers more consistent with standard 2015-04-08 06:47:36 -06:00
Gregory Nutt
322f9f401c Simplify how C source files are selected in the build 2014-10-07 07:42:36 -06:00
Gregory Nutt
e1769b22f1 Remove os_internal.h it has been replace by several new header files under sched/. There have been some sneak inclusion paths via os_internal.h, so expect a few compilation errors for some architectures 2014-08-08 18:39:28 -06:00
Gregory Nutt
85e8117062 Move interrupt dispatch logic from sched/ to sched/irq 2014-08-08 14:31:15 -06:00