efi/libstub/x86: Work around page freeing issue in mixed mode
[linux-2.6-block.git] / arch / x86 / boot / compressed / eboot.c
index f81dd66626cee071d347cd1155c91eb3b98897b6..ec92c4decc86817d0e2c6b778cfa95b35bd56618 100644 (file)
@@ -901,3 +901,19 @@ fail:
        for (;;)
                asm("hlt");
 }
+
+#ifdef CONFIG_EFI_MIXED
+void efi_free_native(unsigned long size, unsigned long addr);
+
+void efi_free(unsigned long size, unsigned long addr)
+{
+       if (!size)
+               return;
+
+       if (efi_is_native())
+               efi_free_native(size, addr);
+       else
+               efi64_thunk(efi_system_table()->boottime->mixed_mode.free_pages,
+                           addr, 0, DIV_ROUND_UP(size, EFI_PAGE_SIZE));
+}
+#endif