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

[Xen-devel] [PATCH v2 29/41] arm : acpi read acpi memory info from uefi



ACPI memory is seperate from conventional memory and should
be marked as reserved while passing to DOM0. Create a new meminfo
structure to store all the acpi tables listed in uefi.

Signed-off-by: Parth Dixit <parth.dixit@xxxxxxxxxx>
---
 xen/arch/arm/domain_build.c |  2 ++
 xen/arch/arm/efi/efi-boot.h | 20 +++++++++++++++++---
 xen/include/asm-arm/setup.h |  1 +
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 865b81a..9d98f64 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -42,6 +42,8 @@ static void __init parse_dom0_mem(const char *s)
 }
 custom_param("dom0_mem", parse_dom0_mem);
 
+struct meminfo __initdata acpi_mem;
+
 //#define DEBUG_DT
 
 #ifdef DEBUG_DT
diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index b02cc02..d21cba5 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -127,14 +127,16 @@ static EFI_STATUS __init 
efi_process_memory_map_bootinfo(EFI_MEMORY_DESCRIPTOR *
 {
     int Index;
     int i = 0;
+    int j = 0;
     EFI_MEMORY_DESCRIPTOR *desc_ptr = map;
 
     for ( Index = 0; Index < (mmap_size / desc_size); Index++ )
     {
-        if ( desc_ptr->Type == EfiConventionalMemory
-             || desc_ptr->Type == EfiBootServicesCode
-             || desc_ptr->Type == EfiBootServicesData )
+        switch( desc_ptr->Type )
         {
+        case EfiConventionalMemory:
+        case EfiBootServicesCode:
+        case EfiBootServicesData:
             if ( i >= NR_MEM_BANKS )
             {
                 PrintStr(L"Warning: All " __stringify(NR_MEM_BANKS)
@@ -144,11 +146,23 @@ static EFI_STATUS __init 
efi_process_memory_map_bootinfo(EFI_MEMORY_DESCRIPTOR *
             bootinfo.mem.bank[i].start = desc_ptr->PhysicalStart;
             bootinfo.mem.bank[i].size = desc_ptr->NumberOfPages * 
EFI_PAGE_SIZE;
             ++i;
+            break;
+        case EfiACPIReclaimMemory:
+            if ( j >= NR_MEM_BANKS )
+            {
+                PrintStr(L"Warning: All " __stringify(NR_MEM_BANKS)
+                          " acpi meminfo mem banks exhausted.\r\n");
+                break;
+            }
+            acpi_mem.bank[j].start = desc_ptr->PhysicalStart;
+            acpi_mem.bank[j].size  = desc_ptr->NumberOfPages * EFI_PAGE_SIZE;
+            ++j;
         }
         desc_ptr = NextMemoryDescriptor(desc_ptr, desc_size);
     }
 
     bootinfo.mem.nr_banks = i;
+    acpi_mem.nr_banks = j;
     return EFI_SUCCESS;
 }
 
diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
index ba5a67d..1865b72 100644
--- a/xen/include/asm-arm/setup.h
+++ b/xen/include/asm-arm/setup.h
@@ -46,6 +46,7 @@ struct bootinfo {
 };
 
 extern struct bootinfo bootinfo;
+extern struct meminfo acpi_mem;
 
 void arch_init_memory(void);
 
-- 
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®.