summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/cortexm3/up_svcall.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-10-27 19:51:19 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-10-27 19:51:19 +0000
commit5cd8166dcb7e6cf0068521ed6896f54333b772af (patch)
treeb171d9ec91403118ef68ebd9eea371f50d23c22f /nuttx/arch/arm/src/cortexm3/up_svcall.c
parent2db8a6b1b8d2df454165894ea7327e5a8a541035 (diff)
downloadpx4-nuttx-5cd8166dcb7e6cf0068521ed6896f54333b772af.tar.gz
px4-nuttx-5cd8166dcb7e6cf0068521ed6896f54333b772af.tar.bz2
px4-nuttx-5cd8166dcb7e6cf0068521ed6896f54333b772af.zip
Debug output from certain files causes crashes with new context switching logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2181 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/cortexm3/up_svcall.c')
-rw-r--r--nuttx/arch/arm/src/cortexm3/up_svcall.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/nuttx/arch/arm/src/cortexm3/up_svcall.c b/nuttx/arch/arm/src/cortexm3/up_svcall.c
index e559074cc..7d89e9a0e 100644
--- a/nuttx/arch/arm/src/cortexm3/up_svcall.c
+++ b/nuttx/arch/arm/src/cortexm3/up_svcall.c
@@ -53,7 +53,14 @@
* Pre-processor Definitions
****************************************************************************/
+/* Debug output from this file may interfere with context switching! */
+
#undef DEBUG_SVCALL /* Define to debug SVCall */
+#ifdef DEBUG_HARDFAULTS
+# define svcdbg(format, arg...) lldbg(format, ##arg)
+#else
+# define svcdbg(x...)
+#endif
/****************************************************************************
* Private Data
@@ -90,19 +97,17 @@ int up_svcall(int irq, FAR void *context)
* the TCB register save area.
*/
- sllvdbg("Command: %d regs: %p R1: %08x R2: %08x\n",
- regs[REG_R0], regs, regs[REG_R1], regs[REG_R2]);
-
-#ifdef DEBUG_SVCALL
- lldbg("SVCall Entry:\n");
- lldbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
- regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
- regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
- lldbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
- regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
- regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
- lldbg(" PSR=%08x\n", regs[REG_XPSR]);
-#endif
+ svcdbg("Command: %d regs: %p R1: %08x R2: %08x\n",
+ regs[REG_R0], regs, regs[REG_R1], regs[REG_R2]);
+
+ svcdbg("SVCall Entry:\n");
+ svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
+ regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
+ regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
+ svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
+ regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
+ regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
+ svcdbg(" PSR=%08x\n", regs[REG_XPSR]);
/* Handle the SVCall according to the command in R0 */
@@ -178,16 +183,14 @@ int up_svcall(int irq, FAR void *context)
break;
}
-#ifdef DEBUG_SVCALL
- lldbg("SVCall Return:\n");
- lldbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
- current_regs[REG_R0], current_regs[REG_R1], current_regs[REG_R2], current_regs[REG_R3],
- current_regs[REG_R4], current_regs[REG_R5], current_regs[REG_R6], current_regs[REG_R7]);
- lldbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
- current_regs[REG_R8], current_regs[REG_R9], current_regs[REG_R10], current_regs[REG_R11],
- current_regs[REG_R12], current_regs[REG_R13], current_regs[REG_R14], current_regs[REG_R15]);
- lldbg(" PSR=%08x\n", current_regs[REG_XPSR]);
-#endif
+ svcdbg("SVCall Return:\n");
+ svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
+ current_regs[REG_R0], current_regs[REG_R1], current_regs[REG_R2], current_regs[REG_R3],
+ current_regs[REG_R4], current_regs[REG_R5], current_regs[REG_R6], current_regs[REG_R7]);
+ svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
+ current_regs[REG_R8], current_regs[REG_R9], current_regs[REG_R10], current_regs[REG_R11],
+ current_regs[REG_R12], current_regs[REG_R13], current_regs[REG_R14], current_regs[REG_R15]);
+ svcdbg(" PSR=%08x\n", current_regs[REG_XPSR]);
return OK;
}