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 #define THD_STATE_SNDMSG 10
/** @brief Thread state: Waiting in @p chMsgWait().*/ /** @brief Thread state: Waiting in @p chMsgWait().*/
#define THD_STATE_WTMSG 11 #define THD_STATE_WTMSG 11
/** @brief Thread state: Waiting on an I/O queue.*/
#define THD_STATE_WTQUEUE 12
/** @brief Thread state: After termination.*/ /** @brief Thread state: After termination.*/
#define THD_STATE_FINAL 12 #define THD_STATE_FINAL 13
/* /*
* Various flags into the thread p_flags field. * 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. * @brief Initializes a memory heap from a static memory area.
* @pre Both the heap buffer base and the heap size must be aligned to * @pre Both the heap buffer base and the heap size must be aligned to
* the @p stkalign_t type size. * 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[out] heapp pointer to the memory heap descriptor to be initialized
* @param[in] buf heap buffer base * @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); prio_insert(dequeue(tp), (ThreadsQueue *)tp->p_u.wtobjp);
tp = ((Mutex *)tp->p_u.wtobjp)->m_owner; tp = ((Mutex *)tp->p_u.wtobjp)->m_owner;
continue; 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 #if CH_USE_CONDVARS
case THD_STATE_WTCOND: case THD_STATE_WTCOND:
#endif #endif
#if CH_USE_SEMAPHORES_PRIORITY #if CH_USE_SEMAPHORES && CH_USE_SEMAPHORES_PRIORITY
case THD_STATE_WTSEM: case THD_STATE_WTSEM:
#endif #endif
#if CH_USE_MESSAGES_PRIORITY #if CH_USE_MESSAGES && CH_USE_MESSAGES_PRIORITY
case THD_STATE_SNDMSG: case THD_STATE_SNDMSG:
#endif #endif
/* Re-enqueues tp with its new priority on the queue.*/ /* 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 /* Handling the special case where the thread has been made ready by
another thread with higher priority.*/ another thread with higher priority.*/
return; 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 #if CH_USE_SEMAPHORES
case THD_STATE_WTSEM: case THD_STATE_WTSEM:
chSemFastSignalI((Semaphore *)tp->p_u.wtobjp); chSemFastSignalI((Semaphore *)tp->p_u.wtobjp);
/* Falls into, intentional. */ /* Falls into, intentional. */
#endif #endif
#if CH_USE_QUEUES
case THD_STATE_WTQUEUE:
#endif
#if CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT #if CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT
case THD_STATE_WTCOND: case THD_STATE_WTCOND:
#endif #endif

View File

@ -69,6 +69,7 @@
***************************************************************************** *****************************************************************************
*** 2.2.4 *** *** 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 timeout problem in the lwIP interface layer (bug 3302420).
- FIX: Fixed invalid BRR() macro in AVR serial driver (bug 3299306). - FIX: Fixed invalid BRR() macro in AVR serial driver (bug 3299306).
- FIX: Fixed missing IRQ vectors amicable names for STM32 XL devices (bug - 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 * @brief Dynamic thread APIs test header file
*/ */
#if CH_USE_DYNAMIC #if CH_USE_DYNAMIC || defined(__DOXYGEN__)
#if CH_USE_HEAP #if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
static MemoryHeap heap1; static MemoryHeap heap1;
#endif #endif
#if CH_USE_MEMPOOLS #if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
static MemoryPool mp1; static MemoryPool mp1;
#endif #endif
@ -84,7 +84,7 @@ static msg_t thread(void *p) {
return 0; return 0;
} }
#if CH_USE_HEAP #if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
static void dyn1_setup(void) { static void dyn1_setup(void) {
chHeapInit(&heap1, test.buffer, sizeof(union test_buffers)); chHeapInit(&heap1, test.buffer, sizeof(union test_buffers));
@ -130,9 +130,9 @@ ROMCONST struct testcase testdyn1 = {
NULL, NULL,
dyn1_execute 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 * @page test_dynamic_002 Threads creation from Memory Pool
* *
@ -188,7 +188,8 @@ ROMCONST struct testcase testdyn2 = {
}; };
#endif /* CH_USE_MEMPOOLS */ #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 * @page test_dynamic_003 Registry and References test
* *
@ -257,14 +258,15 @@ ROMCONST struct testcase testdyn3 = {
* @brief Test sequence for dynamic APIs. * @brief Test sequence for dynamic APIs.
*/ */
ROMCONST struct testcase * ROMCONST patterndyn[] = { ROMCONST struct testcase * ROMCONST patterndyn[] = {
#if CH_USE_DYNAMIC #if CH_USE_DYNAMIC || defined(__DOXYGEN__)
#if CH_USE_HEAP #if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
&testdyn1, &testdyn1,
#endif #endif
#if CH_USE_MEMPOOLS #if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
&testdyn2, &testdyn2,
#endif #endif
#if CH_USE_HEAP && CH_USE_REGISTRY #if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP && CH_USE_REGISTRY) || \
defined(__DOXYGEN__)
&testdyn3, &testdyn3,
#endif #endif
#endif #endif

View File

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