mirror of https://github.com/rusefi/ChibiOS.git
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@553 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
b1e4025ebd
commit
5300fced15
|
@ -172,20 +172,26 @@
|
||||||
#define THREAD_EXT_FIELDS \
|
#define THREAD_EXT_FIELDS \
|
||||||
struct { \
|
struct { \
|
||||||
/* Add thread custom fields here.*/ \
|
/* Add thread custom fields here.*/ \
|
||||||
|
/* The thread termination \p EventSource.*/ \
|
||||||
|
EventSource p_exitesource; \
|
||||||
};
|
};
|
||||||
|
|
||||||
/** User initialization code added to the \p chThdCreate() API.
|
/** User initialization code added to the \p chThdCreate() API.
|
||||||
* @note It is invoked from within \p chThdInit(). */
|
* @note It is invoked from within \p chThdInit(). */
|
||||||
#define THREAD_EXT_INIT(tp) { \
|
#define THREAD_EXT_INIT(tp) { \
|
||||||
/* Add thread initialization code here.*/ \
|
/* Add thread initialization code here.*/ \
|
||||||
|
chEvtInit(&tp->p_exitesource); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/** User finalization code added to the \p chThdExit() API.
|
/** User finalization code added to the \p chThdExit() API.
|
||||||
* @note It is inserted into lock zone. */
|
* @note It is inserted into lock zone. */
|
||||||
#define THREAD_EXT_EXIT(tp) { \
|
#define THREAD_EXT_EXIT(tp) { \
|
||||||
/* Add thread finalization code here.*/ \
|
/* Add thread finalization code here.*/ \
|
||||||
|
chEvtBroadcastI(&currp->p_exitesource); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define chThdGetExitEventSource(tp) (&(tp)->p_exitesource)
|
||||||
|
|
||||||
#endif /* _CHCONF_H_ */
|
#endif /* _CHCONF_H_ */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -78,11 +78,11 @@ typedef struct {
|
||||||
|
|
||||||
#define STACK_ALIGN(n) ((((n) - 1) | sizeof(stkalign_t)) + 1)
|
#define STACK_ALIGN(n) ((((n) - 1) | sizeof(stkalign_t)) + 1)
|
||||||
|
|
||||||
#define THD_WA_SIZE(n) StackAlign(sizeof(Thread) + \
|
#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \
|
||||||
sizeof(void *) * 2 + \
|
sizeof(void *) * 2 + \
|
||||||
sizeof(struct intctx) + \
|
sizeof(struct intctx) + \
|
||||||
(n) + \
|
(n) + \
|
||||||
INT_REQUIRED_STACK)
|
INT_REQUIRED_STACK)
|
||||||
|
|
||||||
#define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)];
|
#define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)];
|
||||||
|
|
||||||
|
|
|
@ -76,8 +76,10 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
|
||||||
*** 1.0.0 RC1 ***
|
*** 1.0.0 RC1 ***
|
||||||
- FIX: Disabled the configuration option CH_USE_MESSAGES_PRIORITY from the
|
- FIX: Disabled the configuration option CH_USE_MESSAGES_PRIORITY from the
|
||||||
MSP430 demo, the default for this option should be off.
|
MSP430 demo, the default for this option should be off.
|
||||||
- Removed deprecated threads APIs: chThdCreate() and chThdCreateFast(), removed
|
- FIX: Fixed a bug that prevented the THREAD_EXT_FIELDS to be compiled into
|
||||||
some references to those APIs from the test suite.
|
the Thread structure.
|
||||||
|
- FIX: Removed some references to deèrecated APIs from the test suite.
|
||||||
|
- Removed deprecated threads APIs: chThdCreate() and chThdCreateFast().
|
||||||
- Removed deprecated events APIs: chEvtWait(), chEvtWaitTimeout(), chEvtSend(),
|
- Removed deprecated events APIs: chEvtWait(), chEvtWaitTimeout(), chEvtSend(),
|
||||||
chEvtSendI(), EventMask().
|
chEvtSendI(), EventMask().
|
||||||
- Removed deprecated configuration feature CH_USE_EXIT_EVENT and the related
|
- Removed deprecated configuration feature CH_USE_EXIT_EVENT and the related
|
||||||
|
|
|
@ -112,9 +112,8 @@ struct Thread {
|
||||||
/** Memory Pool where the thread workspace is returned. */
|
/** Memory Pool where the thread workspace is returned. */
|
||||||
void *p_mpool;
|
void *p_mpool;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CH_USE_THREAD_EXT
|
/* Extra fields defined in chconf.h */
|
||||||
THREAD_EXT_FIELDS
|
THREAD_EXT_FIELDS
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Thread state: Ready to run, waiting on the ready list.*/
|
/** Thread state: Ready to run, waiting on the ready list.*/
|
||||||
|
|
Loading…
Reference in New Issue