7#ifndef __KERNEL_OBJ_CORE_H__
8#define __KERNEL_OBJ_CORE_H__
21#define K_OBJ_CORE(kobj) (&((kobj)->obj_core))
26#define K_OBJ_TYPE_ID_GEN(s) ((s[0] << 24) | (s[1] << 16) | (s[2] << 8) | (s[3]))
31#define K_OBJ_TYPE_CONDVAR_ID K_OBJ_TYPE_ID_GEN("COND")
33#define K_OBJ_TYPE_CPU_ID K_OBJ_TYPE_ID_GEN("CPU_")
35#define K_OBJ_TYPE_EVENT_ID K_OBJ_TYPE_ID_GEN("EVNT")
37#define K_OBJ_TYPE_FIFO_ID K_OBJ_TYPE_ID_GEN("FIFO")
39#define K_OBJ_TYPE_KERNEL_ID K_OBJ_TYPE_ID_GEN("KRNL")
41#define K_OBJ_TYPE_LIFO_ID K_OBJ_TYPE_ID_GEN("LIFO")
43#define K_OBJ_TYPE_MEM_BLOCK_ID K_OBJ_TYPE_ID_GEN("MBLK")
45#define K_OBJ_TYPE_MBOX_ID K_OBJ_TYPE_ID_GEN("MBOX")
47#define K_OBJ_TYPE_MEM_SLAB_ID K_OBJ_TYPE_ID_GEN("SLAB")
49#define K_OBJ_TYPE_MSGQ_ID K_OBJ_TYPE_ID_GEN("MSGQ")
51#define K_OBJ_TYPE_MUTEX_ID K_OBJ_TYPE_ID_GEN("MUTX")
53#define K_OBJ_TYPE_PIPE_ID K_OBJ_TYPE_ID_GEN("PIPE")
55#define K_OBJ_TYPE_SEM_ID K_OBJ_TYPE_ID_GEN("SEM4")
57#define K_OBJ_TYPE_STACK_ID K_OBJ_TYPE_ID_GEN("STCK")
59#define K_OBJ_TYPE_THREAD_ID K_OBJ_TYPE_ID_GEN("THRD")
61#define K_OBJ_TYPE_TIMER_ID K_OBJ_TYPE_ID_GEN("TIMR")
71#define K_OBJ_CORE_INIT(_objp, _obj_type) \
72 extern struct k_obj_type _obj_type; \
73 k_obj_core_init(_objp, &_obj_type)
75#define K_OBJ_CORE_INIT_UNLINKED(_objp, _obj_type) \
76 extern struct k_obj_type _obj_type; \
77 z_obj_core_init_unlinked(_objp, &_obj_type)
79#define K_OBJ_CORE_LINK(objp) k_obj_core_link(objp)
81#define K_OBJ_CORE_INIT(objp, type) do { } while (0)
82#define K_OBJ_CORE_INIT_UNLINKED(objp, type) do { } while (0)
83#define K_OBJ_CORE_LINK(objp) do { } while (0)
119#ifdef CONFIG_OBJ_CORE_STATS
129#ifdef CONFIG_OBJ_CORE_STATS
249static inline void z_obj_core_init_unlinked(
struct k_obj_core *obj_core,
252 obj_core->
type = type;
253#ifdef CONFIG_OBJ_CORE_STATS
254 obj_core->stats =
NULL;
279#ifdef CONFIG_OBJ_CORE_STATS
288static inline void k_obj_type_stats_init(
struct k_obj_type *type,
291 type->stats_desc = stats_desc;
303static inline void k_obj_core_stats_init(
struct k_obj_core *obj_core,
306 obj_core->stats = stats;
irp nz macro MOVR cc s mov cc s endm endr irp aw macro LDR aa off
Definition asm-macro-32-bit-gnu.h:17
int k_obj_type_walk_locked(struct k_obj_type *type, int(*func)(struct k_obj_core *, void *), void *data)
Walk the object type's list of object cores.
struct k_obj_type * k_obj_type_find(uint32_t type_id)
Find a specific object type by ID.
int k_obj_type_walk_unlocked(struct k_obj_type *type, int(*func)(struct k_obj_core *, void *), void *data)
Walk the object type's list of object cores.
void k_obj_core_link(struct k_obj_core *obj_core)
Link the kernel object to the kernel object type list.
void k_obj_core_unlink(struct k_obj_core *obj_core)
Unlink the kernel object from the kernel object type list.
void k_obj_core_init_and_link(struct k_obj_core *obj_core, struct k_obj_type *type)
Automatically link the kernel object after initializing it.
void k_obj_core_init(struct k_obj_core *obj_core, struct k_obj_type *type)
Initialize the core of the kernel object.
int k_obj_core_stats_enable(struct k_obj_core *obj_core)
Reset the stats associated with the kernel object.
int k_obj_core_stats_reset(struct k_obj_core *obj_core)
Reset the stats associated with the kernel object.
int k_obj_core_stats_query(struct k_obj_core *obj_core, void *stats, size_t stats_len)
Retrieve the statistics associated with the kernel object.
int k_obj_core_stats_disable(struct k_obj_core *obj_core)
Stop gathering the stats associated with the kernel object.
int k_obj_core_stats_raw(struct k_obj_core *obj_core, void *stats, size_t stats_len)
Retrieve the raw statistics associated with the kernel object.
int k_obj_core_stats_deregister(struct k_obj_core *obj_core)
Deregister kernel object from gathering statistics.
int k_obj_core_stats_register(struct k_obj_core *obj_core, void *stats, size_t stats_len)
Register kernel object for gathering statistics.
struct _slist sys_slist_t
Single-linked list structure.
Definition slist.h:49
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
#define NULL
Definition iar_missing_defs.h:20
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Object core statistics descriptor.
Definition obj_core.h:97
int(* raw)(struct k_obj_core *obj_core, void *stats)
Function pointer to retrieve internal representation of stats.
Definition obj_core.h:102
int(* reset)(struct k_obj_core *obj_core)
Function pointer to reset object's statistics.
Definition obj_core.h:106
size_t raw_size
Internal representation stats buffer size.
Definition obj_core.h:98
int(* query)(struct k_obj_core *obj_core, void *stats)
Function pointer to retrieve reported statistics.
Definition obj_core.h:104
size_t query_size
Stats buffer size used for reporting.
Definition obj_core.h:99
int(* enable)(struct k_obj_core *obj_core)
Function pointer to enable object's statistics gathering.
Definition obj_core.h:110
int(* disable)(struct k_obj_core *obj_core)
Function pointer to disable object's statistics gathering.
Definition obj_core.h:108
Object core structure.
Definition obj_core.h:126
sys_snode_t node
Object node within object type's list.
Definition obj_core.h:127
struct k_obj_type * type
Object type to which object belongs.
Definition obj_core.h:128
Object type structure.
Definition obj_core.h:114
size_t obj_core_offset
Offset to obj_core field.
Definition obj_core.h:118
sys_snode_t node
Node within list of object types.
Definition obj_core.h:115
sys_slist_t list
List of objects of this object type.
Definition obj_core.h:116
uint32_t id
Unique type ID.
Definition obj_core.h:117