From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: ralf@linux-mips.org
Cc: linux-mips@linux-mips.org, Franck Bui-Huu <fbuihuu@gmail.com>
Subject: [PATCH 1/3] paging_init(): use highend_pfn/highstart_pfn
Date: Wed, 6 Dec 2006 16:48:28 +0100 [thread overview]
Message-ID: <11654201101028-git-send-email-fbuihuu@gmail.com> (raw)
In-Reply-To: <1165420110699-git-send-email-fbuihuu@gmail.com>
From: Franck Bui-Huu <fbuihuu@gmail.com>
This patch makes paging_init() use highend_pfn/highstart_pfn globals.
It removes the need of 'high' local which was needed only by
HIGHMEM config.
More important perhaps, it fixes a bug when HIGHMEM is set
but there's actually no physical highmem (highend_pfn = 0)
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
arch/mips/mm/init.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 1db991d..30245c0 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -341,7 +341,7 @@ static int __init page_is_ram(unsigned l
void __init paging_init(void)
{
unsigned long zones_size[MAX_NR_ZONES] = { 0, };
- unsigned long max_dma, high, low;
+ unsigned long max_dma, low;
#ifndef CONFIG_FLATMEM
unsigned long zholes_size[MAX_NR_ZONES] = { 0, };
unsigned long i, j, pfn;
@@ -356,7 +356,6 @@ void __init paging_init(void)
max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
low = max_low_pfn;
- high = highend_pfn;
#ifdef CONFIG_ISA
if (low < max_dma)
@@ -369,13 +368,13 @@ void __init paging_init(void)
zones_size[ZONE_DMA] = low;
#endif
#ifdef CONFIG_HIGHMEM
- if (cpu_has_dc_aliases) {
- printk(KERN_WARNING "This processor doesn't support highmem.");
- if (high - low)
- printk(" %ldk highmem ignored", high - low);
- printk("\n");
- } else
- zones_size[ZONE_HIGHMEM] = high - low;
+ zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn;
+
+ if (cpu_has_dc_aliases && zones_size[ZONE_HIGHMEM]) {
+ printk(KERN_WARNING "This processor doesn't support highmem."
+ " %ldk highmem ignored\n", zones_size[ZONE_HIGHMEM]);
+ zones_size[ZONE_HIGHMEM] = 0;
+ }
#endif
#ifdef CONFIG_FLATMEM
--
1.4.4.1
next prev parent reply other threads:[~2006-12-06 15:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-06 15:48 [RFC] FLATMEM: allow memory to start at pfn != 0 Franck Bui-Huu
2006-12-06 15:48 ` Franck Bui-Huu [this message]
2006-12-06 15:48 ` [PATCH 2/3] Setup min_low_pfn/max_low_pfn correctly Franck Bui-Huu
2006-12-11 18:16 ` Ralf Baechle
2006-12-12 9:14 ` Franck Bui-Huu
2006-12-06 15:48 ` [PATCH 3/3] FLATMEM: allow memory to start at pfn != 0 Franck Bui-Huu
2006-12-11 18:46 ` [RFC] " Ralf Baechle
2006-12-12 8:55 ` Franck Bui-Huu
2006-12-16 11:17 ` Franck Bui-Huu
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=11654201101028-git-send-email-fbuihuu@gmail.com \
--to=vagabon.xyz@gmail.com \
--cc=fbuihuu@gmail.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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