6#ifndef ZEPHYR_INCLUDE_SYS_KOBJECT_H
7#define ZEPHYR_INCLUDE_SYS_KOBJECT_H
39#include <zephyr/kobj-types-enum.h>
51#ifdef CONFIG_USERSPACE
65#define K_THREAD_ACCESS_GRANT(name_, ...) \
66 static void * const _CONCAT(_object_list_, name_)[] = \
67 { __VA_ARGS__, NULL }; \
68 static const STRUCT_SECTION_ITERABLE(k_object_assignment, \
69 _CONCAT(_object_access_, name_)) = \
70 { (&_k_thread_obj_ ## name_), \
71 (_CONCAT(_object_list_, name_)) }
74#define K_OBJ_FLAG_INITIALIZED BIT(0)
76#define K_OBJ_FLAG_PUBLIC BIT(1)
78#define K_OBJ_FLAG_ALLOC BIT(2)
80#define K_OBJ_FLAG_DRIVER BIT(3)
152#define K_THREAD_ACCESS_GRANT(thread, ...)
157static inline void z_impl_k_object_access_grant(
const void *
object,
177static inline void z_impl_k_object_release(
const void *
object)
198#if defined(CONFIG_DYNAMIC_OBJECTS) || defined(__DOXYGEN__)
256static inline void *z_impl_k_object_alloc(
enum k_objects otype)
263static inline void *z_impl_k_object_alloc_size(
enum k_objects otype,
286#include <zephyr/syscalls/kobject.h>
static struct k_thread thread[2]
Definition atomic.c:26
void k_object_release(const void *object)
Release an object.
void * k_object_alloc(enum k_objects otype)
Allocate a kernel object of a designated type.
void k_object_access_grant(const void *object, struct k_thread *thread)
Grant a thread access to a kernel object.
void k_object_free(void *obj)
Free a kernel object previously allocated with k_object_alloc()
bool k_object_is_valid(const void *obj, enum k_objects otype)
Check if a kernel object is of certain type and is valid.
void k_object_access_revoke(const void *object, struct k_thread *thread)
Revoke a thread's access to a kernel object.
void * k_object_alloc_size(enum k_objects otype, size_t size)
Allocate a kernel object of a designated type and a given size.
void k_object_access_all_grant(const void *object)
Grant all present and future threads access to an object.
k_objects
Kernel Object Types.
Definition kobject.h:30
@ K_OBJ_ANY
Definition kobject.h:31
@ K_OBJ_LAST
Definition kobject.h:43
Mutex Structure.
Definition kernel.h:2917
Thread Structure.
Definition thread.h:259