]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Add VIRT_IN_DMAP to check if a virtual address is from the DMAP range.
authorandrew <andrew@FreeBSD.org>
Fri, 31 Jul 2015 13:32:25 +0000 (13:32 +0000)
committerandrew <andrew@FreeBSD.org>
Fri, 31 Jul 2015 13:32:25 +0000 (13:32 +0000)
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

sys/arm64/include/vmparam.h

index 8ad602994e48e7a105f39f2befa2eca8afb02ef7..d1ed7f3509c8c0ece4de1dad486cf0d1889754a4 100644 (file)
 
 /* True if pa is in the dmap range */
 #define        PHYS_IN_DMAP(pa)        ((pa) <= DMAP_MAX_PHYSADDR)
+/* True if va is in the dmap range */
+#define        VIRT_IN_DMAP(va)        ((va) >= DMAP_MIN_ADDRESS && \
+    (va) <= DMAP_MAX_ADDRESS)
 
 #define        PHYS_TO_DMAP(pa)                                                \
 ({                                                                     \
 
 #define        DMAP_TO_PHYS(va)                                                \
 ({                                                                     \
-       KASSERT(((va) <= DMAP_MAX_ADDRESS || (va) >= DMAP_MIN_ADDRESS), \
+       KASSERT(VIRT_IN_DMAP(va),                                       \
            ("%s: VA out of range, VA: 0x%lx", __func__,                \
            (vm_offset_t)(va)));                                        \
        (va) & ~DMAP_MIN_ADDRESS;                                       \