Add random number stack filling option. (#257)

Co-authored-by: TiejunZhou <50469179+TiejunMS@users.noreply.github.com>
This commit is contained in:
Xiuwen Cai
2023-05-12 10:13:42 +08:00
committed by GitHub
parent 6d9f25fac9
commit 6b8ece0ff2
13 changed files with 179 additions and 12 deletions

View File

@@ -519,6 +519,9 @@ UINT status;
ULONG flags;
ULONG temp;
UINT i, j;
#if defined(TX_ENABLE_RANDOM_NUMBER_STACK_FILLING) && defined(TX_ENABLE_STACK_CHECKING)
TX_THREAD *thread_ptr;
#endif
/* Initialize the test error/success counters. */
@@ -1072,6 +1075,15 @@ UINT i, j;
/* Make a fake thread with a fake stack. */
test_thread2.tx_thread_id = TX_THREAD_ID;
#if defined(TX_ENABLE_RANDOM_NUMBER_STACK_FILLING) && defined(TX_ENABLE_STACK_CHECKING)
/* Set the thread pointer. */
thread_ptr = &(test_thread2);
/* Initialize the stack fill value. */
thread_ptr -> tx_thread_stack_fill_value = (0xFEFEFEFEUL);
#endif
for (i = 0; i < (sizeof(test_thread2_stack)/sizeof(ULONG)); i++)
{
/* Set the fake thread stack to the fill pattern. */