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

[Xen-devel] [PATCH v2 30/41] arm : acpi add placeholder for acpi load address



EFI table, memory description table and some of acpi tables
will reside in DOM0 memory. Add placeholder for starting
address for loading in DOM0 and get/set acpi size helpers.

Signed-off-by: Parth Dixit <parth.dixit@xxxxxxxxxx>
---
 xen/arch/arm/acpi/lib.c    | 12 ++++++++++++
 xen/arch/arm/kernel.c      |  5 ++++-
 xen/arch/arm/kernel.h      |  1 +
 xen/include/asm-arm/acpi.h |  4 ++++
 4 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/acpi/lib.c b/xen/arch/arm/acpi/lib.c
index fd9bfa4..9b9f059 100644
--- a/xen/arch/arm/acpi/lib.c
+++ b/xen/arch/arm/acpi/lib.c
@@ -1,6 +1,8 @@
 #include <xen/acpi.h>
 #include <asm/mm.h>
 
+static int acpi_len = 0;
+
 void __iomem *
 acpi_os_map_iomem(acpi_physical_address phys, acpi_size size)
 {
@@ -17,3 +19,13 @@ inline bool_t acpi_psci_hvc_present(void)
 {
     return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_USE_HVC;
 }
+
+inline int get_acpi_size(void)
+{
+    return acpi_len;
+}
+
+inline void set_acpi_size(int size)
+{
+    acpi_len = size;
+}
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 209c3dd..a9999f6 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -13,6 +13,7 @@
 #include <asm/byteorder.h>
 #include <asm/setup.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/acpi.h>
 
 #include "kernel.h"
 
@@ -74,7 +75,8 @@ static void place_modules(struct kernel_info *info,
     const struct bootmodule *mod = info->initrd_bootmodule;
     const paddr_t initrd_len = ROUNDUP(mod ? mod->size : 0, MB(2));
     const paddr_t dtb_len = ROUNDUP(fdt_totalsize(info->fdt), MB(2));
-    const paddr_t modsize = initrd_len + dtb_len;
+    const paddr_t acpi_len = ROUNDUP(get_acpi_size(), MB(2));
+    const paddr_t modsize = initrd_len + dtb_len + acpi_len;
 
     /* Convenient */
     const paddr_t rambase = info->mem.bank[0].start;
@@ -119,6 +121,7 @@ static void place_modules(struct kernel_info *info,
 
     info->dtb_paddr = modbase;
     info->initrd_paddr = info->dtb_paddr + dtb_len;
+    info->acpi_paddr = info->initrd_paddr + initrd_len;
 }
 
 static paddr_t kernel_zimage_place(struct kernel_info *info)
diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h
index 0050dfb..f3a67ac 100644
--- a/xen/arch/arm/kernel.h
+++ b/xen/arch/arm/kernel.h
@@ -26,6 +26,7 @@ struct kernel_info {
     const struct bootmodule *kernel_bootmodule, *initrd_bootmodule;
     paddr_t dtb_paddr;
     paddr_t initrd_paddr;
+    paddr_t acpi_paddr;
 
     /* loader to use for this kernel */
     void (*load)(struct kernel_info *info);
diff --git a/xen/include/asm-arm/acpi.h b/xen/include/asm-arm/acpi.h
index 2df9ae0..994c41e 100644
--- a/xen/include/asm-arm/acpi.h
+++ b/xen/include/asm-arm/acpi.h
@@ -37,11 +37,15 @@ bool_t acpi_psci_present(void);
 bool_t acpi_psci_hvc_present(void);
 void __init acpi_init_cpus(void);
 void __init acpi_preinit_xen_time(unsigned int generic_timer_irq[]);
+int get_acpi_size(void);
+void set_acpi_size(int size);
 #else
 static inline bool_t acpi_psci_present(void) { return false; }
 static inline bool_t acpi_psci_hvc_present(void) {return false; }
 static inline void acpi_init_cpus(void) { }
 static inline void acpi_preinit_xen_time(unsigned int generic_timer_irq[]){ }
+static inline int get_acpi_size(void){return 0;}
+static inline void set_acpi_size(int size){}
 #endif /* CONFIG_ACPI */
 
 /* Basic configuration for ACPI */
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.