Added extra assertions to threads creation to prevent registry corruption, updated the test suite.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9121 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2016-03-16 09:20:45 +00:00
parent 1a503b3dfa
commit ceeef3c918
2 changed files with 19 additions and 0 deletions

View File

@ -216,6 +216,11 @@ thread_t *chThdCreateSuspendedI(const thread_descriptor_t *tdp) {
thread_t *chThdCreateSuspended(const thread_descriptor_t *tdp) {
thread_t *tp;
#if CH_CFG_USE_REGISTRY == TRUE
chDbgAssert(chRegFindThreadByWorkingArea(tdp->wbase) == NULL,
"working area in use");
#endif
#if CH_DBG_FILL_THREADS == TRUE
_thread_memfill((uint8_t *)tdp->wbase,
(uint8_t *)tdp->wend,
@ -275,6 +280,11 @@ thread_t *chThdCreateI(const thread_descriptor_t *tdp) {
thread_t *chThdCreate(const thread_descriptor_t *tdp) {
thread_t *tp;
#if CH_CFG_USE_REGISTRY == TRUE
chDbgAssert(chRegFindThreadByWorkingArea(tdp->wbase) == NULL,
"working area in use");
#endif
#if CH_DBG_FILL_THREADS == TRUE
_thread_memfill((uint8_t *)tdp->wbase,
(uint8_t *)tdp->wend,
@ -319,6 +329,11 @@ thread_t *chThdCreateStatic(void *wsp, size_t size,
MEM_IS_ALIGNED(size, PORT_STACK_ALIGN) &&
(prio <= HIGHPRIO) && (pf != NULL));
#if CH_CFG_USE_REGISTRY == TRUE
chDbgAssert(chRegFindThreadByWorkingArea(wsp) == NULL,
"working area in use");
#endif
#if CH_DBG_FILL_THREADS == TRUE
_thread_memfill((uint8_t *)wsp,
(uint8_t *)wsp + size,

View File

@ -312,7 +312,11 @@ static void bmk6_execute(void) {
test_wait_tick();
test_start_timer(1000);
do {
#if CH_CFG_USE_REGISTRY
chThdRelease(chThdCreateStatic(wap, WA_SIZE, prio, thread1, NULL));
#else
chThdCreateStatic(wap, WA_SIZE, prio, thread1, NULL);
#endif
n++;
#if defined(SIMULATOR)
_sim_check_for_interrupts();