27#define XWOS_OBJTIK_CHUNK ((xwsq_t)1 << 20U)
28#define XWOS_OBJTIK_CHUNK_MSK (XWOS_OBJTIK_CHUNK - 1U)
51 for (i = 0; i < CPUCFG_CPU_NUM; i++) {
static void xwos_cpuirq_save_lc(xwreg_t *cpuirq)
XWOS API:保存然后关闭本地CPU的中断开关
static void xwos_cpuirq_restore_lc(xwreg_t cpuirq)
XWOS API:恢复本地CPU的中断开关
#define __xwcc_alignl1cache
#define ENILOBJD
Nil object descriptor
#define EACCES
Permission denied
#define EOBJACTIVE
Object active
#define EOBJDEAD
Object dead
__xwcc_atomic xwsq_t atomic_xwsq_t
#define xwaop_tst_then_op(type, a, tf, tfarg, of, ofarg, nv, ov)
对原子变量进行原子操作:读取-测试-修改-回写
#define xwaop_store(type, a, memorder, v)
对原子变量进行原子操作:存储
#define xwaop_tge_then_add(type, a, t, v, nv, ov)
对原子变量进行原子操作:读取-测试“大于等于”-相加-回写
#define xwaop_tgt_then_sub(type, a, t, v, nv, ov)
对原子变量进行原子操作:读取-测试“大于”-相减-回写
#define xwaop_load(type, a, memorder)
对原子变量进行原子操作:加载
#define xwaop_tlt_then_add(type, a, t, v, nv, ov)
对原子变量进行原子操作:读取-测试“小于”-相加-回写
#define xwaop_teq_then_add(type, a, t, v, nv, ov)
对原子变量进行原子操作:读取-测试“相等”-相加-回写
#define xwaop_add(type, a, v, nv, ov)
对原子变量进行原子操作:读取-相加-回写
void xwos_object_setgc(struct xwos_object *obj, xwobj_gc_f gcfunc)
设置XWOS对象的垃圾回收函数
xwer_t xwos_object_rawput(struct xwos_object *obj)
减少对象的引用计数,不触发垃圾回收函数
xwer_t(* xwobj_gc_f)(struct xwos_object *)
垃圾回收函数指针类型
xwer_t xwos_object_grab(struct xwos_object *obj)
增加对象的引用计数
xwer_t xwos_object_activate(struct xwos_object *obj, xwobj_gc_f gcfunc)
激活一个XWOS对象(将其引用计数初始化位1)
void xwos_object_construct(struct xwos_object *obj)
XWOS对象的构造函数
xwsq_t xwos_object_get_refcnt(struct xwos_object *obj)
获取XWOS对象的引用计数
void xwos_object_destruct(struct xwos_object *obj)
XWOS对象的析构函数
xwer_t xwos_object_release(struct xwos_object *obj, xwsq_t tik)
检查对象的标签并减少引用计数
void xwos_objtik_init(void)
初始化对象标签分配器
xwer_t xwos_object_acquire(struct xwos_object *obj, xwsq_t tik)
检查对象的标签并增加引用计数
xwer_t xwos_object_put(struct xwos_object *obj)
减少对象的引用计数
static xwid_t xwos_skd_get_cpuid_lc(void)
XWOS API:获取当前CPU的ID
#define XWOS_OBJTIK_CHUNK_MSK
static xwsq_t xwos_objtik_get(void)
从对象标签分配器获取一个标签
#define XWOS_OBJTIK_CHUNK
static xwer_t xwos_object_acquire_refaop_tst(const void *ov, void *arg)
static atomic_xwsq_t xwos_objtik[(1U)]
每CPU的对象标签分配器
static void xwos_object_release_refaop_op(void *nv, const void *ov, void *arg)
static xwer_t xwos_object_release_refaop_tst(const void *ov, void *arg)
static void xwos_object_acquire_refaop_op(void *nv, const void *ov, void *arg)
static atomic_xwsq_t xwos_objtik_dispatcher
对象标签分配器,每次分配 XWOS_OBJTIK_CHUNK 个ID给CPU