diff options
author | behlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c> | 2008-03-05 00:58:54 +0000 |
---|---|---|
committer | behlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c> | 2008-03-05 00:58:54 +0000 |
commit | a713518f5d9e4f7b1c361035f1f3ef79869a960f (patch) | |
tree | eb5eb8b5457adb7418689c4750fa32d832793967 /include/sys/sysmacros.h | |
parent | 23f28c4f75b6a7583ac706db331211baa055ca5d (diff) |
Checkpoint for the night,
added a few more stub headers,
fleshed out a few stub headers,
added a FIXME file,
added various compatibility macros
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@25 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include/sys/sysmacros.h')
-rw-r--r-- | include/sys/sysmacros.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index c48019fdb..65070d858 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -64,7 +64,44 @@ extern "C" { #define bzero(ptr,size) memset(ptr,0,size) #define bcopy(src,dest,size) memcpy(dest,src,size) #define ASSERT(x) BUG_ON(!(x)) -#define ASSERT3U(left,OP,right) BUG_ON(!((left) OP (right))) +#define VERIFY(x) + +#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \ + const TYPE __left = (TYPE)(LEFT); \ + const TYPE __right = (TYPE)(RIGHT); \ + if (!(__left OP __right)) \ + BUG(); \ +} while (0) + +#define VERIFY3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t) +#define VERIFY3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t) +#define VERIFY3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t) + +#define ASSERT3S(x, y, z) VERIFY3S(x, y, z) +#define ASSERT3U(x, y, z) VERIFY3U(x, y, z) +#define ASSERT3P(x, y, z) VERIFY3P(x, y, z) + +/* Dtrace probes do not exist in the linux kernel */ + +#ifdef DTRACE_PROBE1 +#undef DTRACE_PROBE1 +#endif /* DTRACE_PROBE1 */ +#define DTRACE_PROBE1(a, b, c) ((void)0) + +#ifdef DTRACE_PROBE2 +#undef DTRACE_PROBE2 +#endif /* DTRACE_PROBE2 */ +#define DTRACE_PROBE2(a, b, c, d, e) ((void)0) + +#ifdef DTRACE_PROBE3 +#undef DTRACE_PROBE3 +#endif /* DTRACE_PROBE3 */ +#define DTRACE_PROBE3(a, b, c, d, e, f, g) ((void)0) + +#ifdef DTRACE_PROBE4 +#undef DTRACE_PROBE4 +#endif /* DTRACE_PROBE4 */ +#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) ((void)0) /* Missing globals */ |