Page MenuHomeFreeBSD

D33725.diff
No OneTemporary

D33725.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
@@ -140,6 +140,11 @@
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
return ((pa & (alignment - 1)) == 0);
}
@@ -150,6 +155,11 @@
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
return (((pa ^ (pa + size - 1)) & -boundary) == 0);
}

File Metadata

Mime Type
text/plain
Expires
Wed, Jul 15, 7:42 PM (9 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35111640
Default Alt Text
D33725.diff (698 B)

Event Timeline