summaryrefslogtreecommitdiff
path: root/nuttx/arch/mips/src/mips32/up_swint0.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-12 21:53:18 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-12 21:53:18 +0000
commit177f3484f71b2d03fc5b809a024ff32d137494ba (patch)
treec1c81390b64b5e303bad0ea2638d979d9c2e8607 /nuttx/arch/mips/src/mips32/up_swint0.c
parenteb1679e6fac9aa613baf90f285ef3e5e5413ea18 (diff)
downloadnuttx-177f3484f71b2d03fc5b809a024ff32d137494ba.tar.gz
nuttx-177f3484f71b2d03fc5b809a024ff32d137494ba.tar.bz2
nuttx-177f3484f71b2d03fc5b809a024ff32d137494ba.zip
Fix some ARMv7-M syscall logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5736 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/mips/src/mips32/up_swint0.c')
-rw-r--r--nuttx/arch/mips/src/mips32/up_swint0.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/nuttx/arch/mips/src/mips32/up_swint0.c b/nuttx/arch/mips/src/mips32/up_swint0.c
index 4a172fe2a..9f7081fd3 100644
--- a/nuttx/arch/mips/src/mips32/up_swint0.c
+++ b/nuttx/arch/mips/src/mips32/up_swint0.c
@@ -239,19 +239,16 @@ int up_swint0(int irq, FAR void *context)
{
struct tcb_s *rtcb = sched_self();
- /* Make sure that we got here from a privileged thread and
- * that there is a saved syscall return address.
- */
+ /* Make sure that there is a saved syscall return address. */
-#error "Missing logic -- need to test for privileged mode"
- DEBUGASSERT(rtcb->xcp.sysreturn != 0 && ???);
+ DEBUGASSERT(rtcb->xcp.sysreturn != 0);
/* Setup to return to the saved syscall return address in
- * unprivileged mode.
+ * the original mode.
*/
current_regs[REG_EPC] = rtcb->xcp.sysreturn;
-#error "Missing logic -- need to set for unprivileged mode"
+#error "Missing logic -- need to restore the original mode"
rtcb->sysreturn = 0;
}
break;
@@ -267,20 +264,19 @@ int up_swint0(int irq, FAR void *context)
#ifdef CONFIG_NUTTX_KERNEL
FAR struct tcb_s *rtcb = sched_self();
- /* Verify the the SYS call number is within range */
+ /* Verify that the SYS call number is within range */
DEBUGASSERT(current_regs[REG_A0] < SYS_maxsyscall);
- /* Make sure that we got here from an unprivileged thread and that
- * there is a no saved syscall return address.
+ /* Make sure that we got here that there is a no saved syscall
+ * return address. We cannot yet handle nested system calls.
*/
-#error "Missing logic -- Need to set unprivileged mode"
- DEBUGASSERT(rtcb->xcp.sysreturn == 0 && ???);
+ DEBUGASSERT(rtcb->xcp.sysreturn == 0);
/* Setup to return to dispatch_syscall in privileged mode. */
- rtcb->sysreturn = regs[REG_EPC]
+ rtcb->sysreturn = regs[REG_EPC];
regs[REG_EPC] = (uint32_t)dispatch_syscall;
#error "Missing logic -- Need to set privileged mode"