Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Aug 2014 08:02:38 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270201 - in head/sys: powerpc/include sys
Message-ID:  <201408200802.s7K82cJ6059609@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Aug 20 08:02:38 2014
New Revision: 270201
URL: http://svnweb.freebsd.org/changeset/base/270201

Log:
  Add arch-specific macro SFBUF_PHYS_DMAP(), which should translate the
  physical address of the page to direct map address, in case
  SFBUF_OPTIONAL_DIRECT_MAP returns true.  The case of PowerPC AIM
  64bit, where the page physical address is identical to the direct map
  address, is accidental.
  
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/powerpc/include/vmparam.h
  head/sys/sys/sf_buf.h

Modified: head/sys/powerpc/include/vmparam.h
==============================================================================
--- head/sys/powerpc/include/vmparam.h	Wed Aug 20 07:48:09 2014	(r270200)
+++ head/sys/powerpc/include/vmparam.h	Wed Aug 20 08:02:38 2014	(r270201)
@@ -210,5 +210,6 @@ struct pmap_physseg {
 #define	SFBUF
 #define	SFBUF_NOMD
 #define	SFBUF_OPTIONAL_DIRECT_MAP	hw_direct_map
+#define	SFBUF_PHYS_DMAP(x)		(x)
  
 #endif /* _MACHINE_VMPARAM_H_ */

Modified: head/sys/sys/sf_buf.h
==============================================================================
--- head/sys/sys/sf_buf.h	Wed Aug 20 07:48:09 2014	(r270200)
+++ head/sys/sys/sf_buf.h	Wed Aug 20 08:02:38 2014	(r270201)
@@ -113,7 +113,7 @@ sf_buf_kva(struct sf_buf *sf)
 {
 #ifdef SFBUF_OPTIONAL_DIRECT_MAP
 	if (SFBUF_OPTIONAL_DIRECT_MAP)
-		return (VM_PAGE_TO_PHYS((vm_page_t)sf));
+		return (SFBUF_PHYS_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf)));
 #endif
 
         return (sf->kva);



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