git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@109 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2007-11-23 16:09:11 +00:00
parent cc85ca11fb
commit 0f22fb555e
2 changed files with 17 additions and 26 deletions

View File

@ -47,8 +47,8 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not complete yet.
not used in this scenario and this greatly improves both code size and
speed.
It is recommended to either use ARM mode or THUMB mode and not mix them
unless you know exactly what you are doing and understand the consequences.
Mixing is still supported anyway.
unless you know exactly what you are doing. Mixing modes is still supported
anyway.
- More optimizations in the scheduler, an extra 4% performance found using
the default performance settings.
- Fixed a problem with the thread working area declarations, the alignment to

View File

@ -48,7 +48,7 @@ void chSchInit(void) {
* @param msg message to the awakened thread
* @return the Thread pointer
* @note The function must be called in the system mutex zone.
* @note The function does not reschedule, the \p chSchRescheduleI() should
* @note The function does not reschedule, the \p chSchRescheduleS() should
* be called soon after.
* @note The function is not meant to be used in the user code directly.
*/
@ -69,25 +69,6 @@ void chSchReadyI(Thread *tp, t_msg msg) {
tp->p_next->p_prev = cp->p_next = tp;
}
/*
* Switches to the next thread in the ready list, the ready list is assumed
* to contain at least a thread.
*/
#ifdef CH_OPTIMIZE_SPEED
static INLINE void nextready(void) {
#else
static void nextready(void) {
#endif
Thread *otp = currp;
(currp = fifo_remove(&rlist.r_queue))->p_state = PRCURR;
rlist.r_preempt = CH_TIME_QUANTUM;
#ifdef CH_USE_DEBUG
chDbgTrace(otp, currp);
#endif
chSysSwitchI(&otp->p_ctx, &currp->p_ctx);
}
/**
* Puts the current thread to sleep into the specified state, the next highest
* priority thread becomes running. The threads states are described into
@ -97,10 +78,20 @@ static void nextready(void) {
* @note The function must be called in the system mutex zone.
* @note The function is not meant to be used in the user code directly.
*/
#ifdef CH_OPTIMIZE_SPEED
INLINE void chSchGoSleepS(t_tstate newstate) {
#else
void chSchGoSleepS(t_tstate newstate) {
#endif
Thread *otp;
currp->p_state = newstate;
nextready();
(otp = currp)->p_state = newstate;
(currp = fifo_remove(&rlist.r_queue))->p_state = PRCURR;
rlist.r_preempt = CH_TIME_QUANTUM;
#ifdef CH_USE_DEBUG
chDbgTrace(otp, currp);
#endif
chSysSwitchI(&otp->p_ctx, &currp->p_ctx);
}
/**
@ -112,7 +103,7 @@ void chSchGoSleepS(t_tstate newstate) {
* @note The function must be called in the system mutex zone.
* @note The function is not meant to be used in the user code directly.
* @note It is equivalent to a \p chSchReadyI() followed by a
* \p chSchRescheduleI() but much more efficient.
* \p chSchRescheduleS() but much more efficient.
*/
void chSchWakeupS(Thread *ntp, t_msg msg) {
@ -151,7 +142,7 @@ void chSchRescheduleS(void) {
void chSchDoRescheduleI(void) {
chSchReadyI(currp, RDY_OK);
nextready();
chSchGoSleepS(PRREADY);
}
/**