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

This commit is contained in:
gdisirio 2007-09-25 18:41:39 +00:00
parent 619b739d93
commit 95b238fc86
13 changed files with 87 additions and 84 deletions

View File

@ -72,7 +72,7 @@
/** Configuration option: if specified then the Semaphores APIs with priority
* shift are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.*/
//#define CH_USE_RT_SEMAPHORES
#define CH_USE_RT_SEMAPHORES
/** Configuration option: if specified then the Events APIs are included in
* the kernel.*/
@ -82,7 +82,7 @@
* function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
//#define CH_USE_EVENTS_TIMEOUT
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
* included in the kernel.*/
@ -92,13 +92,13 @@
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
//#define CH_USE_MESSAGES_TIMEOUT
#define CH_USE_MESSAGES_TIMEOUT
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
//#define CH_USE_MESSAGES_EVENT
#define CH_USE_MESSAGES_EVENT
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.

View File

@ -33,7 +33,7 @@
typedef BYTE8 t_tmode;
typedef BYTE8 t_tstate;
typedef WORD16 t_prio;
typedef LONG32 t_prio;
typedef PTR_EQ t_msg;
typedef LONG32 t_eventid;
typedef ULONG32 t_eventmask;

View File

@ -33,7 +33,7 @@
typedef BYTE8 t_tmode;
typedef BYTE8 t_tstate;
typedef WORD16 t_prio;
typedef LONG32 t_prio;
typedef PTR_EQ t_msg;
typedef LONG32 t_eventid;
typedef ULONG32 t_eventmask;

View File

@ -33,7 +33,7 @@
typedef BYTE8 t_tmode;
typedef BYTE8 t_tstate;
typedef WORD16 t_prio;
typedef LONG32 t_prio;
typedef PTR_EQ t_msg;
typedef LONG32 t_eventid;
typedef ULONG32 t_eventmask;

View File

@ -4,7 +4,7 @@
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = ChibiOS/RT
PROJECT_NUMBER = "0.2.0 alpha"
PROJECT_NUMBER = "0.2.1 alpha"
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English

View File

@ -17,8 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LPC2000_SERIAL_H_
#define _LPC2000_SERIAL_H_
#ifndef _LPC214x_SERIAL_H_
#define _LPC214x_SERIAL_H_
void InitSerial(void);
void SetUARTI(UART *u, int speed, int lcr, int fcr);
@ -27,4 +27,4 @@ void UART1IrqHandler(void);
extern FullDuplexDriver COM1, COM2;
#endif /* _LPC2000_SERIAL_H_*/
#endif /* _LPC214x_SERIAL_H_*/

View File

@ -11,8 +11,10 @@
under ./demos/.
./ports/ - Architecture/compiler specific portable files.
./demos/ - Demo programs for specific archtectures/boards.
./docs/doxifile - Doxigen project file.
./docs/index.html - ChibiOS/RT documentation (after running doxigen).
./docs/Doxifile - Doxigen project file.
./docs/index.html - ChibiOS/RT documentation (after running doxigen). The
documentation is also available on the project web
page: http://chibios.sourceforge.net/
Current ports under ./demos:
@ -30,6 +32,15 @@ LPC214x-GCC - ChibiOS/RT port for ARM7 LPC2148, the demo targets the
*** Releases ***
*****************************************************************************
*** 0.2.1 ***
- Optimizations in the RT semaphores subsystem. The support for this
subsystem should still be considered experimental and further changes may
happen in future versions.
- Bug fix in the virtual timers handling code, now the timers can be re-armed
from within the callback code in order to create periodic virtual timers.
- Modified the t_prio type in the demos to be 32bits wide instead of 16bits,
this results in a better code in critical sections of the kernel.
*** 0.2.0 ***
- Introduced support for ARM in thumb mode.
- Optimized context switching when thumb-interworking is not required, one

View File

@ -188,17 +188,7 @@ void chSchTimerHandlerI(void) {
#endif
#ifdef CH_USE_VIRTUAL_TIMERS
if (&dlist != (DeltaList *)dlist.dl_next) {
VirtualTimer *vtp;
--dlist.dl_next->vt_dtime;
while (!(vtp = dlist.dl_next)->vt_dtime) {
vtp->vt_prev->vt_next = vtp->vt_next;
vtp->vt_next->vt_prev = vtp->vt_prev;
vtp->vt_func(vtp->vt_par);
vtp->vt_func = 0; // Required, flags the timer as triggered.
}
}
chVTDoTickI();
#endif
}

