aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/mm/init.c2
-rw-r--r--arch/score/mm/init.c2
-rw-r--r--include/linux/ioport.h2
-rw-r--r--kernel/resource.c13
4 files changed, 17 insertions, 2 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 15aa1902a788..4d72aabe8352 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -294,7 +294,7 @@ void __init fixrange_init(unsigned long start, unsigned long end,
294} 294}
295 295
296#ifndef CONFIG_NEED_MULTIPLE_NODES 296#ifndef CONFIG_NEED_MULTIPLE_NODES
297static int __init page_is_ram(unsigned long pagenr) 297int page_is_ram(unsigned long pagenr)
298{ 298{
299 int i; 299 int i;
300 300
diff --git a/arch/score/mm/init.c b/arch/score/mm/init.c
index 4e3dcd0c4716..f684a590c21d 100644
--- a/arch/score/mm/init.c
+++ b/arch/score/mm/init.c
@@ -59,7 +59,7 @@ static unsigned long setup_zero_page(void)
59} 59}
60 60
61#ifndef CONFIG_NEED_MULTIPLE_NODES 61#ifndef CONFIG_NEED_MULTIPLE_NODES
62static int __init page_is_ram(unsigned long pagenr) 62int page_is_ram(unsigned long pagenr)
63{ 63{
64 if (pagenr >= min_low_pfn && pagenr < max_low_pfn) 64 if (pagenr >= min_low_pfn && pagenr < max_low_pfn)
65 return 1; 65 return 1;
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 83aa81297ea3..11ef7952b63a 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -188,5 +188,7 @@ extern int
188walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, 188walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
189 void *arg, int (*func)(unsigned long, unsigned long, void *)); 189 void *arg, int (*func)(unsigned long, unsigned long, void *));
190 190
191extern int page_is_ram(unsigned long pfn);
192
191#endif /* __ASSEMBLY__ */ 193#endif /* __ASSEMBLY__ */
192#endif /* _LINUX_IOPORT_H */ 194#endif /* _LINUX_IOPORT_H */
diff --git a/kernel/resource.c b/kernel/resource.c
index fb11a58b9594..b4d637a55256 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -297,6 +297,19 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
297 297
298#endif 298#endif
299 299
300static int __is_ram(unsigned long pfn, unsigned long nr_pages, void *arg)
301{
302 return 1;
303}
304/*
305 * This generic page_is_ram() returns true if specified address is
306 * registered as "System RAM" in iomem_resource list.
307 */
308int __attribute__((weak)) page_is_ram(unsigned long pfn)
309{
310 return walk_system_ram_range(pfn, 1, NULL, __is_ram) == 1;
311}
312
300/* 313/*
301 * Find empty slot in the resource tree given range and alignment. 314 * Find empty slot in the resource tree given range and alignment.
302 */ 315 */