Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154264881
D33725.id100850.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
747 B
Referenced Files
None
Subscribers
None
D33725.id100850.diff
View Options
Index: sys/vm/vm_extern.h
===================================================================
--- sys/vm/vm_extern.h
+++ 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 (alignment & (alignment - 1) != 0)
+ panic("%s: alignment is not a power of 2: 0x%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 (boundary & (boundary - 1) != 0)
+ panic("%s: boundary is not a power of 2: 0x%lx",
+ __func__, alignment)
+#endif
return (((pa ^ (pa + size - 1)) & -boundary) == 0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 28, 11:50 AM (17 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32274982
Default Alt Text
D33725.id100850.diff (747 B)
Attached To
Mode
D33725: Add invariants that check validity of alignment, boundary parameters
Attached
Detach File
Event Timeline
Log In to Comment