View File

@ -288,7 +288,7 @@ void chSemLowerPrioSignal(Semaphore *sp) {
chSysLock();
if (!--currp->p_rtcnt) {
currp->p_prio = currp->p_bakprio;
currp->p_prio -= MEPRIO;
if (sp->s_cnt++ < 0)
chSchReadyI(dequeue(sp->s_queue.p_next));
chSchRescheduleI();
@ -308,14 +308,11 @@ void chSemLowerPrioSignal(Semaphore *sp) {
* option is enabled in \p chconf.h.
*/
void chSemRaisePrioSignalWait(Semaphore *sps, Semaphore *spw) {
BOOL flag;
chSysLock();
if (sps->s_cnt++ < 0)
chSchReadyI(dequeue(sps->s_queue.p_next)), flag = TRUE;
else
flag = FALSE;
chSchReadyI(dequeue(sps->s_queue.p_next));
if (--spw->s_cnt < 0) {
prioenq(currp, &spw->s_queue);
@ -323,19 +320,13 @@ void chSemRaisePrioSignalWait(Semaphore *sps, Semaphore *spw) {
if (!currp->p_rtcnt++)
currp->p_prio += MEPRIO;
chSysUnlock();
return;
}
if (!currp->p_rtcnt++) {
currp->p_bakprio = currp->p_prio;
else {
if (!currp->p_rtcnt++)
currp->p_prio += MEPRIO;
flag = TRUE;
}
if( flag)
chSchRescheduleI();
}
chSysUnlock();
}
@ -349,21 +340,20 @@ void chSemRaisePrioSignalWait(Semaphore *sps, Semaphore *spw) {
* option is enabled in \p chconf.h.
*/
void chSemLowerPrioSignalWait(Semaphore *sps, Semaphore *spw) {
BOOL flag = FALSE;
chSysLock();
if (!--currp->p_rtcnt)
currp->p_prio = currp->p_bakprio, flag = TRUE;
currp->p_prio -= MEPRIO;
if (sps->s_cnt++ < 0)
chSchReadyI(dequeue(sps->s_queue.p_next)), flag = TRUE;
chSchReadyI(dequeue(sps->s_queue.p_next));
if (--spw->s_cnt < 0) {
enqueue(currp, &spw->s_queue); // enqueue() because the spw is a normal sem.
chSchGoSleepI(PRWTSEM);
}
else if (flag)
else
chSchRescheduleI();
chSysUnlock();

View File

@ -61,7 +61,6 @@ void _InitThread(t_prio prio, t_tmode mode, Thread *tp) {
tp->p_rdymsg = RDY_OK;
#ifdef CH_USE_RT_SEMAPHORES
tp->p_rtcnt = 0;
tp->p_bakprio = prio;
#endif
#ifdef CH_USE_WAITEXIT
tp->p_waiting.p_next = (Thread *)&tp->p_waiting;

View File

@ -69,6 +69,20 @@ typedef struct {
extern DeltaList dlist;
#define chVTDoTickI() \
if (&dlist != (DeltaList *)dlist.dl_next) { \
VirtualTimer *vtp; \
\
--dlist.dl_next->vt_dtime; \
while (!(vtp = dlist.dl_next)->vt_dtime) { \
t_vtfunc fn = vtp->vt_func; \
vtp->vt_func = 0; \
vtp->vt_prev->vt_next = vtp->vt_next; \
vtp->vt_next->vt_prev = vtp->vt_prev; \
fn(vtp->vt_par); \
} \
}
/*
* Virtual Timers APIs.
*/

View File

@ -104,9 +104,8 @@ struct Thread {
#endif
#ifdef CH_USE_RT_SEMAPHORES
/** Priority backup after acquiring a RT semaphore.*/
t_prio p_bakprio;
/** RT semaphores depth counter.*/
WORD16 p_rtcnt;
int p_rtcnt;
#endif
};

View File

@ -40,7 +40,7 @@
typedef BYTE8 t_tmode;
typedef BYTE8 t_tstate;
typedef WORD16 t_prio;
typedef LONG32 t_prio;
typedef PTR_EQ t_msg;
typedef LONG32 t_eventid;
typedef ULONG32 t_eventmask;