kernel: use uintptr_t for kobject data

This has to be wide enough to store a pointer.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2019-11-13 12:52:00 -08:00 committed by Andrew Boie
commit e48ed6a980
3 changed files with 4 additions and 4 deletions

View file

@ -172,7 +172,7 @@ struct _k_object {
u8_t perms[CONFIG_MAX_THREAD_BYTES]; u8_t perms[CONFIG_MAX_THREAD_BYTES];
u8_t type; u8_t type;
u8_t flags; u8_t flags;
u32_t data; uintptr_t data;
} __packed __aligned(4); } __packed __aligned(4);
struct _k_object_assignment { struct _k_object_assignment {

View file

@ -623,7 +623,7 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread,
* allocated for alignment constraints * allocated for alignment constraints
*/ */
Z_OOPS(Z_SYSCALL_VERIFY_MSG(total_size <= stack_object->data, Z_OOPS(Z_SYSCALL_VERIFY_MSG(total_size <= stack_object->data,
"stack size %u is too big, max is %u", "stack size %u is too big, max is %lu",
total_size, stack_object->data)); total_size, stack_object->data));
/* User threads may only create other user threads and they can't /* User threads may only create other user threads and they can't

View file

@ -71,10 +71,10 @@ class KobjectInstance:
self.data = thread_counter self.data = thread_counter
thread_counter = thread_counter + 1 thread_counter = thread_counter + 1
elif self.type_obj.name == "sys_mutex": elif self.type_obj.name == "sys_mutex":
self.data = "(u32_t)(&kernel_mutexes[%d])" % sys_mutex_counter self.data = "(uintptr_t)(&kernel_mutexes[%d])" % sys_mutex_counter
sys_mutex_counter += 1 sys_mutex_counter += 1
elif self.type_obj.name == "k_futex": elif self.type_obj.name == "k_futex":
self.data = "(u32_t)(&futex_data[%d])" % futex_counter self.data = "(uintptr_t)(&futex_data[%d])" % futex_counter
futex_counter += 1 futex_counter += 1
else: else:
self.data = 0 self.data = 0