aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-03-14 09:13:21 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-03-14 09:13:21 +0000
commit075b89133ec371480bdcf670d3f412b1cf131b0e (patch)
tree886089b9e7d4c6715a0cb2e14ea0de271b83cce4 /os/kernel
parentf1bb1a01ca40b8c999346c701450fcf0ca74827a (diff)
downloadChibiOS-075b89133ec371480bdcf670d3f412b1cf131b0e.tar.gz
ChibiOS-075b89133ec371480bdcf670d3f412b1cf131b0e.tar.bz2
ChibiOS-075b89133ec371480bdcf670d3f412b1cf131b0e.zip
Performance optimization (not complete yet).
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1739 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel')
-rw-r--r--os/kernel/include/chdebug.h2
-rw-r--r--os/kernel/include/chsys.h4
-rw-r--r--os/kernel/src/chdebug.c4
-rw-r--r--os/kernel/src/chschd.c16
-rw-r--r--os/kernel/templates/chcore.c12
-rw-r--r--os/kernel/templates/chcore.h2
6 files changed, 20 insertions, 20 deletions
diff --git a/os/kernel/include/chdebug.h b/os/kernel/include/chdebug.h
index 316d9e633..c79be7a3b 100644
--- a/os/kernel/include/chdebug.h
+++ b/os/kernel/include/chdebug.h
@@ -147,7 +147,7 @@ extern "C" {
#if CH_DBG_ENABLE_TRACE
extern TraceBuffer trace_buffer;
void trace_init(void);
- void chDbgTrace(Thread *otp, Thread *ntp);
+ void chDbgTrace(Thread *ntp, 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/include/chsys.h b/os/kernel/include/chsys.h
index 52fa7331b..0a2fa67ad 100644
--- a/os/kernel/include/chsys.h
+++ b/os/kernel/include/chsys.h
@@ -40,10 +40,10 @@
/**
* @brief Performs a context switch.
*
- * @param[in] otp the thread to be switched out
* @param[in] ntp the thread to be switched in
+ * @param[in] otp the thread to be switched out
*/
-#define chSysSwitchI(otp, ntp) port_switch(otp, ntp)
+#define chSysSwitchI(ntp, otp) port_switch(ntp, otp)
/**
* @brief Raises the system interrupt priority mask to the maximum level.
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);
}
}
diff --git a/os/kernel/templates/chcore.c b/os/kernel/templates/chcore.c
index 2bca5eb6c..0d4f8c3a1 100644
--- a/os/kernel/templates/chcore.c
+++ b/os/kernel/templates/chcore.c
@@ -80,8 +80,8 @@ void port_disable(void) {
}
/**
- * @brief Disables the interrupt sources that are not supposed to preempt
- * the kernel.
+ * @brief Disables the interrupt sources below kernel-level priority.
+ * @note Interrupt sources above kernel level remains enabled.
*/
void port_suspend(void) {
}
@@ -93,7 +93,7 @@ void port_enable(void) {
}
/**
- * @brief Enters an architecture-dependent halt mode.
+ * @brief Enters an architecture-dependent IRQ-waiting mode.
* @details The function is meant to return when an interrupt becomes pending.
* The simplest implementation is an empty function or macro but this
* would not take advantage of architecture-specific power saving
@@ -123,10 +123,10 @@ void port_halt(void) {
* @note The implementation of this code affects <b>directly</b> the context
* switch performance so optimize here as much as you can.
*
- * @param otp the thread to be switched out
- * @param ntp the thread to be switched in
+ * @param[in] ntp the thread to be switched in
+ * @param[in] otp the thread to be switched out
*/
-void port_switch(Thread *otp, Thread *ntp) {
+void port_switch(Thread *ntp, Thread *otp) {
}
/** @} */
diff --git a/os/kernel/templates/chcore.h b/os/kernel/templates/chcore.h
index e3fa8f0b9..b6d8550d6 100644
--- a/os/kernel/templates/chcore.h
+++ b/os/kernel/templates/chcore.h
@@ -159,7 +159,7 @@ extern "C" {
void port_enable(void);
void port_wait_for_interrupt(void);
void port_halt(void);
- void port_switch(Thread *otp, Thread *ntp);
+ void port_switch(Thread *ntp, Thread *otp);
#ifdef __cplusplus
}
#endif