Type aliases
include/types/types.h View source View on GitHubType Aliases
Section titled “Type Aliases”Time units
time_ns_t
Section titled “time_ns_t” ct_strong_int(time_ns, TIME_NS, uint64_t, UINT64_MAX) (4 declarations) source
time_us_t
Section titled “time_us_t” ct_strong_int(time_us, TIME_US, uint64_t, UINT64_MAX) (4 declarations) source
time_ms_t
Section titled “time_ms_t” ct_strong_int(time_ms, TIME_MS, uint64_t, UINT64_MAX) (4 declarations) source
time_s_t
Section titled “time_s_t” ct_strong_int(time_s, TIME_S, uint64_t, UINT64_MAX) (4 declarations) source
timestamp_t
Section titled “timestamp_t”typedef uint64_t timestamp_t source Frequency
freq_hz_t
Section titled “freq_hz_t” ct_strong_int(freq_hz, FREQ_HZ, uint64_t, UINT64_MAX) (4 declarations) source
freq_khz_t
Section titled “freq_khz_t” ct_strong_int(freq_khz, FREQ_KHZ, uint64_t, UINT64_MAX) (4 declarations) source
freq_mhz_t
Section titled “freq_mhz_t” ct_strong_int(freq_mhz, FREQ_MHZ, uint64_t, UINT64_MAX) (4 declarations) source
freq_ghz_t
Section titled “freq_ghz_t” ct_strong_int(freq_ghz, FREQ_GHZ, uint64_t, UINT64_MAX) (4 declarations) source
sz_kib_t
Section titled “sz_kib_t” ct_strong_int(sz_kib, SZ_KIB, size_t, SIZE_MAX) (4 declarations) source
sz_mib_t
Section titled “sz_mib_t” ct_strong_int(sz_mib, SZ_MIB, size_t, SIZE_MAX) (4 declarations) source
sz_gib_t
Section titled “sz_gib_t” ct_strong_int(sz_gib, SZ_GIB, size_t, SIZE_MAX) (4 declarations) source
sz_tib_t
Section titled “sz_tib_t” ct_strong_int(sz_tib, SZ_TIB, size_t, SIZE_MAX) (4 declarations) source
sz_kb_t
Section titled “sz_kb_t” ct_strong_int(sz_kb, SZ_KB, size_t, SIZE_MAX) (4 declarations) source
sz_mb_t
Section titled “sz_mb_t” ct_strong_int(sz_mb, SZ_MB, size_t, SIZE_MAX) (4 declarations) source
sz_gb_t
Section titled “sz_gb_t” ct_strong_int(sz_gb, SZ_GB, size_t, SIZE_MAX) (4 declarations) source
sz_tb_t
Section titled “sz_tb_t” ct_strong_int(sz_tb, SZ_TB, size_t, SIZE_MAX) (4 declarations) source
sz_b_t
Section titled “sz_b_t” ct_strong_int(sz_b, SZ_B, size_t, SIZE_MAX) (4 declarations) source
Aliases over UNIX identifiers
inode_t
Section titled “inode_t” ct_strong_int(inode, INODE, uint32_t, UINT32_MAX) (4 declarations) source
mode_t
Section titled “mode_t”typedef uint16_t mode_t source typedef uint32_t gid_t source typedef uint32_t uid_t source stack_handle_t
Section titled “stack_handle_t”typedef struct stack_depot_record * stack_handle_t source For stack depot: someday will become uint32_t
Refcount
refcount_t
Section titled “refcount_t”typedef atomic_uint32_t refcount_t source mapcount_t
Section titled “mapcount_t”typedef atomic_uint32_t mapcount_t source Addresses and memory
paddr_t
Section titled “paddr_t” ct_strong_int(paddr, PADDR, uintptr_t, UINTPTR_MAX) (4 declarations) source
vaddr_t
Section titled “vaddr_t” ct_strong_int(vaddr, VADDR, uintptr_t, UINTPTR_MAX) (4 declarations) source
ct_strong_int(pfn, PFN, uintptr_t, UINTPTR_MAX) (4 declarations) source
pgoff_t
Section titled “pgoff_t” ct_strong_int(pgoff, PGOFF, uintptr_t, UINTPTR_MAX) (4 declarations) source
iova_t
Section titled “iova_t” ct_strong_int(iova, IOVA, uintptr_t, UINTPTR_MAX) (4 declarations) source
ct_strong_int(pte, PTE, uint64_t, UINT64_MAX) (4 declarations) source
page_flags_t
Section titled “page_flags_t”typedef uint64_t page_flags_t source Processor topology and threading
typedef uint8_t irq_t source cpu_perf_t
Section titled “cpu_perf_t”typedef int8_t cpu_perf_t source cpu_id_t
Section titled “cpu_id_t” ct_strong_int(cpu_id, CPU_ID, size_t, SIZE_MAX) (4 declarations) source
domain_id_t
Section titled “domain_id_t” ct_strong_int(domain_id, DOMAIN_ID, size_t, SIZE_MAX) (4 declarations) source
numa_node_t
Section titled “numa_node_t” ct_strong_int(numa_node, NUMA_NODE, size_t, SIZE_MAX) (4 declarations) source
thread_id_t
Section titled “thread_id_t” ct_strong_int(thread_id, THREAD_ID, size_t, SIZE_MAX) (4 declarations) source
nice_t
Section titled “nice_t”typedef int32_t nice_t source thread_prio_t
Section titled “thread_prio_t”typedef uint32_t thread_prio_t source Other types
fx32_32_t
Section titled “fx32_32_t”typedef int64_t fx32_32_t source ssize_t
Section titled “ssize_t”typedef ptrdiff_t ssize_t source Larger types
int128_t
Section titled “int128_t”typedef __int128_t int128_t source uint128_t
Section titled “uint128_t”typedef __uint128_t uint128_t source any_fn_t
Section titled “any_fn_t”typedef struct { … } any_fn_t source Macros
Section titled “Macros”any_fn_erase
Section titled “any_fn_erase”#define any_fn_erase(addr) source Expansion
#define any_fn_erase(addr) \
((any_fn_t) {.erased = (typeof(((any_fn_t *) 0)->erased)) (addr)}) any_fn_from
Section titled “any_fn_from”#define any_fn_from(fn) source Constant expression for a function in static init
Expansion
#define any_fn_from(fn) \
any_fn_erase( \
(uintptr_t) (fn) + \
ct_expr_assert_zero(ct_is_fn_ptr(fn), "`" #fn "` is not a function")) any_fn_to
Section titled “any_fn_to”#define any_fn_to(any, T) source Expansion
#define any_fn_to(any, T) \
(ct_typecheck(any_fn_t, any), \
(T) ((uintptr_t) (any).erased + \
ct_expr_assert_zero(ct_is_fn_ptr((T) 0), \
"`" #T "` is not a function pointer type"))) any_fn_eq
Section titled “any_fn_eq”#define any_fn_eq(a, b) source Expansion
#define any_fn_eq(a, b) \
(ct_typecheck(any_fn_t, a), ct_typecheck(any_fn_t, b), \
(a).erased == (b).erased) any_fn_is_null
Section titled “any_fn_is_null”#define any_fn_is_null(any) source Expansion
#define any_fn_is_null(any) (ct_typecheck(any_fn_t, any), (any).erased == NULL) any_fn_to_data
Section titled “any_fn_to_data”#define any_fn_to_data(any) source Sneak it through a void * data slot, which is ok on our targets
Expansion
#define any_fn_to_data(any) \
(ct_typecheck(any_fn_t, any), (void *) (uintptr_t) (any).erased) any_fn_from_data
Section titled “any_fn_from_data”#define any_fn_from_data(ptr) source Expansion
#define any_fn_from_data(ptr) \
(ct_typecheck(void *, ptr), any_fn_erase((uintptr_t) (ptr))) CPU_PERF_MAX
Section titled “CPU_PERF_MAX”#define CPU_PERF_MAX INT8_MAX source CPU_PERF_MIN
Section titled “CPU_PERF_MIN”#define CPU_PERF_MIN INT8_MIN source MODE_MAX
Section titled “MODE_MAX”#define MODE_MAX UINT16_MAX source MODE_MIN
Section titled “MODE_MIN”#define MODE_MIN 0 source GID_MAX
Section titled “GID_MAX”#define GID_MAX UINT32_MAX source GID_MIN
Section titled “GID_MIN”#define GID_MIN 0 source UID_MAX
Section titled “UID_MAX”#define UID_MAX UINT32_MAX source UID_MIN
Section titled “UID_MIN”#define UID_MIN 0 source STACK_HANDLE_MAX
Section titled “STACK_HANDLE_MAX”#define STACK_HANDLE_MAX UINT32_MAX source STACK_HANDLE_MIN
Section titled “STACK_HANDLE_MIN”#define STACK_HANDLE_MIN 0 source REFCOUNT_MAX
Section titled “REFCOUNT_MAX”#define REFCOUNT_MAX UINT32_MAX source REFCOUNT_MIN
Section titled “REFCOUNT_MIN”#define REFCOUNT_MIN 0 source CPU_ID_NONE
Section titled “CPU_ID_NONE”#define CPU_ID_NONE CPU_ID_MAX source DOMAIN_ID_NONE
Section titled “DOMAIN_ID_NONE”#define DOMAIN_ID_NONE DOMAIN_ID_MAX source THREAD_ID_NONE
Section titled “THREAD_ID_NONE”#define THREAD_ID_NONE THREAD_ID_MAX source PAGE_FLAGS_MAX
Section titled “PAGE_FLAGS_MAX”#define PAGE_FLAGS_MAX UINT64_MAX source PAGE_FLAGS_MIN
Section titled “PAGE_FLAGS_MIN”#define PAGE_FLAGS_MIN 0 source THREAD_PRIO_MAX
Section titled “THREAD_PRIO_MAX”#define THREAD_PRIO_MAX UINT32_MAX source THREAD_PRIO_MIN
Section titled “THREAD_PRIO_MIN”#define THREAD_PRIO_MIN 0 source FX32_32_MAX
Section titled “FX32_32_MAX”#define FX32_32_MAX INT64_MAX source FX32_32_MIN
Section titled “FX32_32_MIN”#define FX32_32_MIN INT64_MIN source NICE_MAX
Section titled “NICE_MAX”#define NICE_MAX 19 source NICE_MIN
Section titled “NICE_MIN”#define NICE_MIN -20 source SSIZE_MAX
Section titled “SSIZE_MAX”SSIZE_MIN
Section titled “SSIZE_MIN”INT128_MAX
Section titled “INT128_MAX”Shift has to come after the complement, because complementing the
shifted zero yields all ones, turning it into -1
INT128_MIN
Section titled “INT128_MIN”#define INT128_MIN ((int128_t) (-INT128_MAX - 1)) source