Lines Matching +full:key +full:- +full:int

4  * SPDX-License-Identifier: Apache-2.0
17 sys_slist_init(&type->list); in z_obj_type_init()
18 sys_slist_append(&z_obj_type_list, &type->node); in z_obj_type_init()
19 type->id = id; in z_obj_type_init()
20 type->obj_core_offset = off; in z_obj_type_init()
27 obj_core->node.next = NULL; in k_obj_core_init()
28 obj_core->type = type; in k_obj_core_init()
30 obj_core->stats = NULL; in k_obj_core_init()
36 k_spinlock_key_t key = k_spin_lock(&lock); in k_obj_core_link() local
38 sys_slist_append(&obj_core->type->list, &obj_core->node); in k_obj_core_link()
40 k_spin_unlock(&lock, key); in k_obj_core_link()
52 k_spinlock_key_t key = k_spin_lock(&lock); in k_obj_core_unlink() local
54 sys_slist_find_and_remove(&obj_core->type->list, &obj_core->node); in k_obj_core_unlink()
56 k_spin_unlock(&lock, key); in k_obj_core_unlink()
65 k_spinlock_key_t key = k_spin_lock(&lock); in k_obj_type_find() local
69 if (type->id == type_id) { in k_obj_type_find()
75 k_spin_unlock(&lock, key); in k_obj_type_find()
80 int k_obj_type_walk_locked(struct k_obj_type *type, in k_obj_type_walk_locked()
81 int (*func)(struct k_obj_core *, void *), in k_obj_type_walk_locked()
84 k_spinlock_key_t key; in k_obj_type_walk_locked() local
87 int status = 0; in k_obj_type_walk_locked()
89 key = k_spin_lock(&lock); in k_obj_type_walk_locked()
91 SYS_SLIST_FOR_EACH_NODE(&type->list, node) { in k_obj_type_walk_locked()
99 k_spin_unlock(&lock, key); in k_obj_type_walk_locked()
104 int k_obj_type_walk_unlocked(struct k_obj_type *type, in k_obj_type_walk_unlocked()
105 int (*func)(struct k_obj_core *, void *), in k_obj_type_walk_unlocked()
111 int status = 0; in k_obj_type_walk_unlocked()
113 SYS_SLIST_FOR_EACH_NODE_SAFE(&type->list, node, next) { in k_obj_type_walk_unlocked()
125 int k_obj_core_stats_register(struct k_obj_core *obj_core, void *stats, in k_obj_core_stats_register()
128 int rv; in k_obj_core_stats_register()
129 k_spinlock_key_t key = k_spin_lock(&lock); in k_obj_core_stats_register() local
131 if (obj_core->type->stats_desc == NULL) { in k_obj_core_stats_register()
133 rv = -ENOTSUP; in k_obj_core_stats_register()
134 } else if (obj_core->type->stats_desc->raw_size != stats_len) { in k_obj_core_stats_register()
136 rv = -EINVAL; in k_obj_core_stats_register()
138 obj_core->stats = stats; in k_obj_core_stats_register()
142 k_spin_unlock(&lock, key); in k_obj_core_stats_register()
147 int k_obj_core_stats_deregister(struct k_obj_core *obj_core) in k_obj_core_stats_deregister()
149 int rv; in k_obj_core_stats_deregister()
150 k_spinlock_key_t key = k_spin_lock(&lock); in k_obj_core_stats_deregister() local
152 if (obj_core->type->stats_desc == NULL) { in k_obj_core_stats_deregister()
154 rv = -ENOTSUP; in k_obj_core_stats_deregister()
156 obj_core->stats = NULL; in k_obj_core_stats_deregister()
160 k_spin_unlock(&lock, key); in k_obj_core_stats_deregister()
165 int k_obj_core_stats_raw(struct k_obj_core *obj_core, void *stats, in k_obj_core_stats_raw()
168 int rv; in k_obj_core_stats_raw()
171 k_spinlock_key_t key = k_spin_lock(&lock); in k_obj_core_stats_raw() local
173 desc = obj_core->type->stats_desc; in k_obj_core_stats_raw()
174 if ((desc == NULL) || (desc->raw == NULL)) { in k_obj_core_stats_raw()
176 rv = -ENOTSUP; in k_obj_core_stats_raw()
177 } else if ((desc->raw_size != stats_len) || (obj_core->stats == NULL)) { in k_obj_core_stats_raw()
182 rv = -EINVAL; in k_obj_core_stats_raw()
184 rv = desc->raw(obj_core, stats); in k_obj_core_stats_raw()
187 k_spin_unlock(&lock, key); in k_obj_core_stats_raw()
192 int k_obj_core_stats_query(struct k_obj_core *obj_core, void *stats, in k_obj_core_stats_query()
195 int rv; in k_obj_core_stats_query()
198 k_spinlock_key_t key = k_spin_lock(&lock); in k_obj_core_stats_query() local
200 desc = obj_core->type->stats_desc; in k_obj_core_stats_query()
201 if ((desc == NULL) || (desc->query == NULL)) { in k_obj_core_stats_query()
203 rv = -ENOTSUP; in k_obj_core_stats_query()
204 } else if ((desc->query_size != stats_len) || (obj_core->stats == NULL)) { in k_obj_core_stats_query()
209 rv = -EINVAL; in k_obj_core_stats_query()
211 rv = desc->query(obj_core, stats); in k_obj_core_stats_query()
214 k_spin_unlock(&lock, key); in k_obj_core_stats_query()
219 int k_obj_core_stats_reset(struct k_obj_core *obj_core) in k_obj_core_stats_reset()
221 int rv; in k_obj_core_stats_reset()
224 k_spinlock_key_t key = k_spin_lock(&lock); in k_obj_core_stats_reset() local
226 desc = obj_core->type->stats_desc; in k_obj_core_stats_reset()
227 if ((desc == NULL) || (desc->reset == NULL)) { in k_obj_core_stats_reset()
229 rv = -ENOTSUP; in k_obj_core_stats_reset()
230 } else if (obj_core->stats == NULL) { in k_obj_core_stats_reset()
232 rv = -EINVAL; in k_obj_core_stats_reset()
234 rv = desc->reset(obj_core); in k_obj_core_stats_reset()
237 k_spin_unlock(&lock, key); in k_obj_core_stats_reset()
242 int k_obj_core_stats_disable(struct k_obj_core *obj_core) in k_obj_core_stats_disable()
244 int rv; in k_obj_core_stats_disable()
247 k_spinlock_key_t key = k_spin_lock(&lock); in k_obj_core_stats_disable() local
249 desc = obj_core->type->stats_desc; in k_obj_core_stats_disable()
250 if ((desc == NULL) || (desc->disable == NULL)) { in k_obj_core_stats_disable()
252 rv = -ENOTSUP; in k_obj_core_stats_disable()
253 } else if (obj_core->stats == NULL) { in k_obj_core_stats_disable()
255 rv = -EINVAL; in k_obj_core_stats_disable()
257 rv = desc->disable(obj_core); in k_obj_core_stats_disable()
260 k_spin_unlock(&lock, key); in k_obj_core_stats_disable()
265 int k_obj_core_stats_enable(struct k_obj_core *obj_core) in k_obj_core_stats_enable()
267 int rv; in k_obj_core_stats_enable()
270 k_spinlock_key_t key = k_spin_lock(&lock); in k_obj_core_stats_enable() local
272 desc = obj_core->type->stats_desc; in k_obj_core_stats_enable()
273 if ((desc == NULL) || (desc->enable == NULL)) { in k_obj_core_stats_enable()
275 rv = -ENOTSUP; in k_obj_core_stats_enable()
276 } else if (obj_core->stats == NULL) { in k_obj_core_stats_enable()
278 rv = -EINVAL; in k_obj_core_stats_enable()
280 rv = desc->enable(obj_core); in k_obj_core_stats_enable()
283 k_spin_unlock(&lock, key); in k_obj_core_stats_enable()