[PATCH kvm-unit-tests 13/18] arm: make pgtable.h private to mmu.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The pgd/pmd/pud definitions are not needed outside the architecture-
dependent MMU functions.  In fact, it probably would be simpler to
have completely different files for 32-bit and 64-bit ARM.  However,
as a first and possibly less controversial step, hide them inside
that file.

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 lib/arm/asm/mmu-api.h | 4 ++++
 lib/arm/asm/mmu.h     | 1 -
 lib/arm/asm/pgtable.h | 4 ----
 lib/arm/bitops.c      | 1 +
 lib/arm/mmu.c         | 6 ++++++
 lib/arm64/asm/mmu.h   | 1 -
 6 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/lib/arm/asm/mmu-api.h b/lib/arm/asm/mmu-api.h
index bf0e6a0..060e5cd 100644
--- a/lib/arm/asm/mmu-api.h
+++ b/lib/arm/asm/mmu-api.h
@@ -1,5 +1,9 @@
 #ifndef __ASMARM_MMU_API_H_
 #define __ASMARM_MMU_API_H_
+
+#include <asm/page.h>
+#include <stdbool.h>
+
 extern pgd_t *mmu_idmap;
 extern unsigned int mmu_disabled_cpu_count;
 extern bool __mmu_enabled(void);
diff --git a/lib/arm/asm/mmu.h b/lib/arm/asm/mmu.h
index 2bb0cde..a31e19c 100644
--- a/lib/arm/asm/mmu.h
+++ b/lib/arm/asm/mmu.h
@@ -5,7 +5,6 @@
  *
  * This work is licensed under the terms of the GNU LGPL, version 2.
  */
-#include <asm/pgtable.h>
 #include <asm/barrier.h>
 
 #define PTE_USER		L_PTE_USER
diff --git a/lib/arm/asm/pgtable.h b/lib/arm/asm/pgtable.h
index 5af4b9b..a38f5da 100644
--- a/lib/arm/asm/pgtable.h
+++ b/lib/arm/asm/pgtable.h
@@ -14,10 +14,6 @@
  *
  * This work is licensed under the terms of the GNU GPL, version 2.
  */
-#include <alloc.h>
-#include <asm/setup.h>
-#include <asm/page.h>
-#include <asm/pgtable-hwdef.h>
 
 #define pgd_none(pgd)		(!pgd_val(pgd))
 #define pud_none(pud)		(!pud_val(pud))
diff --git a/lib/arm/bitops.c b/lib/arm/bitops.c
index 9ab241b..b17d76a 100644
--- a/lib/arm/bitops.c
+++ b/lib/arm/bitops.c
@@ -6,6 +6,7 @@
  *
  * This work is licensed under the terms of the GNU GPL, version 2.
  */
+#include "libcflat.h"
 #include <bitops.h>
 #include <asm/barrier.h>
 #include <asm/mmu.h>
diff --git a/lib/arm/mmu.c b/lib/arm/mmu.c
index 1b7e4fb..227e25b 100644
--- a/lib/arm/mmu.c
+++ b/lib/arm/mmu.c
@@ -9,6 +9,12 @@
 #include <asm/thread_info.h>
 #include <asm/cpumask.h>
 #include <asm/mmu.h>
+#include <asm/setup.h>
+#include <asm/page.h>
+
+#include "alloc.h"
+#include <asm/pgtable-hwdef.h>
+#include <asm/pgtable.h>
 
 extern unsigned long etext;
 
diff --git a/lib/arm64/asm/mmu.h b/lib/arm64/asm/mmu.h
index 3bc31c9..9df99cc 100644
--- a/lib/arm64/asm/mmu.h
+++ b/lib/arm64/asm/mmu.h
@@ -5,7 +5,6 @@
  *
  * This work is licensed under the terms of the GNU LGPL, version 2.
  */
-#include <asm/pgtable.h>
 #include <asm/barrier.h>
 
 #define PMD_SECT_UNCACHED	PMD_ATTRINDX(MT_DEVICE_nGnRE)
-- 
2.14.2






[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux