Skip to contentSkip to conversation

x86, acpi: Introduce x86 arch specific arch_reserve_mem_area() for e820 handling

tip:x86/acpi tip-bot for Thomas Renninger 1 participant 1 message Oct 1, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Commit-ID:  8e30524dcc0d0ac1a18a5cee482b9d9cde3cb332
Gitweb:     http://git.kernel.org/tip/8e30524dcc0d0ac1a18a5cee482b9d9cde3cb332
Author:     Thomas Renninger <[email protected]>
AuthorDate: Mon, 1 Oct 2012 00:23:53 +0200
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Sun, 30 Sep 2012 18:03:13 -0700

x86, acpi: Introduce x86 arch specific arch_reserve_mem_area() for e820 handling

This is needed for ACPI table overriding via initrd. Beside reserving memblocks, X86 also requires to flag the memory area to E820_RESERVED or E820_ACPI in the e820 mappings to be able to io(re)map it later.

---
 arch/x86/kernel/acpi/boot.c |    6 ++++++
 include/linux/acpi.h        |    8 ++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
arch/x86/kernel/acpi/boot.c +6 -0
index b2297e5..6b75777 100644
@@ -1700,3 +1700,9 @@ int __acpi_release_global_lock(unsigned int *lock)
 	} while (unlikely (val != old));
 	return old & 0x1;
 }
+
+void __init arch_reserve_mem_area(acpi_physical_address addr, size_t size)
+{
+	e820_add_region(addr, size, E820_ACPI);
+	update_e820();
+}
include/linux/acpi.h +8 -0
index 4f2a762..946fd1e 100644
@@ -426,6 +426,14 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
 
 acpi_status acpi_os_prepare_sleep(u8 sleep_state,
 				  u32 pm1a_control, u32 pm1b_control);
+#if CONFIG_X86
+void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
+#else
+static inline void arch_reserve_mem_area(acpi_physical_address addr,
+					  size_t size)
+{
+}
+#endif /* CONFIG_X86 */
 #else
 #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0)
 #endif