kernel: object: rename z_object_init to k_object_init
Do not use z_ for internal API and rename to k_object_init. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
c54fb959e3
commit
c91cad735a
18 changed files with 23 additions and 23 deletions
|
@ -210,7 +210,7 @@ Some objects will be implicitly initialized at boot:
|
|||
is run by the kernel early in the boot process.
|
||||
|
||||
If a kernel object is initialized with a private static initializer, the object
|
||||
must have :c:func:`z_object_init` called on it at some point by a supervisor
|
||||
must have :c:func:`k_object_init` called on it at some point by a supervisor
|
||||
thread, otherwise the kernel will consider the object uninitialized if accessed
|
||||
by a user thread. This is very uncommon, typically only for kernel objects that
|
||||
are embedded within some larger struct and initialized statically.
|
||||
|
@ -228,7 +228,7 @@ are embedded within some larger struct and initialized statically.
|
|||
};
|
||||
|
||||
...
|
||||
z_object_init(&my_foo.sem);
|
||||
k_object_init(&my_foo.sem);
|
||||
...
|
||||
|
||||
|
||||
|
|
|
@ -74,11 +74,11 @@ struct z_object_assignment {
|
|||
*
|
||||
* @param obj Address of the kernel object
|
||||
*/
|
||||
void z_object_init(const void *obj);
|
||||
void k_object_init(const void *obj);
|
||||
|
||||
|
||||
#else
|
||||
static inline void z_object_init(const void *obj)
|
||||
static inline void k_object_init(const void *obj)
|
||||
{
|
||||
ARG_UNUSED(obj);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ static struct k_spinlock lock;
|
|||
int z_impl_k_condvar_init(struct k_condvar *condvar)
|
||||
{
|
||||
z_waitq_init(&condvar->wait_q);
|
||||
z_object_init(condvar);
|
||||
k_object_init(condvar);
|
||||
|
||||
#ifdef CONFIG_OBJ_CORE_CONDVAR
|
||||
k_obj_core_init_and_link(K_OBJ_CORE(condvar), &obj_type_condvar);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
void z_device_state_init(void)
|
||||
{
|
||||
STRUCT_SECTION_FOREACH(device, dev) {
|
||||
z_object_init(dev);
|
||||
k_object_init(dev);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ void z_impl_k_event_init(struct k_event *event)
|
|||
|
||||
z_waitq_init(&event->wait_q);
|
||||
|
||||
z_object_init(event);
|
||||
k_object_init(event);
|
||||
|
||||
#ifdef CONFIG_OBJ_CORE_EVENT
|
||||
k_obj_core_init_and_link(K_OBJ_CORE(event), &obj_type_event);
|
||||
|
|
|
@ -151,7 +151,7 @@ static int init_mem_slab_obj_core_list(void)
|
|||
if (rc < 0) {
|
||||
goto out;
|
||||
}
|
||||
z_object_init(slab);
|
||||
k_object_init(slab);
|
||||
|
||||
#ifdef CONFIG_OBJ_CORE_MEM_SLAB
|
||||
k_obj_core_init_and_link(K_OBJ_CORE(slab), &obj_type_mem_slab);
|
||||
|
@ -198,7 +198,7 @@ int k_mem_slab_init(struct k_mem_slab *slab, void *buffer,
|
|||
#endif
|
||||
|
||||
z_waitq_init(&slab->wait_q);
|
||||
z_object_init(slab);
|
||||
k_object_init(slab);
|
||||
out:
|
||||
SYS_PORT_TRACING_OBJ_INIT(k_mem_slab, slab, rc);
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ void k_msgq_init(struct k_msgq *msgq, char *buffer, size_t msg_size,
|
|||
|
||||
SYS_PORT_TRACING_OBJ_INIT(k_msgq, msgq);
|
||||
|
||||
z_object_init(msgq);
|
||||
k_object_init(msgq);
|
||||
}
|
||||
|
||||
int z_impl_k_msgq_alloc_init(struct k_msgq *msgq, size_t msg_size,
|
||||
|
|
|
@ -57,7 +57,7 @@ int z_impl_k_mutex_init(struct k_mutex *mutex)
|
|||
|
||||
z_waitq_init(&mutex->wait_q);
|
||||
|
||||
z_object_init(mutex);
|
||||
k_object_init(mutex);
|
||||
|
||||
#ifdef CONFIG_OBJ_CORE_MUTEX
|
||||
k_obj_core_init_and_link(K_OBJ_CORE(mutex), &obj_type_mutex);
|
||||
|
|
|
@ -53,7 +53,7 @@ void k_pipe_init(struct k_pipe *pipe, unsigned char *buffer, size_t size)
|
|||
#if defined(CONFIG_POLL)
|
||||
sys_dlist_init(&pipe->poll_events);
|
||||
#endif
|
||||
z_object_init(pipe);
|
||||
k_object_init(pipe);
|
||||
|
||||
#ifdef CONFIG_OBJ_CORE_PIPE
|
||||
k_obj_core_init_and_link(K_OBJ_CORE(pipe), &obj_type_pipe);
|
||||
|
|
|
@ -482,7 +482,7 @@ void z_impl_k_poll_signal_init(struct k_poll_signal *sig)
|
|||
sys_dlist_init(&sig->poll_events);
|
||||
sig->signaled = 0U;
|
||||
/* signal->result is left uninitialized */
|
||||
z_object_init(sig);
|
||||
k_object_init(sig);
|
||||
|
||||
SYS_PORT_TRACING_FUNC(k_poll_api, signal_init, sig);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ void z_impl_k_queue_init(struct k_queue *queue)
|
|||
|
||||
SYS_PORT_TRACING_OBJ_INIT(k_queue, queue);
|
||||
|
||||
z_object_init(queue);
|
||||
k_object_init(queue);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
|
|
|
@ -63,7 +63,7 @@ int z_impl_k_sem_init(struct k_sem *sem, unsigned int initial_count,
|
|||
#if defined(CONFIG_POLL)
|
||||
sys_dlist_init(&sem->poll_events);
|
||||
#endif
|
||||
z_object_init(sem);
|
||||
k_object_init(sem);
|
||||
|
||||
#ifdef CONFIG_OBJ_CORE_SEM
|
||||
k_obj_core_init_and_link(K_OBJ_CORE(sem), &obj_type_sem);
|
||||
|
|
|
@ -32,7 +32,7 @@ void k_stack_init(struct k_stack *stack, stack_data_t *buffer,
|
|||
stack->top = stack->base + num_entries;
|
||||
|
||||
SYS_PORT_TRACING_OBJ_INIT(k_stack, stack);
|
||||
z_object_init(stack);
|
||||
k_object_init(stack);
|
||||
|
||||
#ifdef CONFIG_OBJ_CORE_STACK
|
||||
k_obj_core_init_and_link(K_OBJ_CORE(stack), &obj_type_stack);
|
||||
|
|
|
@ -591,8 +591,8 @@ char *z_setup_new_thread(struct k_thread *new_thread,
|
|||
__ASSERT((options & K_USER) == 0U || z_stack_is_user_capable(stack),
|
||||
"user thread %p with kernel-only stack %p",
|
||||
new_thread, stack);
|
||||
z_object_init(new_thread);
|
||||
z_object_init(stack);
|
||||
k_object_init(new_thread);
|
||||
k_object_init(stack);
|
||||
new_thread->stack_obj = stack;
|
||||
new_thread->syscall_frame = NULL;
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ void k_timer_init(struct k_timer *timer,
|
|||
|
||||
timer->user_data = NULL;
|
||||
|
||||
z_object_init(timer);
|
||||
k_object_init(timer);
|
||||
|
||||
#ifdef CONFIG_OBJ_CORE_TIMER
|
||||
k_obj_core_init_and_link(K_OBJ_CORE(timer), &obj_type_timer);
|
||||
|
|
|
@ -754,7 +754,7 @@ int z_object_validate(struct z_object *ko, enum k_objects otype,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void z_object_init(const void *obj)
|
||||
void k_object_init(const void *obj)
|
||||
{
|
||||
struct z_object *ko;
|
||||
|
||||
|
@ -794,7 +794,7 @@ void z_object_uninit(const void *obj)
|
|||
{
|
||||
struct z_object *ko;
|
||||
|
||||
/* See comments in z_object_init() */
|
||||
/* See comments in k_object_init() */
|
||||
ko = z_object_find(obj);
|
||||
if (ko == NULL) {
|
||||
return;
|
||||
|
|
|
@ -422,7 +422,7 @@ static inline void init_iface(struct net_if *iface)
|
|||
NET_DBG("On iface %p", iface);
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
z_object_init(iface);
|
||||
k_object_init(iface);
|
||||
#endif
|
||||
|
||||
k_mutex_init(&iface->lock);
|
||||
|
|
|
@ -42,7 +42,7 @@ ZTEST(mem_protect_kobj, test_kobject_access_grant)
|
|||
{
|
||||
set_fault_valid(false);
|
||||
|
||||
z_object_init(random_sem_type);
|
||||
k_object_init(random_sem_type);
|
||||
k_thread_access_grant(k_current_get(),
|
||||
&kobject_sem,
|
||||
&kobject_mutex,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue