[Concept,v2,2/5] acpi: Explain why boot-services data is used for BGRT image
Commit Message
From: Simon Glass <sjg@chromium.org>
There is some conflicting documentation here, so add a comment about
this.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Add new patch to explain why boot-services data is used for BGRT image
lib/acpi/acpi_extra.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
@@ -61,7 +61,16 @@ int acpi_write_bgrt(struct acpi_ctx *ctx)
/* Image Type: 0 = Bitmap */
bgrt->image_type = 0;
- /* Mark space used for tables */
+ /*
+ * Mark space used for tables. The EFI spec says "ACPI Tables loaded at
+ * boot time can be contained in memory of type EfiACPIReclaimMemory
+ * (recommended) or EfiACPIMemoryNVS. The ACPI spec says "The image
+ * should be stored in EfiBootServicesData, allowing the system to
+ * reclaim the memory when the image is no longer needed. Linux checks
+ * for EfiBootServicesData and ignores the image if it is anything else.
+ *
+ * So use EFI_BOOT_SERVICES_DATA here.
+ */
eret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA, size, &buf);
if (eret)
return -ENOMEM;