Fixed bug 3303841.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_2.2.x@2975 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2011-05-19 17:58:18 +00:00
parent ef74e0f80c
commit 9754b801b5
7 changed files with 31 additions and 18 deletions

View File

@ -187,8 +187,10 @@ struct Thread {
#define THD_STATE_SNDMSG 10
/** @brief Thread state: Waiting in @p chMsgWait().*/
#define THD_STATE_WTMSG 11
/** @brief Thread state: Waiting on an I/O queue.*/
#define THD_STATE_WTQUEUE 12
/** @brief Thread state: After termination.*/
#define THD_STATE_FINAL 12
#define THD_STATE_FINAL 13
/*
* Various flags into the thread p_flags field.

View File

@ -86,6 +86,8 @@ void heap_init(void) {
* @brief Initializes a memory heap from a static memory area.
* @pre Both the heap buffer base and the heap size must be aligned to
* the @p stkalign_t type size.
* @pre In order to use this function the option @p CH_USE_MALLOC_HEAP
* must be disabled.
*
* @param[out] heapp pointer to the memory heap descriptor to be initialized
* @param[in] buf heap buffer base

View File

@ -140,14 +140,16 @@ void chMtxLockS(Mutex *mp) {
prio_insert(dequeue(tp), (ThreadsQueue *)tp->p_u.wtobjp);
tp = ((Mutex *)tp->p_u.wtobjp)->m_owner;
continue;
#if CH_USE_CONDVARS | CH_USE_SEMAPHORES_PRIORITY | CH_USE_MESSAGES_PRIORITY
#if CH_USE_CONDVARS | \
(CH_USE_SEMAPHORES && CH_USE_SEMAPHORES_PRIORITY) | \
(CH_USE_MESSAGES && CH_USE_MESSAGES_PRIORITY)
#if CH_USE_CONDVARS
case THD_STATE_WTCOND:
#endif
#if CH_USE_SEMAPHORES_PRIORITY
#if CH_USE_SEMAPHORES && CH_USE_SEMAPHORES_PRIORITY
case THD_STATE_WTSEM:
#endif
#if CH_USE_MESSAGES_PRIORITY
#if CH_USE_MESSAGES && CH_USE_MESSAGES_PRIORITY
case THD_STATE_SNDMSG:
#endif
/* Re-enqueues tp with its new priority on the queue.*/

View File

@ -136,12 +136,16 @@ static void wakeup(void *p) {
/* Handling the special case where the thread has been made ready by
another thread with higher priority.*/
return;
#if CH_USE_SEMAPHORES || (CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT)
#if CH_USE_SEMAPHORES || CH_USE_QUEUES || \
(CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT)
#if CH_USE_SEMAPHORES
case THD_STATE_WTSEM:
chSemFastSignalI((Semaphore *)tp->p_u.wtobjp);
/* Falls into, intentional. */
#endif
#if CH_USE_QUEUES
case THD_STATE_WTQUEUE:
#endif
#if CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT
case THD_STATE_WTCOND:
#endif

View File

@ -69,6 +69,7 @@
*****************************************************************************
*** 2.2.4 ***
- FIX: Fixed CH_USE_HEAP and CH_USE_MALLOC_HEAP conflict (bug 3303841).
- FIX: Fixed timeout problem in the lwIP interface layer (bug 3302420).
- FIX: Fixed invalid BRR() macro in AVR serial driver (bug 3299306).
- FIX: Fixed missing IRQ vectors amicable names for STM32 XL devices (bug

View File

@ -59,11 +59,11 @@
* @brief Dynamic thread APIs test header file
*/
#if CH_USE_DYNAMIC
#if CH_USE_HEAP
#if CH_USE_DYNAMIC || defined(__DOXYGEN__)
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
static MemoryHeap heap1;
#endif
#if CH_USE_MEMPOOLS
#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
static MemoryPool mp1;
#endif
@ -84,7 +84,7 @@ static msg_t thread(void *p) {
return 0;
}
#if CH_USE_HEAP
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
static void dyn1_setup(void) {
chHeapInit(&heap1, test.buffer, sizeof(union test_buffers));
@ -130,9 +130,9 @@ ROMCONST struct testcase testdyn1 = {
NULL,
dyn1_execute
};
#endif /* CH_USE_HEAP */
#endif /* (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) */
#if CH_USE_MEMPOOLS
#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
/**
* @page test_dynamic_002 Threads creation from Memory Pool
*
@ -188,7 +188,8 @@ ROMCONST struct testcase testdyn2 = {
};
#endif /* CH_USE_MEMPOOLS */
#if CH_USE_HEAP && CH_USE_REGISTRY
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP && CH_USE_REGISTRY) || \
defined(__DOXYGEN__)
/**
* @page test_dynamic_003 Registry and References test
*
@ -257,14 +258,15 @@ ROMCONST struct testcase testdyn3 = {
* @brief Test sequence for dynamic APIs.
*/
ROMCONST struct testcase * ROMCONST patterndyn[] = {
#if CH_USE_DYNAMIC
#if CH_USE_HEAP
#if CH_USE_DYNAMIC || defined(__DOXYGEN__)
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
&testdyn1,
#endif
#if CH_USE_MEMPOOLS
#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
&testdyn2,
#endif
#if CH_USE_HEAP && CH_USE_REGISTRY
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP && CH_USE_REGISTRY) || \
defined(__DOXYGEN__)
&testdyn3,
#endif
#endif

View File

@ -54,7 +54,7 @@
* @brief Heap header file
*/
#if CH_USE_HEAP
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
#define SIZE 16
@ -162,7 +162,7 @@ ROMCONST struct testcase testheap1 = {
* @brief Test sequence for heap.
*/
ROMCONST struct testcase * ROMCONST patternheap[] = {
#if CH_USE_HEAP
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
&testheap1,
#endif
NULL