aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64/include/vmparam.h
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2015-07-31 13:32:25 +0000
committerAndrew Turner <andrew@FreeBSD.org>2015-07-31 13:32:25 +0000
commit71d72ea14f174439bcc35550e67bca8b3c58bdaf (patch)
tree008a4f36eeee8ea93f7875723a46520c9920c571 /sys/arm64/include/vmparam.h
parentd8000daa92a4cdf940348f483861d52fa3cbf91d (diff)
downloadsrc-71d72ea14f174439bcc35550e67bca8b3c58bdaf.tar.gz
src-71d72ea14f174439bcc35550e67bca8b3c58bdaf.zip
Add VIRT_IN_DMAP to check if a virtual address is from the DMAP range.
Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=286127
Diffstat (limited to 'sys/arm64/include/vmparam.h')
-rw-r--r--sys/arm64/include/vmparam.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/arm64/include/vmparam.h b/sys/arm64/include/vmparam.h
index 8ad602994e48..d1ed7f3509c8 100644
--- a/sys/arm64/include/vmparam.h
+++ b/sys/arm64/include/vmparam.h
@@ -165,6 +165,9 @@
/* 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) \
({ \
@@ -176,7 +179,7 @@
#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; \