Page MenuHomeFreeBSD

D34070.id102059.diff
No OneTemporary

D34070.id102059.diff

diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h
--- a/sys/vm/vm_extern.h
+++ b/sys/vm/vm_extern.h
@@ -42,6 +42,8 @@
struct vmem;
#ifdef _KERNEL
+#include <sys/systm.h>
+
struct cdev;
struct cdevsw;
struct domainset;
@@ -140,11 +142,8 @@
static inline bool
vm_addr_align_ok(vm_paddr_t pa, u_long alignment)
{
-#ifdef INVARIANTS
- if (!powerof2(alignment))
- panic("%s: alignment is not a power of 2: %#lx",
- __func__, alignment);
-#endif
+ KASSERT(powerof2(alignment), ("%s: alignment is not a power of 2: %#lx",
+ __func__, alignment));
return ((pa & (alignment - 1)) == 0);
}
@@ -155,11 +154,8 @@
static inline bool
vm_addr_bound_ok(vm_paddr_t pa, vm_paddr_t size, vm_paddr_t boundary)
{
-#ifdef INVARIANTS
- if (!powerof2(boundary))
- panic("%s: boundary is not a power of 2: %#jx",
- __func__, (uintmax_t)boundary);
-#endif
+ KASSERT(powerof2(boundary), ("%s: boundary is not a power of 2: %#jx",
+ __func__, (uintmax_t)boundary));
return (((pa ^ (pa + size - 1)) & -boundary) == 0);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Aug 13, 7:27 PM (1 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36649076
Default Alt Text
D34070.id102059.diff (1 KB)

Event Timeline