diff --git a/arch/arm/src/arm/up_schedulesigaction.c b/arch/arm/src/arm/up_schedulesigaction.c index f14263c6a36..a943c0abde5 100644 --- a/arch/arm/src/arm/up_schedulesigaction.c +++ b/arch/arm/src/arm/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_schedulesigaction.c * - * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,18 +103,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -196,9 +196,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_CPSR] = SVC_MODE | PSR_I_BIT | PSR_F_BIT; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/arm/src/armv6-m/up_schedulesigaction.c b/arch/arm/src/armv6-m/up_schedulesigaction.c index e538674b47e..ada505f3a3f 100644 --- a/arch/arm/src/armv6-m/up_schedulesigaction.c +++ b/arch/arm/src/armv6-m/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv6-m/up_schedulesigaction.c * - * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -104,18 +104,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -206,9 +206,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_LR] = EXC_RETURN_PRIVTHR; #endif } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/arm/src/armv7-a/arm_schedulesigaction.c b/arch/arm/src/armv7-a/arm_schedulesigaction.c index dfdf5235f39..866ebb36a5d 100644 --- a/arch/arm/src/armv7-a/arm_schedulesigaction.c +++ b/arch/arm/src/armv7-a/arm_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-a/arm_schedulesigaction.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,18 +103,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -195,9 +195,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_CPSR] = (PSR_MODE_SVC | PSR_I_BIT | PSR_F_BIT); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/avr/src/avr/up_schedulesigaction.c b/arch/avr/src/avr/up_schedulesigaction.c index ebd40eba56b..54f5601df7a 100644 --- a/arch/avr/src/avr/up_schedulesigaction.c +++ b/arch/avr/src/avr/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/avr/src/avr/up_schedulesigaction.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,18 +103,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -200,9 +200,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PCH] = (uint16_t)up_sigdeliver >> 8; tcb->xcp.regs[REG_SREG] &= ~(1 << SREG_I); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/avr/src/avr32/up_schedulesigaction.c b/arch/avr/src/avr32/up_schedulesigaction.c index c877ba2442b..d1166f79c80 100644 --- a/arch/avr/src/avr32/up_schedulesigaction.c +++ b/arch/avr/src/avr32/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/avr/src/avr32/up_schedulesigaction.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,18 +103,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -196,9 +196,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_SR] |= AVR32_SR_GM_MASK; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/mips/src/mips32/up_schedulesigaction.c b/arch/mips/src/mips32/up_schedulesigaction.c index 1173bf2c400..f3e58a5f491 100644 --- a/arch/mips/src/mips32/up_schedulesigaction.c +++ b/arch/mips/src/mips32/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/mips32/up_schedulesigaction.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,20 +103,19 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { + irqstate_t flags; uint32_t status; - /* Refuse to handle nested signal actions */ - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -212,9 +211,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.saved_epc, tcb->xcp.saved_status, tcb->xcp.regs[REG_EPC], tcb->xcp.regs[REG_STATUS]); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/sh/src/m16c/m16c_schedulesigaction.c b/arch/sh/src/m16c/m16c_schedulesigaction.c index adce23d3731..c278d2f93b0 100644 --- a/arch/sh/src/m16c/m16c_schedulesigaction.c +++ b/arch/sh/src/m16c/m16c_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/m16c/m16c_schedulesigaction.c * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,18 +102,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -193,9 +193,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PC+1] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_FLG] &= ~M16C_FLG_I; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/sh/src/sh1/sh1_schedulesigaction.c b/arch/sh/src/sh1/sh1_schedulesigaction.c index 38fe1e361b7..8fff1572e79 100644 --- a/arch/sh/src/sh1/sh1_schedulesigaction.c +++ b/arch/sh/src/sh1/sh1_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/sh1/sh1_schedulesigaction.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,18 +102,18 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -189,9 +189,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_SR] |= 0x000000f0 ; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/x86/src/i486/up_schedulesigaction.c b/arch/x86/src/i486/up_schedulesigaction.c index 150324eceb2..8d6b03213f0 100644 --- a/arch/x86/src/i486/up_schedulesigaction.c +++ b/arch/x86/src/i486/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/x86/src/i486/up_schedulesigaction.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -98,20 +98,20 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered - * to the currently executing task. + * to the currently executing task. */ sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); @@ -119,7 +119,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) if (tcb == (struct tcb_s*)g_readytorun.head) { /* CASE 1: We are not in an interrupt handler and a task is - * signalling itself for some reason. + * signalling itself for some reason. */ if (!current_regs) @@ -130,21 +130,21 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) } /* CASE 2: We are in an interrupt handler AND the interrupted task - * is the same as the one that must receive the signal, then we will - * have to modify the return state as well as the state in the TCB. + * is the same as the one that must receive the signal, then we will + * have to modify the return state as well as the state in the TCB. * * Hmmm... there looks like a latent bug here: The following logic - * would fail in the strange case where we are in an interrupt - * handler, the thread is signalling itself, but a context switch to - * another task has occurred so that current_regs does not refer to - * the thread at g_readytorun.head! + * would fail in the strange case where we are in an interrupt + * handler, the thread is signalling itself, but a context switch to + * another task has occurred so that current_regs does not refer to + * the thread at g_readytorun.head! */ else { /* Save the return lr and cpsr and one scratch register. These - * will be restored by the signal trampoline after the signals - * have been delivered. + * will be restored by the signal trampoline after the signals + * have been delivered. */ tcb->xcp.sigdeliver = sigdeliver; @@ -190,9 +190,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_EIP] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_EFLAGS] = 0; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/z16/src/common/up_schedulesigaction.c b/arch/z16/src/common/up_schedulesigaction.c index 1a2ccae48b6..f71d6be7eb5 100644 --- a/arch/z16/src/common/up_schedulesigaction.c +++ b/arch/z16/src/common/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_schedulesigaction.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,18 +102,18 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { - /* Refuse to handle nested signal actions */ + irqstate_t flags; dbg("tcb=0x%p sigdeliver=0x%06x\n", tcb, (uint32_t)sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* Refuse to handle nested signal actions */ + if (!tcb->xcp.sigdeliver) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is * being delivered to the currently executing task. */ @@ -192,9 +192,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) *saved_pc = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_FLAGS] = 0; } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* CONFIG_DISABLE_SIGNALS */ diff --git a/arch/z80/src/ez80/ez80_schedulesigaction.c b/arch/z80/src/ez80/ez80_schedulesigaction.c index 987c1dd6475..b98e61701fa 100644 --- a/arch/z80/src/ez80/ez80_schedulesigaction.c +++ b/arch/z80/src/ez80/ez80_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/ez80/ez80_schedulesigaction.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -123,18 +123,18 @@ static void ez80_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR c void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { + irqstate_t flags; + sdbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + /* Refuse to handle nested signal actions */ if (tcb->xcp.sigdeliver == NULL) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -183,9 +183,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) ez80_sigsetup(tcb, sigdeliver, tcb->xcp.regs); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* CONFIG_DISABLE_SIGNALS */ diff --git a/arch/z80/src/z180/z180_schedulesigaction.c b/arch/z80/src/z180/z180_schedulesigaction.c index f3025b6e991..e212bf0ff8f 100644 --- a/arch/z80/src/z180/z180_schedulesigaction.c +++ b/arch/z80/src/z180/z180_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z180/z180_schedulesigaction.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -123,18 +123,18 @@ static void z180_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR c void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { + irqstate_t flags; + dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + /* Refuse to handle nested signal actions */ if (tcb->xcp.sigdeliver == NULL) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -183,9 +183,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) z180_sigsetup(tcb, sigdeliver, tcb->xcp.regs); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* CONFIG_DISABLE_SIGNALS */ diff --git a/arch/z80/src/z8/z8_schedulesigaction.c b/arch/z80/src/z8/z8_schedulesigaction.c index 2a6c7495a0c..8d876a52c50 100644 --- a/arch/z80/src/z8/z8_schedulesigaction.c +++ b/arch/z80/src/z8/z8_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z8/z8_schedulesigaction.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -123,18 +123,18 @@ static void z8_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR chi void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { + irqstate_t flags; + dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + /* Refuse to handle nested signal actions */ if (tcb->xcp.sigdeliver == NULL) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -183,9 +183,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) z8_sigsetup(tcb, sigdeliver, tcb->xcp.regs); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* CONFIG_DISABLE_SIGNALS */ diff --git a/arch/z80/src/z80/z80_schedulesigaction.c b/arch/z80/src/z80/z80_schedulesigaction.c index 66ca29b8513..f4581314db8 100644 --- a/arch/z80/src/z80/z80_schedulesigaction.c +++ b/arch/z80/src/z80/z80_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z80/z80_schedulesigaction.c * - * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -123,18 +123,18 @@ static void z80_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR ch void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { + irqstate_t flags; + dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + /* Refuse to handle nested signal actions */ if (tcb->xcp.sigdeliver == NULL) { - irqstate_t flags; - - /* Make sure that interrupts are disabled */ - - flags = irqsave(); - /* First, handle some special cases when the signal is being delivered * to the currently executing task. */ @@ -183,10 +183,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) z80_sigsetup(tcb, sigdeliver, tcb->xcp.regs); } - - irqrestore(flags); } + + irqrestore(flags); } #endif /* CONFIG_DISABLE_SIGNALS */ -