Skip to content

Commit

Permalink
arch: Remove critical section inside up_schedule_sigaction
Browse files Browse the repository at this point in the history
since nxsig_tcbdispatch already hold it for us

Signed-off-by: Xiang Xiao <[email protected]>
Change-Id: I2fe6ad840bdca3ec0eaa76a9af3b6929c7d5a721
  • Loading branch information
xiaoxiang781216 authored and jerpelea committed Jan 22, 2021
1 parent 394cfba commit 94da3e4
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 241 deletions.
11 changes: 3 additions & 8 deletions arch/arm/src/arm/arm_schedulesigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,15 @@
* currently executing task -- just call the signal
* handler now.
*
* Assumptions:
* Called from critical section
*
****************************************************************************/

void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -184,6 +181,4 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
tcb->xcp.regs[REG_CPSR] = SVC_MODE | PSR_I_BIT | PSR_F_BIT;
}
}

leave_critical_section(flags);
}
11 changes: 3 additions & 8 deletions arch/arm/src/armv6-m/arm_schedulesigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,15 @@
* currently executing task -- just call the signal
* handler now.
*
* Assumptions:
* Called from critical section
*
****************************************************************************/

void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -194,6 +191,4 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
#endif
}
}

leave_critical_section(flags);
}
18 changes: 3 additions & 15 deletions arch/arm/src/armv7-a/arm_schedulesigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,16 @@
* currently executing task -- just call the signal
* handler now.
*
* Assumptions:
* Called from critical section
*
****************************************************************************/

#ifndef CONFIG_SMP
void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -180,24 +177,17 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
#endif
}
}

leave_critical_section(flags);
}
#endif /* !CONFIG_SMP */

#ifdef CONFIG_SMP
void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;
int cpu;
int me;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -364,7 +354,5 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
#endif
}
}

leave_critical_section(flags);
}
#endif /* CONFIG_SMP */
18 changes: 3 additions & 15 deletions arch/arm/src/armv7-m/arm_schedulesigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,17 @@
* currently executing task -- just call the signal
* handler now.
*
* Assumptions:
* Called from critical section
*
****************************************************************************/

#ifndef CONFIG_SMP
void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
DEBUGASSERT(tcb != NULL && sigdeliver != NULL);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (tcb->xcp.sigdeliver == NULL)
Expand Down Expand Up @@ -203,24 +200,17 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
#endif
}
}

leave_critical_section(flags);
}
#endif /* !CONFIG_SMP */

#ifdef CONFIG_SMP
void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;
int cpu;
int me;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -425,7 +415,5 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
#endif
}
}

leave_critical_section(flags);
}
#endif /* CONFIG_SMP */
11 changes: 3 additions & 8 deletions arch/arm/src/armv7-r/arm_schedulesigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,15 @@
* currently executing task -- just call the signal
* handler now.
*
* Assumptions:
* Called from critical section
*
****************************************************************************/

void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -178,6 +175,4 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
#endif
}
}

leave_critical_section(flags);
}
18 changes: 3 additions & 15 deletions arch/arm/src/armv8-m/arm_schedulesigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,17 @@
* currently executing task -- just call the signal
* handler now.
*
* Assumptions:
* Called from critical section
*
****************************************************************************/

#ifndef CONFIG_SMP
void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
DEBUGASSERT(tcb != NULL && sigdeliver != NULL);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (tcb->xcp.sigdeliver == NULL)
Expand Down Expand Up @@ -203,24 +200,17 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
#endif
}
}

leave_critical_section(flags);
}
#endif /* !CONFIG_SMP */

#ifdef CONFIG_SMP
void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;
int cpu;
int me;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -429,7 +419,5 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
#endif
}
}

leave_critical_section(flags);
}
#endif /* CONFIG_SMP */
10 changes: 3 additions & 7 deletions arch/avr/src/avr/up_schedulesigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,17 @@
* currently executing task -- just call the signal
* handler now.
*
* Assumptions:
* Called from critical section
*
****************************************************************************/

void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;
uintptr_t reg_ptr = (uintptr_t)up_sigdeliver;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -209,6 +207,4 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
tcb->xcp.regs[REG_SREG] &= ~(1 << SREG_I);
}
}

leave_critical_section(flags);
}
11 changes: 3 additions & 8 deletions arch/avr/src/avr32/up_schedulesigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,15 @@
* currently executing task -- just call the signal
* handler now.
*
* Assumptions:
* Called from critical section
*
****************************************************************************/

void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -185,6 +182,4 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
tcb->xcp.regs[REG_SR] |= AVR32_SR_GM_MASK;
}
}

leave_critical_section(flags);
}
10 changes: 3 additions & 7 deletions arch/mips/src/mips32/mips_schedulesigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,17 @@
* currently executing task -- just call the signal
* handler now.
*
* Assumptions:
* Called from critical section
*
****************************************************************************/

void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;
uint32_t status;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -203,6 +201,4 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
tcb->xcp.regs[REG_EPC], tcb->xcp.regs[REG_STATUS]);
}
}

leave_critical_section(flags);
}
11 changes: 3 additions & 8 deletions arch/misoc/src/lm32/lm32_schedulesigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,15 @@
* currently executing task -- just call the signal
* handler now.
*
* Assumptions:
* Called from critical section
*
****************************************************************************/

void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
irqstate_t flags;

sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);

/* Make sure that interrupts are disabled */

flags = enter_critical_section();

/* Refuse to handle nested signal actions */

if (!tcb->xcp.sigdeliver)
Expand Down Expand Up @@ -196,6 +193,4 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
tcb->xcp.regs[REG_EPC], tcb->xcp.regs[REG_STATUS]);
}
}

leave_critical_section(flags);
}
Loading

0 comments on commit 94da3e4

Please sign in to comment.