Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
f1e4951a
Commit
f1e4951a
authored
8 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
Fix some comments
parent
4ca653a1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sched/irq/irq_csection.c
+15
-14
15 additions, 14 deletions
sched/irq/irq_csection.c
with
15 additions
and
14 deletions
sched/irq/irq_csection.c
+
15
−
14
View file @
f1e4951a
...
...
@@ -102,8 +102,8 @@ irqstate_t enter_critical_section(void)
ret
=
up_irq_save
();
/* Verify that the system has sufficient initialized so that the task
lists
* are valid.
/* Verify that the system has sufficient
ly
initialized so that the task
*
lists
are valid.
*/
if
(
g_os_initstate
>=
OSINIT_TASKLISTS
)
...
...
@@ -115,12 +115,13 @@ irqstate_t enter_critical_section(void)
if
(
up_interrupt_context
())
{
/* We are in an interrupt handler but within a critical section. How
* can this happen?
/* We are in an interrupt handler. How can this happen?
*
* 1. We are not in a critical section, OR
* 2. We are in critical section, but up_irq_restore only disables
* interrupts and this interrupt is from the other CPU.
* 1. We were not in a critical section when the interrupt
* occurred, OR
* 2. We were in critical section, but up_irq_restore only
* disabled local interrupts on a different CPU;
* Interrupts could still be enabled on this CPU.
*
* Assert if these conditions are not true.
*/
...
...
@@ -148,7 +149,7 @@ irqstate_t enter_critical_section(void)
* IRQ lock count.
*
* NOTE: If irqcount > 0 then (1) we are in a critical section, and
* this CPU should hold the lock.
*
(2)
this CPU should hold the lock.
*/
DEBUGASSERT
(
spin_islocked
(
&
g_cpu_irqlock
)
&&
...
...
@@ -161,7 +162,7 @@ irqstate_t enter_critical_section(void)
/* If we get here with irqcount == 0, then we know that the
* current task running on this CPU is not in a current
* section. However other tasks on other CPUs may be in a
* critical setion. If so, we must wait until they release
* critical se
c
tion. If so, we must wait until they release
* the spinlock.
*/
...
...
@@ -198,7 +199,7 @@ irqstate_t enter_critical_section(void)
#else
/* defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) */
irqstate_t
enter_critical_section
(
void
)
{
/* Check if we were called from an interrupt handler and that the task
s
/* Check if we were called from an interrupt handler and that the task
* lists have been initialized.
*/
...
...
@@ -230,8 +231,8 @@ irqstate_t enter_critical_section(void)
#ifdef CONFIG_SMP
void
leave_critical_section
(
irqstate_t
flags
)
{
/* Verify that the system has sufficient initialized so that the task
lists
* are valid.
/* Verify that the system has sufficient
ly
initialized so that the task
*
lists
are valid.
*/
if
(
g_os_initstate
>=
OSINIT_TASKLISTS
)
...
...
@@ -247,7 +248,7 @@ void leave_critical_section(irqstate_t flags)
{
/* We are in an interrupt handler. Release the spinlock. */
DEBUGASSERT
(
g_cpu_irqlock
==
SP_LOCKED
);
DEBUGASSERT
(
spin_islocked
(
&
g_cpu_irqlock
)
);
spin_lock
(
&
g_cpu_irqsetlock
);
/* Protects g_cpu_irqset */
if
(
g_cpu_irqset
==
0
)
...
...
@@ -273,7 +274,7 @@ void leave_critical_section(irqstate_t flags)
{
/* Yes... the spinlock should remain set */
DEBUGASSERT
(
g_cpu_irqlock
==
SP_LOCKED
);
DEBUGASSERT
(
spin_islocked
(
&
g_cpu_irqlock
)
);
rtcb
->
irqcount
--
;
}
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment