lkml.org 
[lkml]   [2012]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
Date
so could reduce one loop.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
arch/x86/mm/init.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 6663f61..e69f832 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -248,20 +248,27 @@ static void __init walk_ram_ranges(
void *data)
{
unsigned long start_pfn, end_pfn;
+ bool isa_done = false;
int i;

- /* the ISA range is always mapped regardless of memory holes */
- work_fn(0, ISA_END_ADDRESS, data);
-
for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, NULL) {
u64 start = start_pfn << PAGE_SHIFT;
u64 end = end_pfn << PAGE_SHIFT;

- if (end <= ISA_END_ADDRESS)
- continue;
+ if (!isa_done && start > ISA_END_ADDRESS) {
+ work_fn(0, ISA_END_ADDRESS, data);
+ isa_done = true;
+ } else {
+ if (end < ISA_END_ADDRESS)
+ continue;
+
+ if (start <= ISA_END_ADDRESS &&
+ end >= ISA_END_ADDRESS) {
+ start = 0;
+ isa_done = true;
+ }
+ }

- if (start < ISA_END_ADDRESS)
- start = ISA_END_ADDRESS;
#ifdef CONFIG_X86_32
/* on 32 bit, we only map up to max_low_pfn */
if ((start >> PAGE_SHIFT) >= max_low_pfn)
--
1.7.7


\
 
 \ /
  Last update: 2012-09-05 08:22    [W:0.252 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site