kernel: don't use u32_t for data sizes
Use a size_t instead. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
22553a7edb
commit
b5c681071a
|
@ -4973,7 +4973,7 @@ extern void z_timer_expiration_handler(struct _timeout *t);
|
|||
#define K_THREAD_STACK_LEN(size) ARCH_THREAD_STACK_LEN(size)
|
||||
#define K_THREAD_STACK_MEMBER(sym, size) ARCH_THREAD_STACK_MEMBER(sym, size)
|
||||
#define K_THREAD_STACK_SIZEOF(sym) ARCH_THREAD_STACK_SIZEOF(sym)
|
||||
#define K_THREAD_STACK_RESERVED ARCH_THREAD_STACK_RESERVED
|
||||
#define K_THREAD_STACK_RESERVED ((size_t)ARCH_THREAD_STACK_RESERVED)
|
||||
static inline char *Z_THREAD_STACK_BUFFER(k_thread_stack_t *sym)
|
||||
{
|
||||
return ARCH_THREAD_STACK_BUFFER(sym);
|
||||
|
@ -5082,7 +5082,7 @@ static inline char *Z_THREAD_STACK_BUFFER(k_thread_stack_t *sym)
|
|||
* the stack object, and does not account for additional space used due to
|
||||
* enforce alignment.
|
||||
*/
|
||||
#define K_THREAD_STACK_RESERVED 0
|
||||
#define K_THREAD_STACK_RESERVED ((size_t)0U)
|
||||
|
||||
/**
|
||||
* @brief Get a pointer to the physical stack buffer
|
||||
|
|
|
@ -599,7 +599,7 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread,
|
|||
void *p1, void *p2, void *p3,
|
||||
int prio, u32_t options, s32_t delay)
|
||||
{
|
||||
u32_t total_size;
|
||||
size_t total_size;
|
||||
struct _k_object *stack_object;
|
||||
|
||||
/* The thread and stack objects *must* be in an uninitialized state */
|
||||
|
@ -613,17 +613,17 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread,
|
|||
/* Verify that the stack size passed in is OK by computing the total
|
||||
* size and comparing it with the size value in the object metadata
|
||||
*/
|
||||
Z_OOPS(Z_SYSCALL_VERIFY_MSG(!u32_add_overflow(K_THREAD_STACK_RESERVED,
|
||||
stack_size, &total_size),
|
||||
"stack size overflow (%u+%u)",
|
||||
(unsigned int) stack_size,
|
||||
Z_OOPS(Z_SYSCALL_VERIFY_MSG(!size_add_overflow(K_THREAD_STACK_RESERVED,
|
||||
stack_size, &total_size),
|
||||
"stack size overflow (%zu+%zu)",
|
||||
stack_size,
|
||||
K_THREAD_STACK_RESERVED));
|
||||
|
||||
/* Testing less-than-or-equal since additional room may have been
|
||||
* allocated for alignment constraints
|
||||
*/
|
||||
Z_OOPS(Z_SYSCALL_VERIFY_MSG(total_size <= stack_object->data,
|
||||
"stack size %u is too big, max is %lu",
|
||||
"stack size %zu is too big, max is %lu",
|
||||
total_size, stack_object->data));
|
||||
|
||||
/* User threads may only create other user threads and they can't
|
||||
|
|
|
@ -1048,7 +1048,7 @@ void scenario_entry(void *stack_obj, size_t obj_size)
|
|||
|
||||
void test_stack_buffer(void)
|
||||
{
|
||||
printk("Reserved space: %u\n", K_THREAD_STACK_RESERVED);
|
||||
printk("Reserved space: %zu\n", K_THREAD_STACK_RESERVED);
|
||||
printk("Provided stack size: %u\n", STEST_STACKSIZE);
|
||||
scenario_entry(stest_stack, sizeof(stest_stack));
|
||||
|
||||
|
|
Loading…
Reference in a new issue