git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@159 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
05b8a7431d
commit
398c024927
|
@ -58,9 +58,10 @@ UADEFS =
|
|||
# List C source files here
|
||||
SRC = chcore.c demo.c \
|
||||
../../test/test.c ../../ports/win32/simcom.c \
|
||||
../../src/chinit.c ../../src/chlists.c ../../src/chdelta.c ../../src/chschd.c \
|
||||
../../src/chthreads.c ../../src/chsem.c ../../src/chevents.c ../../src/chmsg.c \
|
||||
../../src/chsleep.c ../../src/chqueues.c ../../src/chserial.c
|
||||
../../src/chinit.c ../../src/chdebug.c ../../src/chlists.c ../../src/chdelta.c \
|
||||
../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chmtx.c \
|
||||
../../src/chevents.c ../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c \
|
||||
../../src/chserial.c \
|
||||
|
||||
# List ASM source files here
|
||||
ASRC = chcore2.s
|
||||
|
|
|
@ -159,7 +159,7 @@ static t_msg ShellThread(void *arg) {
|
|||
FullDuplexDriver *sd = (FullDuplexDriver *)arg;
|
||||
char *lp, line[64];
|
||||
Thread *tp;
|
||||
WorkingArea(tarea, 1024);
|
||||
WorkingArea(tarea, 2048);
|
||||
|
||||
chIQReset(&sd->sd_iqueue);
|
||||
chOQReset(&sd->sd_oqueue);
|
||||
|
@ -221,7 +221,7 @@ static t_msg ShellThread(void *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static WorkingArea(s1area, 2048);
|
||||
static WorkingArea(s1area, 4096);
|
||||
static Thread *s1;
|
||||
EventListener s1tel;
|
||||
|
||||
|
@ -244,7 +244,7 @@ static void COM1Handler(t_eventid id) {
|
|||
chIQReset(&COM1.sd_iqueue);
|
||||
}
|
||||
|
||||
static WorkingArea(s2area, 2048);
|
||||
static WorkingArea(s2area, 4096);
|
||||
static Thread *s2;
|
||||
EventListener s2tel;
|
||||
|
||||
|
|
20
src/chmtx.c
20
src/chmtx.c
|
@ -212,23 +212,6 @@ void chMtxUnlockAll(void) {
|
|||
|
||||
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) {
|
||||
do {
|
||||
Mutex *mp = currp->p_mtxlist;
|
||||
|
@ -238,7 +221,10 @@ void chMtxUnlockAllS(void) {
|
|||
chSchReadyI(fifo_remove(&mp->m_queue), RDY_OK);
|
||||
} while (currp->p_mtxlist != NULL);
|
||||
currp->p_prio = currp->p_realprio;
|
||||
chSchRescheduleS();
|
||||
}
|
||||
|
||||
chSysUnlock();
|
||||
}
|
||||
|
||||
#endif /* CH_USE_MUTEXES */
|
||||
|
|
|
@ -49,7 +49,6 @@ extern "C" {
|
|||
void chMtxUnlock(void);
|
||||
void chMtxUnlockS(void);
|
||||
void chMtxUnlockAll(void);
|
||||
void chMtxUnlockAllS(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
12
test/test.c
12
test/test.c
|
@ -23,7 +23,7 @@
|
|||
void ChkIntSources(void);
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) && defined(_DEBUG)
|
||||
#if defined(WIN32)
|
||||
static WorkingArea(wsT1, 512);
|
||||
static WorkingArea(wsT2, 512);
|
||||
static WorkingArea(wsT3, 512);
|
||||
|
@ -82,8 +82,11 @@ __attribute__((noinline))
|
|||
void CPU(t_time ms) {
|
||||
|
||||
t_time time = chSysGetTime() + ms;
|
||||
while (chSysGetTime() != time)
|
||||
;
|
||||
while (chSysGetTime() != time) {
|
||||
#if defined(WIN32)
|
||||
ChkIntSources();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((noinline))
|
||||
|
@ -518,6 +521,9 @@ void bench5(void) {
|
|||
i |= chIQGet(&iq) << 8;
|
||||
i |= chIQGet(&iq);
|
||||
i++;
|
||||
#if defined(WIN32)
|
||||
ChkIntSources();
|
||||
#endif
|
||||
}
|
||||
print("Queues throughput = ");
|
||||
printn(i * 4);
|
||||
|
|
Loading…
Reference in New Issue