/* We allocate a page from the first 1MB of memory for the wakeup routine for when we come back from a sleep state. The runtime allocator allows specification of <16MB pages, but not <1MB pages.  */
void __init acpi_reserve_wakeup_memory(void)
/* We allocate a page from the first 1MB of memory for the wakeup routine for when we come back from a sleep state. The runtime allocator allows specification of <16MB pages, but not <1MB pages.  */
void __init acpi_reserve_wakeup_memory(void)
{
	unsigned long mem;
	if ((&wakeup_code_end - &wakeup_code_start) > WAKEUP_SIZE) {
		printk(KERN_ERR
		       "ACPI: Wakeup code way too big, S3 disabled.\n");
		return;
	}
	mem = find_e820_area(0, 1<<20, WAKEUP_SIZE, PAGE_SIZE);
	if (mem == -1L) {
		printk(KERN_ERR "ACPI: Cannot allocate lowmem, S3 disabled.\n");
		return;
	}
	acpi_realmode = (unsigned long) phys_to_virt(mem);
	acpi_wakeup_address = mem;
	reserve_early(mem, mem + WAKEUP_SIZE, "ACPI WAKEUP");
}