diff options
Diffstat (limited to 'nuttx/arch/arm/src')
-rw-r--r-- | nuttx/arch/arm/src/arm/up_fullcontextrestore.S | 9 | ||||
-rw-r--r-- | nuttx/arch/arm/src/arm/up_schedulesigaction.c | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/arm/up_sigdeliver.c | 35 | ||||
-rw-r--r-- | nuttx/arch/arm/src/cortexm3/up_schedulesigaction.c | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/cortexm3/up_sigdeliver.c | 31 |
5 files changed, 36 insertions, 43 deletions
diff --git a/nuttx/arch/arm/src/arm/up_fullcontextrestore.S b/nuttx/arch/arm/src/arm/up_fullcontextrestore.S index c99337636..d0745ef5b 100644 --- a/nuttx/arch/arm/src/arm/up_fullcontextrestore.S +++ b/nuttx/arch/arm/src/arm/up_fullcontextrestore.S @@ -1,7 +1,7 @@ /************************************************************************** * arch/arm/src/arm/up_fullcontextrestore.S * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -95,9 +95,10 @@ up_fullcontextrestore: /* Now we can restore the CPSR. We wait until we are completely * finished with the context save data to do this. Restore the CPSR - * may re-enable and interrupts and we couldt be in a context - * where save structure is only protected by interrupts being disabled. - */ + * may re-enable and interrupts and we could be in a context + * where the save structure is only protected by interrupts being + * disabled. + */ ldr r1, [r0, #(4*REG_CPSR)] /* Fetch the stored CPSR value */ msr cpsr, r1 /* Set the CPSR */ diff --git a/nuttx/arch/arm/src/arm/up_schedulesigaction.c b/nuttx/arch/arm/src/arm/up_schedulesigaction.c index 631296800..0dfb6e540 100644 --- a/nuttx/arch/arm/src/arm/up_schedulesigaction.c +++ b/nuttx/arch/arm/src/arm/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_schedulesigaction.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/arch/arm/src/arm/up_sigdeliver.c b/nuttx/arch/arm/src/arm/up_sigdeliver.c index a2358a044..f92f85e7e 100644 --- a/nuttx/arch/arm/src/arm/up_sigdeliver.c +++ b/nuttx/arch/arm/src/arm/up_sigdeliver.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_sigdeliver.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -73,10 +73,9 @@ * Name: up_sigdeliver * * Description: - * This is the a signal handling trampoline. When a - * signal action was posted. The task context was mucked - * with and forced to branch to this location with interrupts - * disabled. + * This is the a signal handling trampoline. When a signal action was + * posted. The task context was mucked with and forced to branch to this + * location with interrupts disabled. * ****************************************************************************/ @@ -86,9 +85,9 @@ void up_sigdeliver(void) uint32_t regs[XCPTCONTEXT_REGS]; sig_deliver_t sigdeliver; - /* Save the errno. This must be preserved throughout the - * signal handling so that the user code final gets - * the correct errno value (probably EINTR). + /* Save the errno. This must be preserved throughout the signal handling + * so that the user code final gets the correct errno value (probably + * EINTR). */ int saved_errno = rtcb->pterrno; @@ -105,11 +104,9 @@ void up_sigdeliver(void) regs[REG_PC] = rtcb->xcp.saved_pc; regs[REG_CPSR] = rtcb->xcp.saved_cpsr; - /* Get a local copy of the sigdeliver function pointer. - * we do this so that we can nullify the sigdeliver - * function point in the TCB and accept more signal - * deliveries while processing the current pending - * signals. + /* Get a local copy of the sigdeliver function pointer. we do this so that + * we can nullify the sigdeliver function pointer in the TCB and accept + * more signal deliveries while processing the current pending signals. */ sigdeliver = rtcb->xcp.sigdeliver; @@ -123,18 +120,16 @@ void up_sigdeliver(void) sigdeliver(rtcb); - /* Output any debug messaged BEFORE restoreing errno - * (becuase they may alter errno), then restore the - * original errno that is needed by the user logic - * (it is probably EINTR). + /* Output any debug messages BEFORE restoring errno (because they may + * alter errno), then disable interrupts again and restore the original + * errno that is needed by the user logic (it is probably EINTR). */ sdbg("Resuming\n"); + (void)irqsave(); rtcb->pterrno = saved_errno; - /* Then restore the correct state for this thread of - * execution. - */ + /* Then restore the correct state for this thread of execution. */ up_ledoff(LED_SIGNAL); up_fullcontextrestore(regs); diff --git a/nuttx/arch/arm/src/cortexm3/up_schedulesigaction.c b/nuttx/arch/arm/src/cortexm3/up_schedulesigaction.c index e4f4f51b4..879cd6715 100644 --- a/nuttx/arch/arm/src/cortexm3/up_schedulesigaction.c +++ b/nuttx/arch/arm/src/cortexm3/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/cortexm3/up_schedulesigaction.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/arch/arm/src/cortexm3/up_sigdeliver.c b/nuttx/arch/arm/src/cortexm3/up_sigdeliver.c index e350f126a..f05b7ce69 100644 --- a/nuttx/arch/arm/src/cortexm3/up_sigdeliver.c +++ b/nuttx/arch/arm/src/cortexm3/up_sigdeliver.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/cortexm3/up_sigdeliver.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -73,10 +73,9 @@ * Name: up_sigdeliver * * Description: - * This is the a signal handling trampoline. When a - * signal action was posted. The task context was mucked - * with and forced to branch to this location with interrupts - * disabled. + * This is the a signal handling trampoline. When a signal action was + * posted. The task context was mucked with and forced to branch to this + * location with interrupts disabled. * ****************************************************************************/ @@ -86,9 +85,9 @@ void up_sigdeliver(void) uint32_t regs[XCPTCONTEXT_REGS]; sig_deliver_t sigdeliver; - /* Save the errno. This must be preserved throughout the - * signal handling so that the user code final gets - * the correct errno value (probably EINTR). + /* Save the errno. This must be preserved throughout the signal handling + * so that the user code final gets the correct errno value (probably + * EINTR). */ int saved_errno = rtcb->pterrno; @@ -106,11 +105,9 @@ void up_sigdeliver(void) regs[REG_PRIMASK] = rtcb->xcp.saved_primask; regs[REG_XPSR] = rtcb->xcp.saved_xpsr; - /* Get a local copy of the sigdeliver function pointer. - * we do this so that we can nullify the sigdeliver - * function point in the TCB and accept more signal - * deliveries while processing the current pending - * signals. + /* Get a local copy of the sigdeliver function pointer. We do this so that + * we can nullify the sigdeliver function pointer in the TCB and accept + * more signal deliveries while processing the current pending signals. */ sigdeliver = rtcb->xcp.sigdeliver; @@ -124,13 +121,13 @@ void up_sigdeliver(void) sigdeliver(rtcb); - /* Output any debug messaged BEFORE restoreing errno - * (becuase they may alter errno), then restore the - * original errno that is needed by the user logic - * (it is probably EINTR). + /* Output any debug messages BEFORE restoring errno (because they may + * alter errno), then disable interrupts again and restore the original + * errno that is needed by the user logic (it is probably EINTR). */ sdbg("Resuming\n"); + (void)irqsave(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of |