From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759587AbYGCHF4 (ORCPT ); Thu, 3 Jul 2008 03:05:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753620AbYGCG5c (ORCPT ); Thu, 3 Jul 2008 02:57:32 -0400 Received: from mga11.intel.com ([192.55.52.93]:23231 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753257AbYGCC0F (ORCPT ); Wed, 2 Jul 2008 22:26:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.27,741,1204531200"; d="scan'208";a="584545902" Subject: [RFC PATCH 4/4] x86_32: mark ACPI NVS memory region From: Zhang Rui To: linux-pm , linux-acpi , linux-kernel Cc: "Rafael J. Wysocki" , Len Brown Content-Type: text/plain Date: Thu, 03 Jul 2008 10:24:39 +0800 Message-Id: <1215051879.5628.36.camel@rzhang-dt.sh.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-4.fc8) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org x86_32: Mark ACPI NVS memory region. Signed-off-by: Zhang Rui --- arch/x86/kernel/e820_32.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) Index: linux-2.6/arch/x86/kernel/e820_32.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/e820_32.c 2008-07-01 09:32:27.000000000 +0800 +++ linux-2.6/arch/x86/kernel/e820_32.c 2008-07-03 09:00:37.000000000 +0800 @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include @@ -253,6 +255,30 @@ break; } } + +/* 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 void __init add_memory_region(unsigned long long start,