OSDN Git Service

Merge tag 'libnvdimm-for-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw...
[uclinux-h8/linux.git] / arch / x86 / platform / efi / efi.c
index fe01ae3..cfba30f 100644 (file)
@@ -117,6 +117,27 @@ void efi_get_time(struct timespec *now)
        now->tv_nsec = 0;
 }
 
+void __init efi_find_mirror(void)
+{
+       void *p;
+       u64 mirror_size = 0, total_size = 0;
+
+       for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
+               efi_memory_desc_t *md = p;
+               unsigned long long start = md->phys_addr;
+               unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
+
+               total_size += size;
+               if (md->attribute & EFI_MEMORY_MORE_RELIABLE) {
+                       memblock_mark_mirror(start, size);
+                       mirror_size += size;
+               }
+       }
+       if (mirror_size)
+               pr_info("Memory: %lldM/%lldM mirrored memory\n",
+                       mirror_size>>20, total_size>>20);
+}
+
 /*
  * Tell the kernel about the EFI memory map.  This might include
  * more than the max 128 entries that can fit in the e820 legacy
@@ -504,6 +525,8 @@ void __init efi_init(void)
 
        if (efi_enabled(EFI_DBG))
                print_efi_memmap();
+
+       efi_esrt_init();
 }
 
 void __init efi_late_init(void)