Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jul 2015 13:32:26 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286127 - head/sys/arm64/include
Message-ID:  <201507311332.t6VDWQK1034591@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Fri Jul 31 13:32:25 2015
New Revision: 286127
URL: https://svnweb.freebsd.org/changeset/base/286127

Log:
  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

Modified:
  head/sys/arm64/include/vmparam.h

Modified: head/sys/arm64/include/vmparam.h
==============================================================================
--- head/sys/arm64/include/vmparam.h	Fri Jul 31 12:37:40 2015	(r286126)
+++ head/sys/arm64/include/vmparam.h	Fri Jul 31 13:32:25 2015	(r286127)
@@ -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;					\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507311332.t6VDWQK1034591>