[Xen-devel,v2,4/4] xen/arm: acpi: Move the ACPI banks in bootinfo

Message ID 20170308175436.24001-5-julien.grall@arm.com
State New
Headers show
Series
  • xen/arm: Fix and clean-up for ACPI and EFI
Related show

Commit Message

Julien Grall March 8, 2017, 5:54 p.m.
Currently the acpi banks are stored in a separate variable and have an
header just for them.

This variable can be moved in the structure bootinfo removing an header
and a global variable.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

---
    Changes in v2:
        - Add Stefano's reviewed-by
---
 xen/arch/arm/efi/efi-boot.h |  3 +--
 xen/arch/arm/efi/efi-dom0.c | 12 +++++-------
 xen/arch/arm/efi/efi-dom0.h |  8 --------
 xen/include/asm-arm/setup.h |  3 +++
 4 files changed, 9 insertions(+), 17 deletions(-)
 delete mode 100644 xen/arch/arm/efi/efi-dom0.h

Patch hide | download patch | download mbox

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 4877e6714d..e1e447ac8e 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -7,7 +7,6 @@ 
 #include <xen/libfdt/libfdt.h>
 #include <asm/setup.h>
 #include <asm/smp.h>
-#include "efi-dom0.h"
 
 void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size);
 void __flush_dcache_area(const void *vaddr, unsigned long size);
@@ -165,7 +164,7 @@  static EFI_STATUS __init efi_process_memory_map_bootinfo(EFI_MEMORY_DESCRIPTOR *
 #ifdef CONFIG_ACPI
         else if ( desc_ptr->Type == EfiACPIReclaimMemory )
         {
-            if ( !meminfo_add_bank(&acpi_mem, desc_ptr) )
+            if ( !meminfo_add_bank(&bootinfo.acpi, desc_ptr) )
             {
                 PrintStr(L"Error: All " __stringify(NR_MEM_BANKS)
                           " acpi meminfo mem banks exhausted.\r\n");
diff --git a/xen/arch/arm/efi/efi-dom0.c b/xen/arch/arm/efi/efi-dom0.c
index f0ceaa6cae..1c356540f7 100644
--- a/xen/arch/arm/efi/efi-dom0.c
+++ b/xen/arch/arm/efi/efi-dom0.c
@@ -22,7 +22,6 @@ 
  */
 
 #include "efi.h"
-#include "efi-dom0.h"
 #include <xen/sched.h>
 #include <xen/pfn.h>
 #include <xen/libfdt/libfdt.h>
@@ -32,7 +31,6 @@ 
 #define XZ_EXTERN STATIC
 #include "../../../common/xz/crc32.c"
 
-struct meminfo __initdata acpi_mem;
 /* Constant to indicate "Xen" in unicode u16 format */
 static const CHAR16 xen_efi_fw_vendor[] = {0x0058, 0x0065, 0x006E, 0x0000};
 
@@ -46,7 +44,7 @@  size_t __init estimate_efi_size(int mem_nr_banks)
     int acpi_mem_nr_banks = 0;
 
     if ( !acpi_disabled )
-        acpi_mem_nr_banks = acpi_mem.nr_banks;
+        acpi_mem_nr_banks = bootinfo.acpi.nr_banks;
 
     size = ROUNDUP(est_size + ect_size + fw_vendor_size, 8);
     /* plus 1 for new created tables */
@@ -124,10 +122,10 @@  void __init acpi_create_efi_mmap_table(struct domain *d,
         fill_efi_memory_descriptor(desc, EfiConventionalMemory,
                                    mem->bank[i].start, mem->bank[i].size);
 
-    for ( i = 0; i < acpi_mem.nr_banks; i++, desc++ )
+    for ( i = 0; i < bootinfo.acpi.nr_banks; i++, desc++ )
         fill_efi_memory_descriptor(desc, EfiACPIReclaimMemory,
-                                   acpi_mem.bank[i].start,
-                                   acpi_mem.bank[i].size);
+                                   bootinfo.acpi.bank[i].start,
+                                   bootinfo.acpi.bank[i].size);
 
     fill_efi_memory_descriptor(desc, EfiACPIReclaimMemory,
                                d->arch.efi_acpi_gpa, d->arch.efi_acpi_len);
@@ -135,7 +133,7 @@  void __init acpi_create_efi_mmap_table(struct domain *d,
     tbl_add[TBL_MMAP].start = d->arch.efi_acpi_gpa
                               + acpi_get_table_offset(tbl_add, TBL_MMAP);
     tbl_add[TBL_MMAP].size = sizeof(EFI_MEMORY_DESCRIPTOR)
-                             * (mem->nr_banks + acpi_mem.nr_banks + 1);
+                             * (mem->nr_banks + bootinfo.acpi.nr_banks + 1);
 }
 
 /* Create /hypervisor/uefi node for efi properties. */
diff --git a/xen/arch/arm/efi/efi-dom0.h b/xen/arch/arm/efi/efi-dom0.h
deleted file mode 100644
index 3cd4caad2a..0000000000
--- a/xen/arch/arm/efi/efi-dom0.h
+++ /dev/null
@@ -1,8 +0,0 @@ 
-#ifndef __ARM_EFI_DOM0_H__
-#define __ARM_EFI_DOM0_H__
-
-#include <asm/setup.h>
-
-extern struct meminfo acpi_mem;
-
-#endif
diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
index 3da7a4904a..7c761851d2 100644
--- a/xen/include/asm-arm/setup.h
+++ b/xen/include/asm-arm/setup.h
@@ -43,6 +43,9 @@  struct bootmodules {
 struct bootinfo {
     struct meminfo mem;
     struct bootmodules modules;
+#ifdef CONFIG_ACPI
+    struct meminfo acpi;
+#endif
 };
 
 extern struct bootinfo bootinfo;