summaryrefslogtreecommitdiff
path: root/nuttx/arch/z16/src/common
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-31 22:19:53 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-31 22:19:53 +0000
commit5fbab9af64e5f09f8b806e5b66e6731efe06252c (patch)
tree24b4a59ea93b007f021e8b7299f56cc258032812 /nuttx/arch/z16/src/common
parente49f6e36084b24604f11a998faecb986ae21203f (diff)
downloadpx4-nuttx-5fbab9af64e5f09f8b806e5b66e6731efe06252c.tar.gz
px4-nuttx-5fbab9af64e5f09f8b806e5b66e6731efe06252c.tar.bz2
px4-nuttx-5fbab9af64e5f09f8b806e5b66e6731efe06252c.zip
*** empty log message ***
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@597 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/z16/src/common')
-rw-r--r--nuttx/arch/z16/src/common/up_internal.h2
-rw-r--r--nuttx/arch/z16/src/common/up_schedulesigaction.c27
-rw-r--r--nuttx/arch/z16/src/common/up_sigdeliver.c21
3 files changed, 23 insertions, 27 deletions
diff --git a/nuttx/arch/z16/src/common/up_internal.h b/nuttx/arch/z16/src/common/up_internal.h
index 144fee754..1f2f51829 100644
--- a/nuttx/arch/z16/src/common/up_internal.h
+++ b/nuttx/arch/z16/src/common/up_internal.h
@@ -73,7 +73,7 @@
#define IN_INTERRUPT (current_regs != NULL)
#define SAVE_IRQCONTEXT(tcb) up_copystate((tcb)->xcp.regs, current_regs)
-#define SET_IRQCONTEXT(tcb) up_copystate(current_regs, (tcb)->xcp.regs)
+#define SET_IRQCONTEXT(tcb) do { current_regs = (tcb)->xcp.regs; } while (0)
#define SAVE_USERCONTEXT(tcb) up_saveusercontext((tcb)->xcp.regs)
#define RESTORE_USERCONTEXT(tcb) up_restoreusercontext((tcb)->xcp.regs)
#define SIGNAL_RETURN(regs) up_restoreusercontext(regs)
diff --git a/nuttx/arch/z16/src/common/up_schedulesigaction.c b/nuttx/arch/z16/src/common/up_schedulesigaction.c
index f085b2e95..4a4b0bcc8 100644
--- a/nuttx/arch/z16/src/common/up_schedulesigaction.c
+++ b/nuttx/arch/z16/src/common/up_schedulesigaction.c
@@ -133,19 +133,19 @@ void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver)
sigdeliver(tcb);
}
- /* 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.
+ /* 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.
*/
else
{
FAR uint32 *current_pc = (FAR uint32*)&current_regs[REG_PC];
- /* Save the return address and interrupt state.
- * These will be restored by the signal trampoline after
- * the signals have been delivered.
+ /* Save the return address and interrupt state. These will be
+ * restored by the signal trampoline after the signals have
+ * been delivered.
*/
tcb->xcp.sigdeliver = sigdeliver;
@@ -159,23 +159,22 @@ void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver)
*current_pc = (uint32)up_sigdeliver;
current_regs[REG_FLAGS] = 0;
- /* And make sure that the saved context in the TCB
- * is the same as the interrupt return context.
+ /* And make sure that the saved context in the TCB is the
+ * same as the interrupt return context.
*/
up_copystate(tcb->xcp.regs, current_regs);
}
}
- /* Otherwise, we are (1) signaling a task is not running
- * from an interrupt handler or (2) we are not in an
- * interrupt handler and the running task is signalling
- * some non-running task.
+ /* Otherwise, we are (1) signaling a task is not running from an
+ * interrupt handler or (2) we are not in an interrupt handler
+ * and the running task is signalling some non-running task.
*/
else
{
- uint32 *saved_pc = (uint32*)&tcb->xcp.regs[REG_PC];
+ FAR uint32 *saved_pc = (FAR uint32*)&tcb->xcp.regs[REG_PC];
/* Save the return lr and cpsr and one scratch register
* These will be restored by the signal trampoline after
diff --git a/nuttx/arch/z16/src/common/up_sigdeliver.c b/nuttx/arch/z16/src/common/up_sigdeliver.c
index 09bcd14ac..afc554e85 100644
--- a/nuttx/arch/z16/src/common/up_sigdeliver.c
+++ b/nuttx/arch/z16/src/common/up_sigdeliver.c
@@ -72,10 +72,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.
*
****************************************************************************/
@@ -106,10 +105,9 @@ void up_sigdeliver(void)
regs32[REG_PC/2] = rtcb->xcp.saved_pc;
regs[REG_FLAGS] = rtcb->xcp.saved_i;
- /* 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
+ /* 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.
*/
@@ -127,10 +125,9 @@ void up_sigdeliver(void)
sigdeliver(rtcb);
- /* Output any debug messaged BEFORE restoring errno
- * (because they may alter errno), then restore the
- * original errno that is needed by the user logic
- * (it is probably EINTR).
+ /* Output any debug messaged BEFORE restoring errno (because they may
+ * alter errno), then restore the original errno that is needed by
+ * the user logic (it is probably EINTR).
*/
dbg("Resuming\n");