aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-03-19 20:39:23 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-03-19 20:39:23 +0000
commite55b9dfdcb1a285aed416fc49d702b01e18de03f (patch)
tree8d60523edb2df126b7de02298999aba7ac16687c
parent295f370672c3238bc166743261f067bd8fe80cc4 (diff)
downloadChibiOS-e55b9dfdcb1a285aed416fc49d702b01e18de03f.tar.gz
ChibiOS-e55b9dfdcb1a285aed416fc49d702b01e18de03f.tar.bz2
ChibiOS-e55b9dfdcb1a285aed416fc49d702b01e18de03f.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1759 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/kernel/include/chdebug.h4
-rw-r--r--os/kernel/src/chdebug.c5
-rw-r--r--os/kernel/src/chschd.c6
-rw-r--r--os/ports/GCC/ARMCM3/chcore.c2
4 files changed, 8 insertions, 9 deletions
diff --git a/os/kernel/include/chdebug.h b/os/kernel/include/chdebug.h
index c79be7a3b..b9da339b7 100644
--- a/os/kernel/include/chdebug.h
+++ b/os/kernel/include/chdebug.h
@@ -137,7 +137,7 @@ typedef struct {
#if !CH_DBG_ENABLE_TRACE
/* When the trace feature is disabled this function is replaced by an empty
macro.*/
-#define chDbgTrace(otp, ntp) {}
+#define chDbgTrace(otp) {}
#endif
#if !defined(__DOXYGEN__)
@@ -147,7 +147,7 @@ extern "C" {
#if CH_DBG_ENABLE_TRACE
extern TraceBuffer trace_buffer;
void trace_init(void);
- void chDbgTrace(Thread *ntp, Thread *otp);
+ void chDbgTrace(Thread *otp);
#endif
#if CH_DBG_ENABLE_ASSERTS || CH_DBG_ENABLE_CHECKS || CH_DBG_ENABLE_STACK_CHECK
extern char *panic_msg;
diff --git a/os/kernel/src/chdebug.c b/os/kernel/src/chdebug.c
index 462f2559e..15a2f3e92 100644
--- a/os/kernel/src/chdebug.c
+++ b/os/kernel/src/chdebug.c
@@ -50,15 +50,14 @@ void trace_init(void) {
/**
* @brief Inserts in the circular debug trace buffer a context switch record.
*
- * @param[in] ntp the thread to be switched in
* @param[in] otp the thread being switched out
*/
-void chDbgTrace(Thread *ntp, Thread *otp) {
+void chDbgTrace(Thread *otp) {
trace_buffer.tb_ptr->cse_wtobjp = otp->p_u.wtobjp;
trace_buffer.tb_ptr->cse_time = chTimeNow();
trace_buffer.tb_ptr->cse_state = otp->p_state;
- trace_buffer.tb_ptr->cse_tid = (unsigned)ntp >> 4;
+ trace_buffer.tb_ptr->cse_tid = (unsigned)currp >> 6;
if (++trace_buffer.tb_ptr >= &trace_buffer.tb_buffer[TRACE_BUFFER_SIZE])
trace_buffer.tb_ptr = &trace_buffer.tb_buffer[0];
}
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c
index c75f099f6..d412798c0 100644
--- a/os/kernel/src/chschd.c
+++ b/os/kernel/src/chschd.c
@@ -101,7 +101,7 @@ void chSchGoSleepS(tstate_t newstate) {
#endif
setcurrp(fifo_remove(&rlist.r_queue));
currp->p_state = THD_STATE_CURRENT;
- chDbgTrace(currp, otp);
+ chDbgTrace(otp);
chSysSwitchI(currp, otp);
}
#endif /* !defined(PORT_OPTIMIZED_GOSLEEPS) */
@@ -199,7 +199,7 @@ void chSchWakeupS(Thread *ntp, msg_t msg) {
#endif
setcurrp(ntp);
ntp->p_state = THD_STATE_CURRENT;
- chDbgTrace(ntp, otp);
+ chDbgTrace(otp);
chSysSwitchI(ntp, otp);
}
}
@@ -222,7 +222,7 @@ void chSchDoRescheduleI(void) {
setcurrp(fifo_remove(&rlist.r_queue));
currp->p_state = THD_STATE_CURRENT;
chSchReadyI(otp);
- chDbgTrace(currp, otp);
+ chDbgTrace(otp);
chSysSwitchI(currp, otp);
}
#endif /* !defined(PORT_OPTIMIZED_DORESCHEDULEI) */
diff --git a/os/ports/GCC/ARMCM3/chcore.c b/os/ports/GCC/ARMCM3/chcore.c
index f800c2fb7..2a5727961 100644
--- a/os/ports/GCC/ARMCM3/chcore.c
+++ b/os/ports/GCC/ARMCM3/chcore.c
@@ -160,7 +160,7 @@ void PendSVVector(void) {
/* Set the round-robin time quantum.*/
rlist.r_preempt = CH_TIME_QUANTUM;
#endif
- chDbgTrace(ntp, otp);
+ chDbgTrace(otp);
sp_thd = ntp->p_ctx.r13;
POP_CONTEXT(sp_thd);