From 075b89133ec371480bdcf670d3f412b1cf131b0e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 14 Mar 2010 09:13:21 +0000 Subject: Performance optimization (not complete yet). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1739 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chdebug.c | 4 ++-- os/kernel/src/chschd.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'os/kernel/src') diff --git a/os/kernel/src/chdebug.c b/os/kernel/src/chdebug.c index ebe93e8a5..969718082 100644 --- a/os/kernel/src/chdebug.c +++ b/os/kernel/src/chdebug.c @@ -45,10 +45,10 @@ void trace_init(void) { /** * @brief Inserts in the circular debug trace buffer a context switch record. * - * @param[in] otp the thread being switched out * @param[in] ntp the thread to be switched in + * @param[in] otp the thread being switched out */ -void chDbgTrace(Thread *otp, Thread *ntp) { +void chDbgTrace(Thread *ntp, Thread *otp) { trace_buffer.tb_ptr->cse_wtobjp = otp->p_u.wtobjp; trace_buffer.tb_ptr->cse_time = chTimeNow(); diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 8cfd5cd81..441559c36 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -90,8 +90,8 @@ void chSchGoSleepS(tstate_t newstate) { #if CH_TIME_QUANTUM > 0 rlist.r_preempt = CH_TIME_QUANTUM; #endif - chDbgTrace(otp, currp); - chSysSwitchI(otp, currp); + chDbgTrace(currp, otp); + chSysSwitchI(currp, otp); } /* @@ -185,8 +185,8 @@ void chSchWakeupS(Thread *ntp, msg_t msg) { rlist.r_preempt = CH_TIME_QUANTUM; #endif (currp = ntp)->p_state = THD_STATE_CURRENT; - chDbgTrace(otp, ntp); - chSysSwitchI(otp, ntp); + chDbgTrace(ntp, otp); + chSysSwitchI(ntp, otp); } } @@ -204,8 +204,8 @@ void chSchDoRescheduleI(void) { #if CH_TIME_QUANTUM > 0 rlist.r_preempt = CH_TIME_QUANTUM; #endif - chDbgTrace(otp, currp); - chSysSwitchI(otp, currp); + chDbgTrace(currp, otp); + chSysSwitchI(currp, otp); } /** @@ -272,8 +272,8 @@ void chSchDoYieldS(void) { #if CH_TIME_QUANTUM > 0 rlist.r_preempt = CH_TIME_QUANTUM; #endif - chDbgTrace(otp, currp); - chSysSwitchI(otp, currp); + chDbgTrace(currp, otp); + chSysSwitchI(currp, otp); } } -- cgit v1.2.3