XWOS API
4.0
XWOS C/C++ API参考手册
|
模块 | |
XWOS的时间类型 | |
结构体 | |
struct | xwos_cblk |
类型为XWOS_LK_CALLBACK时的抽象锁函数 更多... | |
union | xwos_ulock |
所有锁的联合 更多... | |
宏定义 | |
#define | NULL ((void *)0) |
#define | NIL NULL |
#define | BITS_PER_CHAR 8U |
#define | CHAR_SHIFT 3U |
#define | CHAR_MAX ((signed char)(UCHAR_MAX >> (unsigned char)1)) |
#define | CHAR_MIN ((signed char)(-CHAR_MAX - (signed char)1)) |
#define | BITS_PER_UCHAR 8U |
#define | UCHAR_SHIFT 3U |
#define | UCHAR_MAX ((unsigned char)(~((unsigned char)0))) |
#define | UCHAR_MIN ((unsigned char)0) |
#define | BITS_PER_SHRT 16U |
#define | SHRT_SHIFT 4U |
#define | SHRT_MAX ((signed short)(USHRT_MAX >> (unsigned short)1)) |
#define | SHRT_MIN ((signed short)(-SHRT_MAX - (signed short)1)) |
#define | BITS_PER_USHRT 16U |
#define | USHRT_SHIFT 4U |
#define | USHRT_MAX ((unsigned short)(~((unsigned short)0))) |
#define | USHRT_MIN (unsigned short)0) |
#define | BITS_PER_INT 32U |
#define | INT_SHIFT 5U |
#define | INT_MAX ((signed int)(UINT_MAX >> (unsigned int)1)) |
#define | INT_MIN ((signed int)(-INT_MAX - (signed int)1)) |
#define | BITS_PER_UINT 32U |
#define | UINT_SHIFT 5U |
#define | UINT_MAX ((unsigned int)(~((unsigned int)0))) |
#define | UINT_MIN (unsigned int)0) |
#define | BITS_PER_LONG 32U |
#define | LONG_SHIFT 5U |
#define | LONG_MAX ((signed long)(ULONG_MAX >> (unsigned long)1)) |
#define | LONG_MIN ((signed long)(-LONG_MAX - (signed long)1)) |
#define | BITS_PER_ULONG 32U |
#define | ULONG_MAX ((unsigned long)(~((unsigned long)0))) |
#define | ULONG_MIN ((unsigned long)0) |
#define | BITS_PER_LLONG 64U |
#define | LLONG_SHIFT 6U |
#define | LLONG_MAX ((signed long long)(ULLONG_MAX >> (unsigned long long)1)) |
#define | LLONG_MIN ((signed long long)(-LLONG_MAX - (signed long long)1)) |
#define | BITS_PER_ULLONG 64U |
#define | ULLONG_SHIFT 6U |
#define | ULLONG_MAX ((unsigned long long)(~((unsigned long long)0))) |
#define | ULLONG_MIN (unsigned long long)0) |
#define | BITS_PER_FLT 32U |
#define | FLT_SHIFT 5U |
#define | BITS_PER_DBL 64U |
#define | DBL_SHIFT 6U |
#define | BITS_PER_LDBL 128U |
#define | LDBL_SHIFT 7U |
#define | BITS_PER_XWU8_T 8U |
#define | XWU8_T_SHIFT 3U |
#define | XWU8_MAX ((xwu8_t)(~((xwu8_t)0))) |
#define | BITS_PER_XWS8_T 8U |
#define | XWS8_T_SHIFT 3U |
#define | XWS8_MAX ((xws8_t)(XWU8_MAX >> (xwu8_t)1)) |
#define | XWS8_MIN ((xws8_t)(-XWS8_MAX - (xws8_t)1)) |
#define | BITS_PER_XWU16_T 16U |
#define | XWU16_T_SHIFT 4U |
#define | XWU16_MAX ((xwu16_t)(~((xwu16_t)0))) |
#define | BITS_PER_XWS16_T 16U |
#define | XWS16_T_SHIFT 4U |
#define | XWS16_MAX ((xws16_t)(XWU16_MAX >> (xwu16_t)1)) |
#define | XWS16_MIN ((xws16_t)(-XWS16_MAX - (xws16_t)1)) |
#define | BITS_PER_XWU32_T 32U |
#define | XWU32_T_SHIFT 5U |
#define | XWU32_MAX ((xwu32_t)(~((xwu32_t)0))) |
#define | BITS_PER_XWS32_T 32U |
#define | XWS32_T_SHIFT 5U |
#define | XWS32_MAX ((xws32_t)(XWU32_MAX >> (xwu32_t)1)) |
#define | XWS32_MIN ((xws32_t)(-XWS32_MAX - (xws32_t)1)) |
#define | BITS_PER_XWU64_T 64U |
#define | XWU64_T_SHIFT 6U |
#define | XWU64_MAX ((xwu64_t)(~((xwu64_t)0))) |
#define | BITS_PER_XWS64_T 64U |
#define | XWS64_T_SHIFT 6U |
#define | XWS64_MAX ((xws64_t)(XWU64_MAX >> (xwu64_t)1)) |
#define | XWS64_MIN ((xws64_t)(-XWS64_MAX - (xws64_t)1)) |
#define | BITS_PER_XWSZ_T BITS_PER_ULONG |
#define | XWSZ_T_SHIFT ULONG_SHIFT |
#define | XWSZ_MAX ((xwsz_t)(~((xwsz_t)0))) |
#define | BITS_PER_XWSSZ_T BITS_PER_LONG |
#define | XWSSZ_T_SHIFT LONG_SHIFT |
#define | XWSSZ_MAX ((xwssz_t)(XWSZ_MAX >> (xwsz_t)1)) |
#define | XWSSZ_MIN ((xwssz_t)(-XWSSZ_MAX - (xwssz_t)1)) |
#define | BITS_PER_XWPTR_T BITS_PER_ULONG |
#define | XWPTR_T_SHIFT ULONG_SHIFT |
#define | XWPTR_MAX ((xwptr_t)(~(xwptr_t)0)) |
#define | BITS_PER_XWSTK_T BITS_PER_XWPTR_T |
#define | XWSTK_T_SHIFT XWPTR_T_SHIFT |
#define | XWSTK_MAX ((xwstk_t)(~(xwstk_t)0)) |
#define | BITS_PER_XWREG_T BITS_PER_XWPTR_T |
#define | XWREG_T_SHIFT XWPTR_T_SHIFT |
#define | XWREG_MAX ((xwreg_t)(~((xwreg_t)0))) |
#define | BITS_PER_XWSREG_T BITS_PER_XWREG_T |
#define | XWSREG_T_SHIFT XWREG_T_SHIFT |
#define | XWSREG_MAX ((xwsreg_t)(XWREG_MAX >> (xwreg_t)1)) |
#define | XWSREG_MIN ((xwsreg_t)(-XWSREG_MAX - (xwsreg_t)1)) |
#define | BITS_PER_XWSQ_T BITS_PER_ULONG |
#define | XWSQ_T_SHIFT ULONG_SHIFT |
#define | XWSQ_MAX ((xwsq_t)(~((xwsq_t)0))) |
#define | BITS_PER_XWSSQ_T BITS_PER_LONG |
#define | XWSSQ_T_SHIFT LONG_SHIFT |
#define | XWSSQ_MAX ((xwssq_t)(XWSQ_MAX >> (xwsq_t)1)) |
#define | XWSSQ_MIN ((xwssq_t)(-XWSSQ_MAX - (xwssq_t)1)) |
#define | BITS_PER_XWID_T BITS_PER_ULONG |
#define | XWID_T_SHIFT ULONG_SHIFT |
#define | XWID_MAX ((xwid_t)(~((xwid_t)0))) |
#define | BITS_PER_XWSID_T BITS_PER_LONG |
#define | XWSID_T_SHIFT LONG_SHIFT |
#define | XWSID_MAX ((xwsid_t)(XWID_MAX >> (xwid_t)1)) |
#define | XWSID_MIN ((xwsid_t)(-XWSID_MAX - (xwsid_t)1)) |
#define | BITS_PER_XWIRQ_T BITS_PER_INT |
#define | XWIRQ_T_SHIFT INT_SHIFT |
#define | XWIRQ_MAX ((xwirq_t)((~(unsigned int)0) >> (unsigned int)1)) |
#define | XWIRQ_MIN ((xwirq_t)(-XWIRQ_MAX - (xwirq_t)1)) |
#define | BITS_PER_XWPR_T BITS_PER_XWS32_T |
#define | XWPR_T_SHIFT XWS32_T_SHIFT |
#define | XWPR_MAX ((xwpr_t)((~(xwu32_t)0) >> (xwu32_t)1)) |
#define | XWPR_MIN ((xwpr_t)(-XWPR_MAX - (xwpr_t)1)) |
#define | BITS_PER_XWER_T BITS_PER_LONG |
#define | XWER_T_SHIFT LONG_SHIFT |
#define | XWER_MAX ((xwer_t)OK) |
#define | XWER_MIN ((xwer_t)(-MAX_ERRNO)) |
#define | BITS_PER_XWBMP_T BITS_PER_XWU32_T |
#define | XWBMP_T_SHIFT XWU32_T_SHIFT |
#define | XWBMP_MAX ((xwbmp_t)(~((xwbmp_t)0))) |
#define | BITS_PER_XWLFQ_T BITS_PER_XWPTR_T |
#define | XWLFQ_T_SHIFT XWPTR_T_SHIFT |
枚举 | |
enum | xwaop_memory_order_em { xwaop_mo_relaxed = 0 , xwaop_mo_consume , xwaop_mo_acquire , xwaop_mo_release , xwaop_mo_acq_rel , xwaop_mo_seq_cst } |
原子操作内存模型 更多... | |
enum | xwos_lock_type_em { XWOS_LK_NONE = 0U , XWOS_LK_MTX = 1U , XWOS_LK_SPLK = 2U , XWOS_LK_SQLK_WR = 3U , XWOS_LK_SQLK_RDEX = 4U , XWOS_LK_CALLBACK = 5U , XWOS_LK_NUM } |
XWOS的锁类型枚举 更多... | |
enum | xwos_lkst_em { XWOS_LKST_UNLOCKED = 0U , XWOS_LKST_LOCKED = 1U } |
XWOS锁状态 更多... | |
#define BITS_PER_XWBMP_T BITS_PER_XWU32_T |
#define BITS_PER_XWER_T BITS_PER_LONG |
#define BITS_PER_XWID_T BITS_PER_ULONG |
#define BITS_PER_XWIRQ_T BITS_PER_INT |
#define BITS_PER_XWLFQ_T BITS_PER_XWPTR_T |
#define BITS_PER_XWPR_T BITS_PER_XWS32_T |
#define BITS_PER_XWPTR_T BITS_PER_ULONG |
#define BITS_PER_XWREG_T BITS_PER_XWPTR_T |
#define BITS_PER_XWSID_T BITS_PER_LONG |
#define BITS_PER_XWSQ_T BITS_PER_ULONG |
#define BITS_PER_XWSREG_T BITS_PER_XWREG_T |
#define BITS_PER_XWSSQ_T BITS_PER_LONG |
#define BITS_PER_XWSSZ_T BITS_PER_LONG |
#define BITS_PER_XWSTK_T BITS_PER_XWPTR_T |
#define BITS_PER_XWSZ_T BITS_PER_ULONG |
#define LLONG_MAX ((signed long long)(ULLONG_MAX >> (unsigned long long)1)) |
#define XWBMP_T_SHIFT XWU32_T_SHIFT |
#define XWER_T_SHIFT LONG_SHIFT |
#define XWLFQ_T_SHIFT XWPTR_T_SHIFT |
#define XWPR_T_SHIFT XWS32_T_SHIFT |
#define XWREG_T_SHIFT XWPTR_T_SHIFT |
#define XWSID_T_SHIFT LONG_SHIFT |
#define XWSREG_MIN ((xwsreg_t)(-XWSREG_MAX - (xwsreg_t)1)) |
#define XWSREG_T_SHIFT XWREG_T_SHIFT |
#define XWSSQ_T_SHIFT LONG_SHIFT |
#define XWSSZ_T_SHIFT LONG_SHIFT |
#define XWSTK_T_SHIFT XWPTR_T_SHIFT |
typedef __xwcc_atomic xwbmp_t atomic_xwbmp_t |
typedef __xwcc_atomic xwer_t atomic_xwer_t |
typedef __xwcc_atomic xwid_t atomic_xwid_t |
typedef __xwcc_atomic xwlfq_t atomic_xwlfq_t |
typedef __xwcc_atomic xwpr_t atomic_xwpr_t |
typedef __xwcc_atomic xwptr_t atomic_xwptr_t |
typedef __xwcc_atomic xwreg_t atomic_xwreg_t |
typedef __xwcc_atomic xws16_t atomic_xws16_t |
typedef __xwcc_atomic xws32_t atomic_xws32_t |
typedef __xwcc_atomic xws64_t atomic_xws64_t |
typedef __xwcc_atomic xws8_t atomic_xws8_t |
typedef __xwcc_atomic xwsid_t atomic_xwsid_t |
typedef __xwcc_atomic xwsq_t atomic_xwsq_t |
typedef __xwcc_atomic xwsreg_t atomic_xwsreg_t |
typedef __xwcc_atomic xwssq_t atomic_xwssq_t |
typedef __xwcc_atomic xwssz_t atomic_xwssz_t |
typedef __xwcc_atomic xwstk_t atomic_xwstk_t |
typedef __xwcc_atomic xwsz_t atomic_xwsz_t |
typedef __xwcc_atomic xwu16_t atomic_xwu16_t |
typedef __xwcc_atomic xwu32_t atomic_xwu32_t |
typedef __xwcc_atomic xwu64_t atomic_xwu64_t |
typedef __xwcc_atomic xwu8_t atomic_xwu8_t |
原子操作内存模型
对应于 stdatomic.h
中定义的六种内存模型。
枚举值 | |
---|---|
xwaop_mo_relaxed | |
xwaop_mo_consume | |
xwaop_mo_acquire | |
xwaop_mo_release | |
xwaop_mo_acq_rel | |
xwaop_mo_seq_cst |
enum xwos_lkst_em |
XWOS锁状态
枚举值 | |
---|---|
XWOS_LKST_UNLOCKED | 未锁定 |
XWOS_LKST_LOCKED | 锁定 |
enum xwos_lock_type_em |
XWOS的锁类型枚举
枚举值 | |
---|---|
XWOS_LK_NONE | 无 |
XWOS_LK_MTX | 互斥锁 |
XWOS_LK_SPLK | 自旋锁 |
XWOS_LK_SQLK_WR | 顺序写锁 |
XWOS_LK_SQLK_RDEX | 顺序读锁 |
XWOS_LK_CALLBACK | 抽象回调锁 |
XWOS_LK_NUM | 锁类型的数量 |