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

This commit is contained in:
gdisirio 2008-01-25 10:07:18 +00:00
parent 86f169d26d
commit 811bbbc8fb
4 changed files with 10 additions and 14 deletions

View File

@ -40,7 +40,7 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not complete yet.
***************************************************************************** *****************************************************************************
*** 0.5.3 *** *** 0.5.3 ***
- Removed the chMsgSendTimeout() API, it was conceptually flawed because - Removed the chMsgSendTimeout() API, it was conceptually flawed because,
after sending a message, the sender *has* to wait for the answer or after sending a message, the sender *has* to wait for the answer or
the next sender in queue would receive it instead (the messages server has the next sender in queue would receive it instead (the messages server has
no way to know that the sender is gone because a timeout). no way to know that the sender is gone because a timeout).
@ -49,8 +49,9 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not complete yet.
- Removed the test case for chMsgSendTimeout() from the test suite. - Removed the test case for chMsgSendTimeout() from the test suite.
- Space saved by reorganizing the timeout code into a single scheduler - Space saved by reorganizing the timeout code into a single scheduler
function. function.
- Space optimizations in the semaphores code.
- The API chThdSleepUntil() become a macro saving some more code space. - The API chThdSleepUntil() become a macro saving some more code space.
- Because all the above changes the kernel code (ARM) is over 600 bytes - Because all the above changes the kernel code (ARM) is over 700 bytes
smaller. smaller.
*** 0.5.2 *** *** 0.5.2 ***

View File

@ -53,9 +53,9 @@ void chEvtRegister(EventSource *esp, EventListener *elp, t_eventid eid) {
* @param elp pointer to the \p EventListener structure * @param elp pointer to the \p EventListener structure
* @note If the event listener is not registered on the specified event source * @note If the event listener is not registered on the specified event source
* then the function does nothing. * then the function does nothing.
* @note For optimal performance perform the unregister operations in inverse * @note For optimal performance it is better to perform the unregister
* order of the register operations (elements are found on top of the * operations in inverse order of the register operations (elements are
* list). * found on top of the list).
*/ */
void chEvtUnregister(EventSource *esp, EventListener *elp) { void chEvtUnregister(EventSource *esp, EventListener *elp) {
EventListener *p = (EventListener *)esp; EventListener *p = (EventListener *)esp;

View File

@ -90,6 +90,7 @@ void chSchGoSleepS(t_tstate newstate) {
chSysSwitchI(otp, currp); chSysSwitchI(otp, currp);
} }
#ifdef CH_USE_VIRTUAL_TIMERS
static void wakeup(void *p) { static void wakeup(void *p) {
if (((Thread *)p)->p_state == PRWTSEM) if (((Thread *)p)->p_state == PRWTSEM)
@ -116,6 +117,7 @@ t_msg chSchGoSleepTimeoutS(t_tstate newstate, t_time time) {
chVTResetI(&vt); chVTResetI(&vt);
return currp->p_rdymsg; return currp->p_rdymsg;
} }
#endif /* CH_USE_VIRTUAL_TIMERS */
/** /**
* Wakeups a thread, the thread is inserted into the ready list or made * Wakeups a thread, the thread is inserted into the ready list or made

View File

@ -47,18 +47,11 @@ void chSemInit(Semaphore *sp, t_cnt n) {
* \p RDY_RESET. * \p RDY_RESET.
*/ */
void chSemReset(Semaphore *sp, t_cnt n) { void chSemReset(Semaphore *sp, t_cnt n) {
t_cnt cnt;
chDbgAssert(n >= 0, "chsem.c, chSemReset()");
chSysLock(); chSysLock();
cnt = sp->s_cnt; chSemResetI(sp, n);
sp->s_cnt = n;
if (cnt < 0) {
while (cnt++)
chSchReadyI(fifo_remove(&sp->s_queue), RDY_RESET);
chSchRescheduleS(); chSchRescheduleS();
}
chSysUnlock(); chSysUnlock();
} }