Author: jhibbits
Date: Thu Jul 19 20:13:33 2018
New Revision: 336509
URL: https://svnweb.freebsd.org/changeset/base/336509

Log:
  Merge the md_page structs for AIM and Book-E into a single unioned struct
  
  Summary:
  Ports like sysutils/lsof troll through kernel structures, and
  therefore include kernel headers and all the dirty secrets involved.  struct
  vm_page includes the struct md_page inline, which currently is only defined
  if AIM or BOOKE is defined.  Thus, by default, sysutils/lsof cannot build,
  due to the struct md_page having an incomplete type.  Fix this by merging
  the two struct definitions into an anonymous struct-union.
  
  A similar change could be made to unify the pmap structures as well.
  
  Reviewed By: nwhitehorn
  Differential Revision: https://reviews.freebsd.org/D16232

Modified:
  head/sys/powerpc/include/pmap.h

Modified: head/sys/powerpc/include/pmap.h
==============================================================================
--- head/sys/powerpc/include/pmap.h     Thu Jul 19 20:11:14 2018        
(r336508)
+++ head/sys/powerpc/include/pmap.h     Thu Jul 19 20:13:33 2018        
(r336509)
@@ -150,12 +150,6 @@ struct     pmap {
        struct pvo_tree pmap_pvo;
 };
 
-struct md_page {
-       volatile int32_t mdpg_attrs;
-       vm_memattr_t     mdpg_cache_attrs;
-       struct  pvo_head mdpg_pvoh;
-};
-
 #define        pmap_page_get_memattr(m)        ((m)->md.mdpg_cache_attrs)
 #define        pmap_page_is_mapped(m)  (!LIST_EMPTY(&(m)->md.mdpg_pvoh))
 
@@ -212,11 +206,6 @@ struct pv_entry {
 };
 typedef struct pv_entry *pv_entry_t;
 
-struct md_page {
-       TAILQ_HEAD(, pv_entry) pv_list;
-       int     pv_tracked;
-};
-
 #define        pmap_page_get_memattr(m)        VM_MEMATTR_DEFAULT
 #define        pmap_page_is_mapped(m)  (!TAILQ_EMPTY(&(m)->md.pv_list))
 
@@ -231,6 +220,20 @@ struct pmap {
        struct mtx              pm_mtx;         /* pmap mutex */
 };
 #endif /* AIM */
+
+struct md_page {
+       union {
+               struct md_page_booke {
+                       TAILQ_HEAD(, pv_entry) pv_list;
+                       int     pv_tracked;
+               };
+               struct md_page_aim {
+                       volatile int32_t mdpg_attrs;
+                       vm_memattr_t     mdpg_cache_attrs;
+                       struct  pvo_head mdpg_pvoh;
+               };
+       };
+};
 
 extern struct pmap kernel_pmap_store;
 #define        kernel_pmap     (&kernel_pmap_store)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to