bond/inc/kern/cdef.h

40 lines
1014 B
C
Raw Normal View History

2018-10-02 06:43:30 +00:00
#pragma once
#include <stdint.h>
#include <stdarg.h>
#include <stddef.h>
2019-11-28 18:02:52 +00:00
#include <stdatomic.h>
2018-10-02 06:43:30 +00:00
2019-11-28 18:02:52 +00:00
typedef uintmax_t uintmax;
typedef intmax_t intmax;
2018-10-02 06:43:30 +00:00
typedef uint32_t uint32;
typedef int32_t int32;
typedef uint64_t uint64;
typedef int64_t int64;
typedef uintptr_t uintptr;
typedef uint16_t uint16;
typedef int16_t int16;
typedef uint8_t uint8;
typedef int8_t int8;
2018-11-21 03:44:33 +00:00
typedef size_t usize;
2019-11-28 18:02:52 +00:00
typedef unsigned char uchar;
typedef unsigned long ulong;
typedef unsigned int uint;
2018-10-02 06:43:30 +00:00
#define KABI __attribute__((sysv_abi))
2019-11-28 18:02:52 +00:00
#define STATIC_ASSERT(cond, msg) _Static_assert((cond), msg)
#define TYPEOF(type) __typeof__(type)
/* Declarations */
#define DECL_ATOMIC(type) _Atomic type
2018-10-02 06:43:30 +00:00
2019-11-28 18:02:52 +00:00
/* Attributes */
#define ATTR_PACKED __attribute__((packed))
#define ATTR_UNUSED __attribute__((unused))
#define ATTR_USED __attribute__((used))
#define ATTR_SECTION(x) __attribute__ ((section (#x)))
#define ATTR_ALIGN(x) _Alignas(x)
#define ATTR_FMT_PRINTF __attribute__((format (printf, 1, 2)))
2019-12-07 08:54:18 +00:00
#define BOCHS_BREAK __asm__("xchg %bx, %bx")