summaryrefslogtreecommitdiff
path: root/nuttx/arch/mips/src
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/mips/src')
-rw-r--r--nuttx/arch/mips/src/common/up_exit.c13
-rw-r--r--nuttx/arch/mips/src/mips32/up_schedulesigaction.c24
-rw-r--r--nuttx/arch/mips/src/mips32/up_sigdeliver.c5
3 files changed, 29 insertions, 13 deletions
diff --git a/nuttx/arch/mips/src/common/up_exit.c b/nuttx/arch/mips/src/common/up_exit.c
index cf6b25fda..f82b47330 100644
--- a/nuttx/arch/mips/src/common/up_exit.c
+++ b/nuttx/arch/mips/src/common/up_exit.c
@@ -1,8 +1,8 @@
/****************************************************************************
- * arch/mips/src.common/up_exit.c
+ * arch/mips/src/common/up_exit.c
*
- * Copyright (C) 2010 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -41,6 +41,7 @@
#include <sched.h>
#include <syscall.h>
+#include <assert.h>
#include <debug.h>
#include <nuttx/arch.h>
@@ -171,5 +172,11 @@ void _exit(int status)
/* Then switch contexts */
up_fullcontextrestore(tcb->xcp.regs);
+
+ /* up_fullcontextrestore() should not return but could if the software
+ * interrupts are disabled.
+ */
+
+ PANIC(OSERR_INTERNAL);
}
diff --git a/nuttx/arch/mips/src/mips32/up_schedulesigaction.c b/nuttx/arch/mips/src/mips32/up_schedulesigaction.c
index 7f4f0a0c9..f81fd890a 100644
--- a/nuttx/arch/mips/src/mips32/up_schedulesigaction.c
+++ b/nuttx/arch/mips/src/mips32/up_schedulesigaction.c
@@ -2,7 +2,7 @@
* arch/mips/src/mips32/up_schedulesigaction.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -150,9 +150,9 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
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.
+ /* Save the return EPC and STATUS registers. These will be
+ * restored by the signal trampoline after the signals have
+ * been delivered.
*/
tcb->xcp.sigdeliver = sigdeliver;
@@ -174,6 +174,10 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
*/
up_savestate(tcb->xcp.regs);
+
+ svdbg("PC/STATUS Saved: %08x/%08x New: %08x/%08x\n",
+ tcb->xcp.saved_epc, tcb->xcp.saved_status,
+ current_regs[REG_EPC], current_regs[REG_STATUS]);
}
}
@@ -185,9 +189,9 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
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.
+ /* Save the return EPC and STATUS registers. These will be
+ * restored by the signal trampoline after the signals have
+ * been delivered.
*/
tcb->xcp.sigdeliver = sigdeliver;
@@ -199,10 +203,14 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
*/
tcb->xcp.regs[REG_EPC] = (uint32_t)up_sigdeliver;
- status = current_regs[REG_STATUS];
+ status = tcb->xcp.regs[REG_STATUS];
status &= ~CP0_STATUS_IM_MASK;
status |= CP0_STATUS_IM_SWINTS;
tcb->xcp.regs[REG_STATUS] = status;
+
+ svdbg("PC/STATUS Saved: %08x/%08x New: %08x/%08x\n",
+ tcb->xcp.saved_epc, tcb->xcp.saved_status,
+ tcb->xcp.regs[REG_EPC], tcb->xcp.regs[REG_STATUS]);
}
irqrestore(flags);
diff --git a/nuttx/arch/mips/src/mips32/up_sigdeliver.c b/nuttx/arch/mips/src/mips32/up_sigdeliver.c
index 7a291b58b..cf0ac944e 100644
--- a/nuttx/arch/mips/src/mips32/up_sigdeliver.c
+++ b/nuttx/arch/mips/src/mips32/up_sigdeliver.c
@@ -2,7 +2,7 @@
* arch/mips/src/mips32/up_sigdeliver.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -126,7 +126,8 @@ void up_sigdeliver(void)
* errno that is needed by the user logic (it is probably EINTR).
*/
- sdbg("Resuming\n");
+ svdbg("Resuming EPC: %08x STATUS: %08x\n", regs[REG_EPC], regs[REG_STATUS]);
+
(void)irqsave();
rtcb->pterrno = saved_errno;