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

This commit is contained in:
gdisirio 2007-12-23 09:40:50 +00:00
parent 05b8a7431d
commit 398c024927
5 changed files with 19 additions and 27 deletions

View File

@ -58,9 +58,10 @@ UADEFS =
# List C source files here # List C source files here
SRC = chcore.c demo.c \ SRC = chcore.c demo.c \
../../test/test.c ../../ports/win32/simcom.c \ ../../test/test.c ../../ports/win32/simcom.c \
../../src/chinit.c ../../src/chlists.c ../../src/chdelta.c ../../src/chschd.c \ ../../src/chinit.c ../../src/chdebug.c ../../src/chlists.c ../../src/chdelta.c \
../../src/chthreads.c ../../src/chsem.c ../../src/chevents.c ../../src/chmsg.c \ ../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chmtx.c \
../../src/chsleep.c ../../src/chqueues.c ../../src/chserial.c ../../src/chevents.c ../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c \
../../src/chserial.c \
# List ASM source files here # List ASM source files here
ASRC = chcore2.s ASRC = chcore2.s

View File

@ -159,7 +159,7 @@ static t_msg ShellThread(void *arg) {
FullDuplexDriver *sd = (FullDuplexDriver *)arg; FullDuplexDriver *sd = (FullDuplexDriver *)arg;
char *lp, line[64]; char *lp, line[64];
Thread *tp; Thread *tp;
WorkingArea(tarea, 1024); WorkingArea(tarea, 2048);
chIQReset(&sd->sd_iqueue); chIQReset(&sd->sd_iqueue);
chOQReset(&sd->sd_oqueue); chOQReset(&sd->sd_oqueue);
@ -221,7 +221,7 @@ static t_msg ShellThread(void *arg) {
return 0; return 0;
} }
static WorkingArea(s1area, 2048); static WorkingArea(s1area, 4096);
static Thread *s1; static Thread *s1;
EventListener s1tel; EventListener s1tel;
@ -244,7 +244,7 @@ static void COM1Handler(t_eventid id) {
chIQReset(&COM1.sd_iqueue); chIQReset(&COM1.sd_iqueue);
} }
static WorkingArea(s2area, 2048); static WorkingArea(s2area, 4096);
static Thread *s2; static Thread *s2;
EventListener s2tel; EventListener s2tel;

View File

@ -212,23 +212,6 @@ void chMtxUnlockAll(void) {
chSysLock(); chSysLock();
chMtxUnlockAllS();
chSchRescheduleS();
chSysUnlock();
}
/**
* Unlocks all the mutexes owned by the invoking thread, this is <b>MUCH MORE</b>
* efficient than releasing the mutexes one by one and not just because the
* call overhead, this function does not have any overhead related to the
* priority inheritance mechanism.
* @note This function must be called within a \p chSysLock() / \p chSysUnlock()
* block.
* @note This function does not reschedule internally.
*/
void chMtxUnlockAllS(void) {
if (currp->p_mtxlist != NULL) { if (currp->p_mtxlist != NULL) {
do { do {
Mutex *mp = currp->p_mtxlist; Mutex *mp = currp->p_mtxlist;
@ -238,7 +221,10 @@ void chMtxUnlockAllS(void) {
chSchReadyI(fifo_remove(&mp->m_queue), RDY_OK); chSchReadyI(fifo_remove(&mp->m_queue), RDY_OK);
} while (currp->p_mtxlist != NULL); } while (currp->p_mtxlist != NULL);
currp->p_prio = currp->p_realprio; currp->p_prio = currp->p_realprio;
chSchRescheduleS();
} }
chSysUnlock();
} }
#endif /* CH_USE_MUTEXES */ #endif /* CH_USE_MUTEXES */

View File

@ -49,7 +49,6 @@ extern "C" {
void chMtxUnlock(void); void chMtxUnlock(void);
void chMtxUnlockS(void); void chMtxUnlockS(void);
void chMtxUnlockAll(void); void chMtxUnlockAll(void);
void chMtxUnlockAllS(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -23,7 +23,7 @@
void ChkIntSources(void); void ChkIntSources(void);
#endif #endif
#if defined(WIN32) && defined(_DEBUG) #if defined(WIN32)
static WorkingArea(wsT1, 512); static WorkingArea(wsT1, 512);
static WorkingArea(wsT2, 512); static WorkingArea(wsT2, 512);
static WorkingArea(wsT3, 512); static WorkingArea(wsT3, 512);
@ -82,8 +82,11 @@ __attribute__((noinline))
void CPU(t_time ms) { void CPU(t_time ms) {
t_time time = chSysGetTime() + ms; t_time time = chSysGetTime() + ms;
while (chSysGetTime() != time) while (chSysGetTime() != time) {
; #if defined(WIN32)
ChkIntSources();
#endif
}
} }
__attribute__((noinline)) __attribute__((noinline))
@ -518,6 +521,9 @@ void bench5(void) {
i |= chIQGet(&iq) << 8; i |= chIQGet(&iq) << 8;
i |= chIQGet(&iq); i |= chIQGet(&iq);
i++; i++;
#if defined(WIN32)
ChkIntSources();
#endif
} }
print("Queues throughput = "); print("Queues throughput = ");
printn(i * 4); printn(i * 4);