Changeset View
Changeset View
Standalone View
Standalone View
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() \ | |||||
mjg: this really does not tell you which is one is it and this call will not even print a backtrace. | |||||
Done Inline ActionsWhoops, lost that in an iteration where I converted it from a kassert_panic("Unreachable segment reached\n")) to a panic - will fix. kevans: Whoops, lost that in an iteration where I converted it from a kassert_panic("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 |
this really does not tell you which is one is it and this call will not even print a backtrace. iow this really wants to be panic("executing segment marked as unreachable at %s (%s:%s)", func, FILE, LINE); or so
otherwise lgtm