Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sys/systm.h
Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | if (__predict_false(!(exp))) { \ | ||||
kassert_panic msg; \ | kassert_panic msg; \ | ||||
} \ | } \ | ||||
} while (0) | } while (0) | ||||
#define VNPASS(exp, vp) do { \ | #define VNPASS(exp, vp) do { \ | ||||
const char *_exp = #exp; \ | const char *_exp = #exp; \ | ||||
VNASSERT(exp, vp, ("condition %s not met at %s:%d (%s)", \ | VNASSERT(exp, vp, ("condition %s not met at %s:%d (%s)", \ | ||||
_exp, __FILE__, __LINE__, __func__)); \ | _exp, __FILE__, __LINE__, __func__)); \ | ||||
} while (0) | } while (0) | ||||
#define __assert_unreachable() \ | |||||
panic("executing segment marked as unreachable at %s:%d (%s)\n", \ | |||||
__FILE__, __LINE__, __func__) | |||||
#else | #else | ||||
#define KASSERT(exp,msg) do { \ | #define KASSERT(exp,msg) do { \ | ||||
} while (0) | } while (0) | ||||
#define VNASSERT(exp, vp, msg) do { \ | #define VNASSERT(exp, vp, msg) do { \ | ||||
} while (0) | } while (0) | ||||
#define VNPASS(exp, vp) do { \ | #define VNPASS(exp, vp) do { \ | ||||
} while (0) | } while (0) | ||||
#define __assert_unreachable() __unreachable() | |||||
#endif | #endif | ||||
#ifndef CTASSERT /* Allow lint to override */ | #ifndef CTASSERT /* Allow lint to override */ | ||||
#define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") | #define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") | ||||
#endif | #endif | ||||
#if defined(_KERNEL) | #if defined(_KERNEL) | ||||
#include <sys/param.h> /* MAXCPU */ | #include <sys/param.h> /* MAXCPU */ | ||||
▲ Show 20 Lines • Show All 480 Lines • Show Last 20 Lines |