Commit ff88dbee authored by HardenedBSD Sync Service's avatar HardenedBSD Sync Service
Browse files

Merge branch 'freebsd/current/main' into hardened/current/master

parents 69a1fbc6 ae13829d
......@@ -140,6 +140,11 @@ u_int vm_wait_count(void);
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 @@ vm_addr_align_ok(vm_paddr_t pa, u_long alignment)
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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment