From a6b490073e8710b50ccd1820dc94d1bf92be3d35 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 26 Sep 2023 21:37:25 +0000 Subject: [PATCH] kernel: object: rename z_object -> k_object Do not use z_ for internal structures and rename to k_object instead. Signed-off-by: Anas Nashif --- CMakeLists.txt | 4 +- cmake/linker_script/common/common-rom.cmake | 6 +-- doc/contribute/documentation/guidelines.rst | 4 +- .../common-rom/common-rom-kernel-devices.ld | 2 +- .../zephyr/sys/internal/kobject_internal.h | 28 +++++----- include/zephyr/sys/kobject.h | 2 +- include/zephyr/syscall_handler.h | 18 +++---- kernel/futex.c | 2 +- kernel/sched.c | 2 +- kernel/thread.c | 6 +-- kernel/userspace.c | 52 +++++++++---------- kernel/userspace_handler.c | 8 +-- lib/os/mutex.c | 2 +- scripts/build/gen_kobject_list.py | 6 +-- scripts/pylib/twister/twisterlib/size_calc.py | 2 +- subsys/net/lib/sockets/socketpair.c | 2 +- .../mem_protect/mem_protect/src/kobject.c | 2 +- tests/kernel/mem_protect/userspace/src/main.c | 2 +- tests/kernel/threads/thread_stack/src/main.c | 2 +- 19 files changed, 76 insertions(+), 76 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be466a1ae81..5a40538598b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1124,7 +1124,7 @@ if(CONFIG_USERSPACE) ${PROCESS_GPERF} -i ${KOBJECT_PREBUILT_HASH_OUTPUT_SRC_PRE} -o ${KOBJECT_PREBUILT_HASH_OUTPUT_SRC} - -p "struct z_object" + -p "struct k_object" $<$:--verbose> DEPENDS kobj_prebuilt_hash_output_src_pre ${KOBJECT_PREBUILT_HASH_OUTPUT_SRC_PRE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} @@ -1316,7 +1316,7 @@ if(CONFIG_USERSPACE) ${PROCESS_GPERF} -i ${KOBJECT_HASH_OUTPUT_SRC_PRE} -o ${KOBJECT_HASH_OUTPUT_SRC} - -p "struct z_object" + -p "struct k_object" $<$:--verbose> DEPENDS kobj_hash_output_src_pre ${CMAKE_CURRENT_BINARY_DIR}/${KOBJECT_HASH_OUTPUT_SRC_PRE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} diff --git a/cmake/linker_script/common/common-rom.cmake b/cmake/linker_script/common/common-rom.cmake index 35c023e72e4..d79fa223fc5 100644 --- a/cmake/linker_script/common/common-rom.cmake +++ b/cmake/linker_script/common/common-rom.cmake @@ -67,13 +67,13 @@ if(CONFIG_USERSPACE) # Build-time assignment of permissions to kernel objects to # threads declared with K_THREAD_DEFINE() zephyr_linker_section( - NAME z_object_assignment_area + NAME k_object_assignment_area VMA FLASH NOINPUT SUBALIGN 4 ) zephyr_linker_section_configure( - SECTION z_object_assignment - INPUT ".z_object_assignment.static.*" + SECTION k_object_assignment + INPUT ".k_object_assignment.static.*" KEEP SORT NAME ) endif() diff --git a/doc/contribute/documentation/guidelines.rst b/doc/contribute/documentation/guidelines.rst index 2fd7d82785d..55db8e2e556 100644 --- a/doc/contribute/documentation/guidelines.rst +++ b/doc/contribute/documentation/guidelines.rst @@ -392,7 +392,7 @@ For example:: .. code-block:: c - struct z_object { + struct k_object { char *name; uint8_t perms[CONFIG_MAX_THREAD_BYTES]; uint8_t type; @@ -408,7 +408,7 @@ This would be rendered as: .. code-block:: c - struct z_object { + struct k_object { char *name; uint8_t perms[CONFIG_MAX_THREAD_BYTES]; uint8_t type; diff --git a/include/zephyr/linker/common-rom/common-rom-kernel-devices.ld b/include/zephyr/linker/common-rom/common-rom-kernel-devices.ld index cd5c610d3f6..dfa19d13492 100644 --- a/include/zephyr/linker/common-rom/common-rom-kernel-devices.ld +++ b/include/zephyr/linker/common-rom/common-rom-kernel-devices.ld @@ -75,7 +75,7 @@ /* Build-time assignment of permissions to kernel objects to * threads declared with K_THREAD_DEFINE() */ - ITERABLE_SECTION_ROM(z_object_assignment, 4) + ITERABLE_SECTION_ROM(k_object_assignment, 4) #endif SECTION_DATA_PROLOGUE(app_shmem_regions,,) diff --git a/include/zephyr/sys/internal/kobject_internal.h b/include/zephyr/sys/internal/kobject_internal.h index 65c62048396..15bab175e0f 100644 --- a/include/zephyr/sys/internal/kobject_internal.h +++ b/include/zephyr/sys/internal/kobject_internal.h @@ -27,7 +27,7 @@ struct z_stack_data { #endif /* CONFIG_GEN_PRIV_STACKS */ /* Object extra data. Only some objects use this, determined by object type */ -union z_object_data { +union k_object_data { /* Backing mutex for K_OBJ_SYS_MUTEX */ struct k_mutex *mutex; @@ -51,15 +51,15 @@ union z_object_data { /* Table generated by gperf, these objects are retrieved via * z_object_find() */ -struct z_object { +struct k_object { void *name; uint8_t perms[CONFIG_MAX_THREAD_BYTES]; uint8_t type; uint8_t flags; - union z_object_data data; + union k_object_data data; } __packed __aligned(4); -struct z_object_assignment { +struct k_object_assignment { struct k_thread *thread; void * const *objects; }; @@ -92,21 +92,21 @@ static inline void k_object_init(const void *obj) * This is a low-level function to allocate some memory, and register that * allocated memory in the kernel object lookup tables with type K_OBJ_ANY. * Initialization state and thread permissions will be cleared. The - * returned z_object's data value will be uninitialized. + * returned k_object's data value will be uninitialized. * * Most users will want to use k_object_alloc() instead. * * Memory allocated will be drawn from the calling thread's reasource pool * and may be freed later by passing the actual object pointer (found - * in the returned z_object's 'name' member) to k_object_free(). + * in the returned k_object's 'name' member) to k_object_free(). * * @param align Required memory alignment for the allocated object * @param size Size of the allocated object * @return NULL on insufficient memory - * @return A pointer to the associated z_object that is installed in the + * @return A pointer to the associated k_object that is installed in the * kernel object tables */ -struct z_object *k_object_create_dynamic_aligned(size_t align, size_t size); +struct k_object *k_object_create_dynamic_aligned(size_t align, size_t size); /** * Allocate memory and install as a generic kernel object @@ -114,20 +114,20 @@ struct z_object *k_object_create_dynamic_aligned(size_t align, size_t size); * This is a low-level function to allocate some memory, and register that * allocated memory in the kernel object lookup tables with type K_OBJ_ANY. * Initialization state and thread permissions will be cleared. The - * returned z_object's data value will be uninitialized. + * returned k_object's data value will be uninitialized. * * Most users will want to use k_object_alloc() instead. * * Memory allocated will be drawn from the calling thread's reasource pool * and may be freed later by passing the actual object pointer (found - * in the returned z_object's 'name' member) to k_object_free(). + * in the returned k_object's 'name' member) to k_object_free(). * * @param size Size of the allocated object * @return NULL on insufficient memory - * @return A pointer to the associated z_object that is installed in the + * @return A pointer to the associated k_object that is installed in the * kernel object tables */ -static inline struct z_object *k_object_create_dynamic(size_t size) +static inline struct k_object *k_object_create_dynamic(size_t size) { return k_object_create_dynamic_aligned(0, size); } @@ -135,7 +135,7 @@ static inline struct z_object *k_object_create_dynamic(size_t size) #else /* LCOV_EXCL_START */ -static inline struct z_object *k_object_create_dynamic_aligned(size_t align, +static inline struct k_object *k_object_create_dynamic_aligned(size_t align, size_t size) { ARG_UNUSED(align); @@ -144,7 +144,7 @@ static inline struct z_object *k_object_create_dynamic_aligned(size_t align, return NULL; } -static inline struct z_object *k_object_create_dynamic(size_t size) +static inline struct k_object *k_object_create_dynamic(size_t size) { ARG_UNUSED(size); diff --git a/include/zephyr/sys/kobject.h b/include/zephyr/sys/kobject.h index 089898c4e70..628bb967551 100644 --- a/include/zephyr/sys/kobject.h +++ b/include/zephyr/sys/kobject.h @@ -65,7 +65,7 @@ enum k_objects { #define K_THREAD_ACCESS_GRANT(name_, ...) \ static void * const _CONCAT(_object_list_, name_)[] = \ { __VA_ARGS__, NULL }; \ - static const STRUCT_SECTION_ITERABLE(z_object_assignment, \ + static const STRUCT_SECTION_ITERABLE(k_object_assignment, \ _CONCAT(_object_access_, name_)) = \ { (&_k_thread_obj_ ## name_), \ (_CONCAT(_object_list_, name_)) } diff --git a/include/zephyr/syscall_handler.h b/include/zephyr/syscall_handler.h index ac6d47a23a4..8bff82e9557 100644 --- a/include/zephyr/syscall_handler.h +++ b/include/zephyr/syscall_handler.h @@ -78,7 +78,7 @@ static inline bool z_is_in_user_syscall(void) * -EPERM If the caller does not have permissions * -EINVAL Object is not initialized */ -int z_object_validate(struct z_object *ko, enum k_objects otype, +int z_object_validate(struct k_object *ko, enum k_objects otype, enum _obj_init_check init); /** @@ -86,11 +86,11 @@ int z_object_validate(struct z_object *ko, enum k_objects otype, * * @param retval Return value from z_object_validate() * @param obj Kernel object we were trying to verify - * @param ko If retval=-EPERM, struct z_object * that was looked up, or NULL + * @param ko If retval=-EPERM, struct k_object * that was looked up, or NULL * @param otype Expected type of the kernel object */ void z_dump_object_error(int retval, const void *obj, - struct z_object *ko, enum k_objects otype); + struct k_object *ko, enum k_objects otype); /** * Kernel object validation function @@ -102,14 +102,14 @@ void z_dump_object_error(int retval, const void *obj, * @return Kernel object's metadata, or NULL if the parameter wasn't the * memory address of a kernel object */ -struct z_object *z_object_find(const void *obj); +struct k_object *z_object_find(const void *obj); -typedef void (*_wordlist_cb_func_t)(struct z_object *ko, void *context); +typedef void (*_wordlist_cb_func_t)(struct k_object *ko, void *context); /** * Iterate over all the kernel object metadata in the system * - * @param func function to run on each struct z_object + * @param func function to run on each struct k_object * @param context Context pointer to pass to each invocation */ void z_object_wordlist_foreach(_wordlist_cb_func_t func, void *context); @@ -129,7 +129,7 @@ void z_thread_perms_inherit(struct k_thread *parent, * @param ko Kernel object metadata to update * @param thread The thread to grant permission */ -void z_thread_perms_set(struct z_object *ko, struct k_thread *thread); +void z_thread_perms_set(struct k_object *ko, struct k_thread *thread); /** * Revoke a thread's permission to a kernel object @@ -137,7 +137,7 @@ void z_thread_perms_set(struct z_object *ko, struct k_thread *thread); * @param ko Kernel object metadata to update * @param thread The thread to grant permission */ -void z_thread_perms_clear(struct z_object *ko, struct k_thread *thread); +void z_thread_perms_clear(struct k_object *ko, struct k_thread *thread); /* * Revoke access to all objects for the provided thread @@ -427,7 +427,7 @@ int z_user_string_copy(char *dst, const char *src, size_t maxlen); #define Z_SYSCALL_MEMORY_ARRAY_WRITE(ptr, nmemb, size) \ Z_SYSCALL_MEMORY_ARRAY(ptr, nmemb, size, 1) -static inline int z_obj_validation_check(struct z_object *ko, +static inline int z_obj_validation_check(struct k_object *ko, const void *obj, enum k_objects otype, enum _obj_init_check init) diff --git a/kernel/futex.c b/kernel/futex.c index 40362045eab..360d2a99412 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -14,7 +14,7 @@ static struct z_futex_data *k_futex_find_data(struct k_futex *futex) { - struct z_object *obj; + struct k_object *obj; obj = z_object_find(futex); if (obj == NULL || obj->type != K_OBJ_FUTEX) { diff --git a/kernel/sched.c b/kernel/sched.c index 66b10c3b04f..12393c0eada 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1878,7 +1878,7 @@ int z_impl_k_thread_join(struct k_thread *thread, k_timeout_t timeout) */ static bool thread_obj_validate(struct k_thread *thread) { - struct z_object *ko = z_object_find(thread); + struct k_object *ko = z_object_find(thread); int ret = z_object_validate(ko, K_OBJ_THREAD, _OBJ_INIT_TRUE); switch (ret) { diff --git a/kernel/thread.c b/kernel/thread.c index 23585339e52..4a54fd5dd29 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -360,7 +360,7 @@ static inline int z_vrfy_k_thread_name_copy(k_tid_t thread, { #ifdef CONFIG_THREAD_NAME size_t len; - struct z_object *ko = z_object_find(thread); + struct k_object *ko = z_object_find(thread); /* Special case: we allow reading the names of initialized threads * even if we don't have permission on them @@ -725,7 +725,7 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread, int prio, uint32_t options, k_timeout_t delay) { size_t total_size, stack_obj_size; - struct z_object *stack_object; + struct k_object *stack_object; /* The thread and stack objects *must* be in an uninitialized state */ Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(new_thread, K_OBJ_THREAD)); @@ -791,7 +791,7 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread, static void grant_static_access(void) { - STRUCT_SECTION_FOREACH(z_object_assignment, pos) { + STRUCT_SECTION_FOREACH(k_object_assignment, pos) { for (int i = 0; pos->objects[i] != NULL; i++) { k_object_access_grant(pos->objects[i], pos->thread); diff --git a/kernel/userspace.c b/kernel/userspace.c index 02211be3029..f98654493a5 100644 --- a/kernel/userspace.c +++ b/kernel/userspace.c @@ -77,7 +77,7 @@ static struct k_spinlock obj_lock; /* kobj struct data */ extern uint8_t _thread_idx_map[CONFIG_MAX_THREAD_BYTES]; #endif -static void clear_perms_cb(struct z_object *ko, void *ctx_ptr); +static void clear_perms_cb(struct k_object *ko, void *ctx_ptr); const char *otype_to_str(enum k_objects otype) { @@ -119,7 +119,7 @@ struct perm_ctx { */ uint8_t *z_priv_stack_find(k_thread_stack_t *stack) { - struct z_object *obj = z_object_find(stack); + struct k_object *obj = z_object_find(stack); __ASSERT(obj != NULL, "stack object not found"); __ASSERT(obj->type == K_OBJ_THREAD_STACK_ELEMENT, @@ -166,14 +166,14 @@ uint8_t *z_priv_stack_find(k_thread_stack_t *stack) MAX(DYN_OBJ_DATA_ALIGN_K_THREAD, (sizeof(void *))) struct dyn_obj { - struct z_object kobj; + struct k_object kobj; sys_dnode_t dobj_list; /* The object itself */ void *data; }; -extern struct z_object *z_object_gperf_find(const void *obj); +extern struct k_object *z_object_gperf_find(const void *obj); extern void z_object_gperf_wordlist_foreach(_wordlist_cb_func_t func, void *context); @@ -311,7 +311,7 @@ static void thread_idx_free(uintptr_t tidx) sys_bitfield_set_bit((mem_addr_t)_thread_idx_map, tidx); } -static struct z_object *dynamic_object_create(enum k_objects otype, size_t align, +static struct k_object *dynamic_object_create(enum k_objects otype, size_t align, size_t size) { struct dyn_obj *dyn; @@ -373,9 +373,9 @@ static struct z_object *dynamic_object_create(enum k_objects otype, size_t align return &dyn->kobj; } -struct z_object *k_object_create_dynamic_aligned(size_t align, size_t size) +struct k_object *k_object_create_dynamic_aligned(size_t align, size_t size) { - struct z_object *obj = dynamic_object_create(K_OBJ_ANY, align, size); + struct k_object *obj = dynamic_object_create(K_OBJ_ANY, align, size); if (obj == NULL) { LOG_ERR("could not allocate kernel object, out of memory"); @@ -386,7 +386,7 @@ struct z_object *k_object_create_dynamic_aligned(size_t align, size_t size) static void *z_object_alloc(enum k_objects otype, size_t size) { - struct z_object *zo; + struct k_object *zo; uintptr_t tidx = 0; if (otype <= K_OBJ_ANY || otype >= K_OBJ_LAST) { @@ -475,9 +475,9 @@ void k_object_free(void *obj) } } -struct z_object *z_object_find(const void *obj) +struct k_object *z_object_find(const void *obj) { - struct z_object *ret; + struct k_object *ret; ret = z_object_gperf_find(obj); @@ -514,7 +514,7 @@ void z_object_wordlist_foreach(_wordlist_cb_func_t func, void *context) static unsigned int thread_index_get(struct k_thread *thread) { - struct z_object *ko; + struct k_object *ko; ko = z_object_find(thread); @@ -525,7 +525,7 @@ static unsigned int thread_index_get(struct k_thread *thread) return ko->data.thread_id; } -static void unref_check(struct z_object *ko, uintptr_t index) +static void unref_check(struct k_object *ko, uintptr_t index) { k_spinlock_key_t key = k_spin_lock(&obj_lock); @@ -579,7 +579,7 @@ out: k_spin_unlock(&obj_lock, key); } -static void wordlist_cb(struct z_object *ko, void *ctx_ptr) +static void wordlist_cb(struct k_object *ko, void *ctx_ptr) { struct perm_ctx *ctx = (struct perm_ctx *)ctx_ptr; @@ -602,7 +602,7 @@ void z_thread_perms_inherit(struct k_thread *parent, struct k_thread *child) } } -void z_thread_perms_set(struct z_object *ko, struct k_thread *thread) +void z_thread_perms_set(struct k_object *ko, struct k_thread *thread) { int index = thread_index_get(thread); @@ -611,7 +611,7 @@ void z_thread_perms_set(struct z_object *ko, struct k_thread *thread) } } -void z_thread_perms_clear(struct z_object *ko, struct k_thread *thread) +void z_thread_perms_clear(struct k_object *ko, struct k_thread *thread) { int index = thread_index_get(thread); @@ -621,7 +621,7 @@ void z_thread_perms_clear(struct z_object *ko, struct k_thread *thread) } } -static void clear_perms_cb(struct z_object *ko, void *ctx_ptr) +static void clear_perms_cb(struct k_object *ko, void *ctx_ptr) { uintptr_t id = (uintptr_t)ctx_ptr; @@ -637,7 +637,7 @@ void z_thread_perms_all_clear(struct k_thread *thread) } } -static int thread_perms_test(struct z_object *ko) +static int thread_perms_test(struct k_object *ko) { int index; @@ -652,7 +652,7 @@ static int thread_perms_test(struct z_object *ko) return 0; } -static void dump_permission_error(struct z_object *ko) +static void dump_permission_error(struct k_object *ko) { int index = thread_index_get(_current); LOG_ERR("thread %p (%d) does not have permission on %s %p", @@ -661,7 +661,7 @@ static void dump_permission_error(struct z_object *ko) LOG_HEXDUMP_ERR(ko->perms, sizeof(ko->perms), "permission bitmap"); } -void z_dump_object_error(int retval, const void *obj, struct z_object *ko, +void z_dump_object_error(int retval, const void *obj, struct k_object *ko, enum k_objects otype) { switch (retval) { @@ -691,7 +691,7 @@ void z_dump_object_error(int retval, const void *obj, struct z_object *ko, void z_impl_k_object_access_grant(const void *object, struct k_thread *thread) { - struct z_object *ko = z_object_find(object); + struct k_object *ko = z_object_find(object); if (ko != NULL) { z_thread_perms_set(ko, thread); @@ -700,7 +700,7 @@ void z_impl_k_object_access_grant(const void *object, struct k_thread *thread) void k_object_access_revoke(const void *object, struct k_thread *thread) { - struct z_object *ko = z_object_find(object); + struct k_object *ko = z_object_find(object); if (ko != NULL) { z_thread_perms_clear(ko, thread); @@ -714,14 +714,14 @@ void z_impl_k_object_release(const void *object) void k_object_access_all_grant(const void *object) { - struct z_object *ko = z_object_find(object); + struct k_object *ko = z_object_find(object); if (ko != NULL) { ko->flags |= K_OBJ_FLAG_PUBLIC; } } -int z_object_validate(struct z_object *ko, enum k_objects otype, +int z_object_validate(struct k_object *ko, enum k_objects otype, enum _obj_init_check init) { if (unlikely((ko == NULL) || @@ -756,7 +756,7 @@ int z_object_validate(struct z_object *ko, enum k_objects otype, void k_object_init(const void *obj) { - struct z_object *ko; + struct k_object *ko; /* By the time we get here, if the caller was from userspace, all the * necessary checks have been done in z_object_validate(), which takes @@ -781,7 +781,7 @@ void k_object_init(const void *obj) void z_object_recycle(const void *obj) { - struct z_object *ko = z_object_find(obj); + struct k_object *ko = z_object_find(obj); if (ko != NULL) { (void)memset(ko->perms, 0, sizeof(ko->perms)); @@ -792,7 +792,7 @@ void z_object_recycle(const void *obj) void z_object_uninit(const void *obj) { - struct z_object *ko; + struct k_object *ko; /* See comments in k_object_init() */ ko = z_object_find(obj); diff --git a/kernel/userspace_handler.c b/kernel/userspace_handler.c index 5453bbcede4..ec59ca54c53 100644 --- a/kernel/userspace_handler.c +++ b/kernel/userspace_handler.c @@ -9,11 +9,11 @@ #include #include -static struct z_object *validate_kernel_object(const void *obj, +static struct k_object *validate_kernel_object(const void *obj, enum k_objects otype, enum _obj_init_check init) { - struct z_object *ko; + struct k_object *ko; int ret; ko = z_object_find(obj); @@ -56,7 +56,7 @@ bool k_object_is_valid(const void *obj, enum k_objects otype) static inline void z_vrfy_k_object_access_grant(const void *object, struct k_thread *thread) { - struct z_object *ko; + struct k_object *ko; Z_OOPS(Z_SYSCALL_OBJ_INIT(thread, K_OBJ_THREAD)); ko = validate_any_object(object); @@ -68,7 +68,7 @@ static inline void z_vrfy_k_object_access_grant(const void *object, static inline void z_vrfy_k_object_release(const void *object) { - struct z_object *ko; + struct k_object *ko; ko = validate_any_object((void *)object); Z_OOPS(Z_SYSCALL_VERIFY_MSG(ko != NULL, "object %p access denied", diff --git a/lib/os/mutex.c b/lib/os/mutex.c index 3cd84612a22..b2284f076d9 100644 --- a/lib/os/mutex.c +++ b/lib/os/mutex.c @@ -11,7 +11,7 @@ static struct k_mutex *get_k_mutex(struct sys_mutex *mutex) { - struct z_object *obj; + struct k_object *obj; obj = z_object_find(mutex); if (obj == NULL || obj->type != K_OBJ_SYS_MUTEX) { diff --git a/scripts/build/gen_kobject_list.py b/scripts/build/gen_kobject_list.py index 420d96485d4..db274c19b3a 100755 --- a/scripts/build/gen_kobject_list.py +++ b/scripts/build/gen_kobject_list.py @@ -727,7 +727,7 @@ header = """%compare-lengths #include #include %} -struct z_object; +struct k_object; """ # Different versions of gperf have different prototypes for the lookup @@ -735,7 +735,7 @@ struct z_object; # turned into a string, we told gperf to expect binary strings that are not # NULL-terminated. footer = """%% -struct z_object *z_object_gperf_find(const void *obj) +struct k_object *z_object_gperf_find(const void *obj) { return z_object_lookup((const char *)obj, sizeof(void *)); } @@ -752,7 +752,7 @@ void z_object_gperf_wordlist_foreach(_wordlist_cb_func_t func, void *context) } #ifndef CONFIG_DYNAMIC_OBJECTS -struct z_object *z_object_find(const void *obj) +struct k_object *z_object_find(const void *obj) ALIAS_OF(z_object_gperf_find); void z_object_wordlist_foreach(_wordlist_cb_func_t func, void *context) diff --git a/scripts/pylib/twister/twisterlib/size_calc.py b/scripts/pylib/twister/twisterlib/size_calc.py index 8a98c447eba..f449d26ac99 100644 --- a/scripts/pylib/twister/twisterlib/size_calc.py +++ b/scripts/pylib/twister/twisterlib/size_calc.py @@ -78,7 +78,7 @@ class SizeCalculator: "ctors", "init_array", "reset", - "z_object_assignment_area", + "k_object_assignment_area", "rodata", "net_l2", "vector", diff --git a/subsys/net/lib/sockets/socketpair.c b/subsys/net/lib/sockets/socketpair.c index 0ec4c4c1474..fad4f7aa71f 100644 --- a/subsys/net/lib/sockets/socketpair.c +++ b/subsys/net/lib/sockets/socketpair.c @@ -228,7 +228,7 @@ static struct spair *spair_new(void) } #elif CONFIG_USERSPACE - struct z_object *zo = k_object_create_dynamic(sizeof(*spair)); + struct k_object *zo = k_object_create_dynamic(sizeof(*spair)); if (zo == NULL) { spair = NULL; diff --git a/tests/kernel/mem_protect/mem_protect/src/kobject.c b/tests/kernel/mem_protect/mem_protect/src/kobject.c index d0ec8c1fb30..76ed3f5a5b7 100644 --- a/tests/kernel/mem_protect/mem_protect/src/kobject.c +++ b/tests/kernel/mem_protect/mem_protect/src/kobject.c @@ -1054,7 +1054,7 @@ ZTEST(mem_protect_kobj, test_mark_thread_exit_uninitialized) set_fault_valid(false); int ret; - struct z_object *ko; + struct k_object *ko; k_thread_access_grant(&child_thread, &child_stack); diff --git a/tests/kernel/mem_protect/userspace/src/main.c b/tests/kernel/mem_protect/userspace/src/main.c index 2e63638a4d6..7c0289ab16b 100644 --- a/tests/kernel/mem_protect/userspace/src/main.c +++ b/tests/kernel/mem_protect/userspace/src/main.c @@ -867,7 +867,7 @@ static struct k_sem recycle_sem; */ ZTEST(userspace, test_object_recycle) { - struct z_object *ko; + struct k_object *ko; int perms_count = 0; int dummy = 0; diff --git a/tests/kernel/threads/thread_stack/src/main.c b/tests/kernel/threads/thread_stack/src/main.c index b84b3b3dd44..9a3a01a1cf0 100644 --- a/tests/kernel/threads/thread_stack/src/main.c +++ b/tests/kernel/threads/thread_stack/src/main.c @@ -333,7 +333,7 @@ void scenario_entry(void *stack_obj, size_t obj_size, size_t reported_size, size_t metadata_size; #ifdef CONFIG_USERSPACE - struct z_object *zo; + struct k_object *zo; zo = z_object_find(stack_obj); if (zo != NULL) {