kernel: add __ASSERT() for thread priorities
Verify the thread priorities are within the bounds when starting a new thread and when changing the priority of a thread. Change-Id: I007b3b249e4b80235b6439cbee44cad2f31973bb Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
c13fad3bb8
commit
3cc2ba9f9c
6 changed files with 31 additions and 0 deletions
|
@ -87,6 +87,8 @@ void _new_thread(char *pStackMem, unsigned stackSize,
|
|||
void *parameter1, void *parameter2, void *parameter3,
|
||||
int priority, unsigned options)
|
||||
{
|
||||
_ASSERT_VALID_PRIO(priority, pEntry);
|
||||
|
||||
__ASSERT(!((uint32_t)pStackMem & (STACK_ALIGN - 1)),
|
||||
"stack is not aligned properly\n"
|
||||
"%d-byte alignment required\n", STACK_ALIGN);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue