From: Hariprasad Nellitheertha <hari@in.ibm.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
fastboot <fastboot@lists.osdl.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [RFC][PATCH 4/7] x86_64 code for the physmem map
Date: Thu, 24 Mar 2005 11:26:10 +0530 [thread overview]
Message-ID: <4242567A.5060104@in.ibm.com> (raw)
In-Reply-To: <42425635.30808@in.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 14 bytes --]
Regards, Hari
[-- Attachment #2: physmem-x8664.patch --]
[-- Type: text/plain, Size: 2638 bytes --]
---
This patch contains the x86_64 specific code to generate
the /proc/physmem view.
---
Signed-off-by: Hariprasad Nellitheertha <hari@in.ibm.com>
---
linux-2.6.12-rc1-hari/arch/x86_64/kernel/e820.c | 55 +++++++++++++++++-------
1 files changed, 39 insertions(+), 16 deletions(-)
diff -puN arch/x86_64/kernel/e820.c~physmem-x8664 arch/x86_64/kernel/e820.c
--- linux-2.6.12-rc1/arch/x86_64/kernel/e820.c~physmem-x8664 2005-03-23 17:48:09.000000000 +0530
+++ linux-2.6.12-rc1-hari/arch/x86_64/kernel/e820.c 2005-03-23 17:48:09.000000000 +0530
@@ -178,25 +178,30 @@ unsigned long __init e820_end_of_ram(voi
return end_pfn;
}
-/*
- * Mark e820 reserved areas as busy for the resource manager.
- */
-void __init e820_reserve_resources(void)
+static struct resource * __init alloc_e820_resource(struct resource *resource, int i)
+{
+ struct resource *res;
+
+ res = alloc_bootmem_low(sizeof(struct resource));
+ switch (e820.map[i].type) {
+ case E820_RAM: res->name = "System RAM"; break;
+ case E820_ACPI: res->name = "ACPI Tables"; break;
+ case E820_NVS: res->name = "ACPI Non-volatile Storage"; break;
+ default: res->name = "reserved";
+ }
+ res->start = e820.map[i].addr;
+ res->end = res->start + e820.map[i].size - 1;
+ res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+ request_resource(resource, res);
+ return res;
+}
+
+static void __init e820_reserve_iomem_resources(void)
{
int i;
+ struct resource *res;
for (i = 0; i < e820.nr_map; i++) {
- struct resource *res;
- res = alloc_bootmem_low(sizeof(struct resource));
- switch (e820.map[i].type) {
- case E820_RAM: res->name = "System RAM"; break;
- case E820_ACPI: res->name = "ACPI Tables"; break;
- case E820_NVS: res->name = "ACPI Non-volatile Storage"; break;
- default: res->name = "reserved";
- }
- res->start = e820.map[i].addr;
- res->end = res->start + e820.map[i].size - 1;
- res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
- request_resource(&iomem_resource, res);
+ res = alloc_e820_resource(&iomem_resource, i);
if (e820.map[i].type == E820_RAM) {
/*
* We don't know which RAM region contains kernel data,
@@ -212,6 +217,24 @@ void __init e820_reserve_resources(void)
}
}
+static void __init e820_reserve_physmem_resources(void)
+{
+ int i;
+ struct resource *res;
+ for (i = 0; i < e820.nr_map; i++) {
+ res = alloc_e820_resource(&physmem_resource, i);
+ }
+}
+
+/*
+ * Mark e820 reserved areas as busy for the resource manager.
+ */
+void __init e820_reserve_resources(void)
+{
+ e820_reserve_iomem_resources();
+ e820_reserve_physmem_resources();
+}
+
/*
* Add a memory region to the kernel e820 map.
*/
_
next prev parent reply other threads:[~2005-03-24 5:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-24 5:49 [RFC] Obtaining memory information for kexec/kdump Hariprasad Nellitheertha
2005-03-24 5:52 ` [RFC][PATCH 1/7] Converting resource struct fields to 64 bit Hariprasad Nellitheertha
2005-03-24 5:53 ` [RFC][PATCH 2/7] Common code for the physmem map Hariprasad Nellitheertha
2005-03-24 5:55 ` [RFC][PATCH 3/7] i386 " Hariprasad Nellitheertha
2005-03-24 5:56 ` Hariprasad Nellitheertha [this message]
2005-03-24 5:57 ` [RFC][PATCH 5/7] Common code for the activemem map Hariprasad Nellitheertha
2005-03-24 5:58 ` [RFC][PATCH 6/7] i386 " Hariprasad Nellitheertha
2005-03-24 6:00 ` [RFC][PATCH 7/7] x86_64 " Hariprasad Nellitheertha
2005-03-24 7:50 ` [RFC] Obtaining memory information for kexec/kdump Dave Hansen
2005-03-24 10:19 ` Hariprasad Nellitheertha
2005-03-24 15:32 ` Dave Hansen
2005-03-28 13:00 ` Hariprasad Nellitheertha
2005-03-28 16:18 ` Dave Hansen
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=4242567A.5060104@in.ibm.com \
--to=hari@in.ibm.com \
--cc=akpm@osdl.org \
--cc=ebiederm@xmission.com \
--cc=fastboot@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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