From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: use memblock memory regions for "System RAM" I/O resources
Date: Wed, 12 Jan 2011 23:52:23 +0000 [thread overview]
Message-ID: <20110112235223.GM11039@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1294874560-16542-1-git-send-email-dima@android.com>
On Wed, Jan 12, 2011 at 03:22:40PM -0800, Dima Zavin wrote:
> @@ -518,8 +518,9 @@ setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
> }
>
> static void __init
> -request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
> +request_standard_resources(struct machine_desc *mdesc)
Almost there. This line can now be combined with the preceding line
without wrapping over the 80 column limit.
> {
> + struct memblock_type *mem = &memblock.memory;
> struct resource *res;
> int i;
>
> @@ -528,14 +529,11 @@ request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
> kernel_data.start = virt_to_phys(_sdata);
> kernel_data.end = virt_to_phys(_end - 1);
>
> - for (i = 0; i < mi->nr_banks; i++) {
> - if (mi->bank[i].size == 0)
> - continue;
> -
> + for (i = 0; i < mem->cnt; i++) {
Hmm, probably shouldn't rely on that - we should be using the accessors
which memblock people have provided for us.
for_each_memblock(memory, mem) {
> res = alloc_bootmem_low(sizeof(*res));
> res->name = "System RAM";
> - res->start = mi->bank[i].start;
> - res->end = mi->bank[i].start + mi->bank[i].size - 1;
> + res->start = mem->regions[i].base;
> + res->end = mem->regions[i].base + mem->regions[i].size - 1;
res->start = __pfn_to_phys(memblock_region_memory_base_pfn(mem));
res->end = __pfn_to_phys(memblock_region_memory_end_pfn(mem)) - 1;
And I'd say ignore the 80-column limit on that because of the excessively
long memblock function names.
next prev parent reply other threads:[~2011-01-12 23:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-12 22:35 [PATCH] ARM: use memblock memory regions for "System RAM" I/O resources Dima Zavin
2011-01-12 23:11 ` Russell King - ARM Linux
2011-01-12 23:17 ` Dima Zavin
2011-01-12 23:22 ` Dima Zavin
2011-01-12 23:52 ` Russell King - ARM Linux [this message]
2011-01-13 0:08 ` Dima Zavin
2011-01-13 0:10 ` Dima Zavin
2011-01-14 9:11 ` Russell King - ARM Linux
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=20110112235223.GM11039@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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).