All of lore.kernel.org
 help / color / mirror / Atom feed
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 2/7] Common code for the physmem map
Date: Thu, 24 Mar 2005 11:23:46 +0530	[thread overview]
Message-ID: <424255EA.9010905@in.ibm.com> (raw)
In-Reply-To: <42425582.7040508@in.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: physmem-common.patch --]
[-- Type: text/plain, Size: 2099 bytes --]


---
This patch provides the arch independent code to create the
physmem view in the proc file system. /proc/physmem
reflects the entire RAM resources that present in the system.
Even if the system has been booted with mem= or memmap= options,
this view will reflect the complete physical memory map.

---

Signed-off-by: Hariprasad Nellitheertha <hari@in.ibm.com>
---

 linux-2.6.12-rc1-hari/kernel/resource.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+)

diff -puN kernel/resource.c~physmem-common kernel/resource.c
--- linux-2.6.12-rc1/kernel/resource.c~physmem-common	2005-03-23 17:48:02.000000000 +0530
+++ linux-2.6.12-rc1-hari/kernel/resource.c	2005-03-23 17:48:02.000000000 +0530
@@ -39,6 +39,15 @@ struct resource iomem_resource = {
 
 EXPORT_SYMBOL(iomem_resource);
 
+struct resource physmem_resource = {
+	.name	= "Phys mem",
+	.start	= 0ULL,
+	.end	= ~0ULL,
+	.flags	= IORESOURCE_MEM,
+};
+
+EXPORT_SYMBOL(physmem_resource);
+
 static DEFINE_RWLOCK(resource_lock);
 
 #ifdef CONFIG_PROC_FS
@@ -118,6 +127,16 @@ static int iomem_open(struct inode *inod
 	return res;
 }
 
+static int physmem_open(struct inode *inode, struct file *file)
+{
+	int res = seq_open(file, &resource_op);
+	if (!res) {
+		struct seq_file *m = file->private_data;
+		m->private = &physmem_resource;
+	}
+	return res;
+}
+
 static struct file_operations proc_ioports_operations = {
 	.open		= ioports_open,
 	.read		= seq_read,
@@ -132,6 +151,13 @@ static struct file_operations proc_iomem
 	.release	= seq_release,
 };
 
+static struct file_operations proc_physmem_operations = {
+	.open		= physmem_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
+};
+
 static int __init ioresources_init(void)
 {
 	struct proc_dir_entry *entry;
@@ -142,6 +168,9 @@ static int __init ioresources_init(void)
 	entry = create_proc_entry("iomem", 0, NULL);
 	if (entry)
 		entry->proc_fops = &proc_iomem_operations;
+	entry = create_proc_entry("physmem", 0, NULL);
+	if (entry)
+		entry->proc_fops = &proc_physmem_operations;
 	return 0;
 }
 __initcall(ioresources_init);
_

  reply	other threads:[~2005-03-24  5:55 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   ` Hariprasad Nellitheertha [this message]
2005-03-24  5:55     ` [RFC][PATCH 3/7] i386 code for the physmem map Hariprasad Nellitheertha
2005-03-24  5:56       ` [RFC][PATCH 4/7] x86_64 " Hariprasad Nellitheertha
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=424255EA.9010905@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.