git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@226 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
1422b47cc4
commit
9d69c31143
|
@ -62,8 +62,8 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not tested on hardware yet.
|
||||||
|
|
||||||
*** 0.6.1 ***
|
*** 0.6.1 ***
|
||||||
- Removed some redundant checks from the scheduler code: improved threads
|
- Removed some redundant checks from the scheduler code: improved threads
|
||||||
flyback time.
|
flyback time, reduced interrupts service time.
|
||||||
- Huge scheduler speed improvement obtained by removing the 2nd parameter to
|
- Nice scheduler speed improvement obtained by removing the 2nd parameter to
|
||||||
the chSchReadyI() API and manually assigning the message value only where
|
the chSchReadyI() API and manually assigning the message value only where
|
||||||
is really needed (very few points in the code).
|
is really needed (very few points in the code).
|
||||||
- Removed the -falign-functions=16 option from the AT91SAM7X demo makefiles,
|
- Removed the -falign-functions=16 option from the AT91SAM7X demo makefiles,
|
||||||
|
|
17
src/chschd.c
17
src/chschd.c
|
@ -55,12 +55,11 @@ void chSchInit(void) {
|
||||||
/* NOTE: it is inlined in this module only.*/
|
/* NOTE: it is inlined in this module only.*/
|
||||||
INLINE Thread *chSchReadyI(Thread *tp) {
|
INLINE Thread *chSchReadyI(Thread *tp) {
|
||||||
#else
|
#else
|
||||||
void chSchReadyI(Thread *tp) {
|
Thread *chSchReadyI(Thread *tp) {
|
||||||
#endif
|
#endif
|
||||||
Thread *cp;
|
Thread *cp;
|
||||||
|
|
||||||
tp->p_state = PRREADY;
|
tp->p_state = PRREADY;
|
||||||
// tp->p_rdymsg = RDY_OK;
|
|
||||||
cp = rlist.r_queue.p_next;
|
cp = rlist.r_queue.p_next;
|
||||||
while (cp->p_prio >= tp->p_prio)
|
while (cp->p_prio >= tp->p_prio)
|
||||||
cp = cp->p_next;
|
cp = cp->p_next;
|
||||||
|
@ -100,7 +99,7 @@ static void wakeup(void *p) {
|
||||||
if (((Thread *)p)->p_state == PRWTSEM)
|
if (((Thread *)p)->p_state == PRWTSEM)
|
||||||
chSemFastSignalI(((Thread *)p)->p_wtsemp);
|
chSemFastSignalI(((Thread *)p)->p_wtsemp);
|
||||||
#endif
|
#endif
|
||||||
chSchReadyI(p)->p_rdymsg = RDY_TIMEOUT;;
|
chSchReadyI(p)->p_rdymsg = RDY_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -185,16 +184,10 @@ void chSchRescheduleS(void) {
|
||||||
* immediatly else \p FALSE.
|
* immediatly else \p FALSE.
|
||||||
*/
|
*/
|
||||||
bool_t chSchRescRequiredI(void) {
|
bool_t chSchRescRequiredI(void) {
|
||||||
|
tprio_t p1 = firstprio(&rlist.r_queue);
|
||||||
|
tprio_t p2 = currp->p_prio;
|
||||||
|
|
||||||
if (rlist.r_preempt) {
|
return rlist.r_preempt ? p1 > p2 : p1 >= p2;
|
||||||
if (firstprio(&rlist.r_queue) <= currp->p_prio)
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else { /* Time quantum elapsed. */
|
|
||||||
if (firstprio(&rlist.r_queue) < currp->p_prio)
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
Loading…
Reference in New Issue