From: Ed Swarthout <Ed.Swarthout@freescale.com>
To: galak@kernel.crashing.org, linuxppc-dev@ozlabs.org
Cc: Ed Swarthout <Ed.Swarthout@freescale.com>
Subject: [PATCH] powerpc mm init_32 gdb regions
Date: Wed, 19 Sep 2007 00:09:36 -0500 [thread overview]
Message-ID: <11901785761816-git-send-email-Ed.Swarthout@freescale.com> (raw)
Add memory regions to the kcore list for 32-bit machines.
Since the entries are only 32-bit, keep under 4G.
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
---
Adapted from init_64.c
arch/powerpc/mm/init_32.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index d65995a..d804c65 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -255,3 +255,37 @@ void free_initrd_mem(unsigned long start, unsigned long end)
}
}
#endif
+
+static struct kcore_list kcore_vmem;
+
+static int __init setup_kcore(void)
+{
+ int i;
+
+ for (i=0; i < lmb.memory.cnt; i++) {
+ unsigned long base, size;
+ struct kcore_list *kcore_mem;
+
+ base = lmb.memory.region[i].base;
+ size = lmb.memory.region[i].size;
+
+ kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
+ if (!kcore_mem)
+ panic("%s: kmalloc failed\n", __FUNCTION__);
+
+ /* must stay under 32 bits */
+ if ( 0xfffffffful - (unsigned long)__va(base) < size) {
+ size = 0xfffffffful - (unsigned long)(__va(base));
+ printk(KERN_DEBUG "setup_kcore: restrict size=%lx\n",
+ size);
+ }
+
+ kclist_add(kcore_mem, __va(base), size);
+ }
+
+ kclist_add(&kcore_vmem, (void *)VMALLOC_START,
+ VMALLOC_END-VMALLOC_START);
+
+ return 0;
+}
+module_init(setup_kcore);
--
1.5.3.rc6.63.gf7c18
next reply other threads:[~2007-09-19 5:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-19 5:09 Ed Swarthout [this message]
2007-09-19 20:31 ` [PATCH] powerpc mm init_32 gdb regions Kumar Gala
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=11901785761816-git-send-email-Ed.Swarthout@freescale.com \
--to=ed.swarthout@freescale.com \
--cc=galak@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).