diff options
Diffstat (limited to 'arch/sparc64/mm/init.c')
-rw-r--r-- | arch/sparc64/mm/init.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 9d2b0da590af..513993414747 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -1396,7 +1396,7 @@ static void __init taint_real_pages(void) | |||
1396 | while (old_start < old_end) { | 1396 | while (old_start < old_end) { |
1397 | int n; | 1397 | int n; |
1398 | 1398 | ||
1399 | for (n = 0; pavail_rescan_ents; n++) { | 1399 | for (n = 0; n < pavail_rescan_ents; n++) { |
1400 | unsigned long new_start, new_end; | 1400 | unsigned long new_start, new_end; |
1401 | 1401 | ||
1402 | new_start = pavail_rescan[n].phys_addr; | 1402 | new_start = pavail_rescan[n].phys_addr; |
@@ -1418,6 +1418,32 @@ static void __init taint_real_pages(void) | |||
1418 | } | 1418 | } |
1419 | } | 1419 | } |
1420 | 1420 | ||
1421 | int __init page_in_phys_avail(unsigned long paddr) | ||
1422 | { | ||
1423 | int i; | ||
1424 | |||
1425 | paddr &= PAGE_MASK; | ||
1426 | |||
1427 | for (i = 0; i < pavail_rescan_ents; i++) { | ||
1428 | unsigned long start, end; | ||
1429 | |||
1430 | start = pavail_rescan[i].phys_addr; | ||
1431 | end = start + pavail_rescan[i].reg_size; | ||
1432 | |||
1433 | if (paddr >= start && paddr < end) | ||
1434 | return 1; | ||
1435 | } | ||
1436 | if (paddr >= kern_base && paddr < (kern_base + kern_size)) | ||
1437 | return 1; | ||
1438 | #ifdef CONFIG_BLK_DEV_INITRD | ||
1439 | if (paddr >= __pa(initrd_start) && | ||
1440 | paddr < __pa(PAGE_ALIGN(initrd_end))) | ||
1441 | return 1; | ||
1442 | #endif | ||
1443 | |||
1444 | return 0; | ||
1445 | } | ||
1446 | |||
1421 | void __init mem_init(void) | 1447 | void __init mem_init(void) |
1422 | { | 1448 | { |
1423 | unsigned long codepages, datapages, initpages; | 1449 | unsigned long codepages, datapages, initpages; |