From: Zhang Rui <rui.zhang@intel.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-acpi <linux-acpi@vger.kernel.org>,
linux-pm <linux-pm@lists.linux-foundation.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>, Pavel Machek <pavel@suse.cz>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Andi Kleen <andi@firstfloor.org>, Ingo Molnar <mingo@elte.hu>
Subject: [linux-next] [PATCH V2 3/4] ACPI: mark ACPI NVS memory region
Date: Fri, 11 Jul 2008 13:29:12 +0800 [thread overview]
Message-ID: <1215754152.1617.60.camel@rzhang-dt> (raw)
Mark ACPI NVS memory region during startup.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
arch/x86/kernel/e820.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
Index: linux-next/arch/x86/kernel/e820.c
===================================================================
--- linux-next.orig/arch/x86/kernel/e820.c 2008-07-11 11:44:54.000000000 +0800
+++ linux-next/arch/x86/kernel/e820.c 2008-07-11 11:52:22.000000000 +0800
@@ -19,6 +19,8 @@
#include <linux/mm.h>
#include <linux/pfn.h>
#include <linux/suspend.h>
+#include <linux/efi.h>
+#include <linux/acpi.h>
#include <asm/pgtable.h>
#include <asm/page.h>
@@ -623,6 +625,33 @@
}
#endif
+#ifdef CONFIG_HIBERNATION
+/* Mark ACPI NVS region, so that OS can save/restore it during hibernation */
+static int __init e820_mark_nvs_memory(void)
+{
+ int i;
+
+ if (efi_enabled)
+ return 0;
+
+ for (i = 0; i < e820.nr_map; i++) {
+ struct e820entry *ei = &e820.map[i];
+ unsigned long start, end;
+
+ if (ei->type != E820_NVS)
+ continue;
+ start = PFN_UP(ei->addr);
+ end = PFN_DOWN(ei->addr + ei->size);
+ if (start >= end)
+ continue;
+
+ acpi_mark_nvs_region(start, end - 1);
+ }
+ return 0;
+}
+core_initcall(e820_mark_nvs_memory);
+#endif
+
/*
* Early reserved memory areas.
*/
reply other threads:[~2008-07-11 5:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1215754152.1617.60.camel@rzhang-dt \
--to=rui.zhang@intel.com \
--cc=andi@firstfloor.org \
--cc=hmh@hmh.eng.br \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=mingo@elte.hu \
--cc=pavel@suse.cz \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox