Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/linuxkpi/common/include/linux/kernel.h
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
#define U8_C(x) x ## U | #define U8_C(x) x ## U | ||||
#define S16_C(x) x | #define S16_C(x) x | ||||
#define U16_C(x) x ## U | #define U16_C(x) x ## U | ||||
#define S32_C(x) x | #define S32_C(x) x | ||||
#define U32_C(x) x ## U | #define U32_C(x) x ## U | ||||
#define S64_C(x) x ## LL | #define S64_C(x) x ## LL | ||||
#define U64_C(x) x ## ULL | #define U64_C(x) x ## ULL | ||||
#define BUILD_BUG_ON(x) CTASSERT(!(x)) | #define BUILD_BUG_ON(x) CTASSERT(!(x)) | ||||
#define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) | |||||
#define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) | |||||
#define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) | #define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) | ||||
#define BUG_ON(cond) do { \ | #define BUG_ON(cond) do { \ | ||||
if (cond) { \ | if (cond) { \ | ||||
panic("BUG ON %s failed at %s:%d", \ | panic("BUG ON %s failed at %s:%d", \ | ||||
__stringify(cond), __FILE__, __LINE__); \ | __stringify(cond), __FILE__, __LINE__); \ | ||||
} \ | } \ | ||||
} while (0) | } while (0) | ||||
Show All 14 Lines | #define WARN_ON_ONCE(cond) ({ \ | ||||
bool __ret = (cond); \ | bool __ret = (cond); \ | ||||
if (__ret && !__warn_on_once) { \ | if (__ret && !__warn_on_once) { \ | ||||
__warn_on_once = 1; \ | __warn_on_once = 1; \ | ||||
printf("WARNING %s failed at %s:%d\n", \ | printf("WARNING %s failed at %s:%d\n", \ | ||||
__stringify(cond), __FILE__, __LINE__); \ | __stringify(cond), __FILE__, __LINE__); \ | ||||
} \ | } \ | ||||
unlikely(__ret); \ | unlikely(__ret); \ | ||||
}) | }) | ||||
#define oops_in_progress SCHEDULER_STOPPED() | |||||
#undef ALIGN | #undef ALIGN | ||||
#define ALIGN(x, y) roundup2((x), (y)) | #define ALIGN(x, y) roundup2((x), (y)) | ||||
#undef PTR_ALIGN | #undef PTR_ALIGN | ||||
#define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) | #define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) | ||||
#define DIV_ROUND_UP(x, n) howmany(x, n) | #define DIV_ROUND_UP(x, n) howmany(x, n) | ||||
#define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) | #define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) | ||||
#define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) | #define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) | ||||
▲ Show 20 Lines • Show All 310 Lines • Show Last 20 Lines |