Lines Matching refs:dyn
324 struct dyn_obj *dyn; in dynamic_object_create() local
326 dyn = z_thread_aligned_alloc(align, sizeof(struct dyn_obj)); in dynamic_object_create()
327 if (dyn == NULL) { in dynamic_object_create()
335 k_free(dyn); in dynamic_object_create()
340 dyn->data = z_thread_aligned_alloc(DYN_OBJ_DATA_ALIGN_K_THREAD_STACK, in dynamic_object_create()
342 if (dyn->data == NULL) { in dynamic_object_create()
343 k_free(dyn); in dynamic_object_create()
349 ((uint8_t *)dyn->data + adjusted_size - sizeof(*stack_data)); in dynamic_object_create()
350 stack_data->priv = (uint8_t *)dyn->data; in dynamic_object_create()
352 dyn->kobj.data.stack_data = stack_data; in dynamic_object_create()
354 dyn->kobj.name = (void *)ROUND_UP( in dynamic_object_create()
355 ((uint8_t *)dyn->data + CONFIG_PRIVILEGED_STACK_SIZE), in dynamic_object_create()
358 dyn->kobj.name = dyn->data; in dynamic_object_create()
361 dyn->kobj.name = dyn->data; in dynamic_object_create()
362 dyn->kobj.data.stack_size = adjusted_size; in dynamic_object_create()
365 dyn->data = z_thread_aligned_alloc(align, obj_size_get(otype) + size); in dynamic_object_create()
366 if (dyn->data == NULL) { in dynamic_object_create()
367 k_free(dyn->data); in dynamic_object_create()
370 dyn->kobj.name = dyn->data; in dynamic_object_create()
373 dyn->kobj.type = otype; in dynamic_object_create()
374 dyn->kobj.flags = 0; in dynamic_object_create()
375 (void)memset(dyn->kobj.perms, 0, CONFIG_MAX_THREAD_BYTES); in dynamic_object_create()
379 sys_dlist_append(&obj_list, &dyn->dobj_list); in dynamic_object_create()
382 return &dyn->kobj; in dynamic_object_create()
462 struct dyn_obj *dyn; in k_object_free() local
471 dyn = dyn_object_find(obj); in k_object_free()
472 if (dyn != NULL) { in k_object_free()
473 sys_dlist_remove(&dyn->dobj_list); in k_object_free()
475 if (dyn->kobj.type == K_OBJ_THREAD) { in k_object_free()
476 thread_idx_free(dyn->kobj.data.thread_id); in k_object_free()
481 if (dyn != NULL) { in k_object_free()
482 k_free(dyn->data); in k_object_free()
483 k_free(dyn); in k_object_free()
494 struct dyn_obj *dyn; in k_object_find() local
500 dyn = dyn_object_find(obj); in k_object_find()
501 if (dyn != NULL) { in k_object_find()
502 ret = &dyn->kobj; in k_object_find()
551 struct dyn_obj *dyn = CONTAINER_OF(vko, struct dyn_obj, kobj); in unref_check() local
553 __ASSERT(IS_PTR_ALIGNED(dyn, struct dyn_obj), "unaligned z_object"); in unref_check()
583 sys_dlist_remove(&dyn->dobj_list); in unref_check()
584 k_free(dyn->data); in unref_check()
585 k_free(dyn); in unref_check()