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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to