aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmzone.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r--include/linux/mmzone.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 4e5627379b09..f21e5951038b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -771,12 +771,17 @@ static inline struct page *__section_mem_map_addr(struct mem_section *section)
771 return (struct page *)map; 771 return (struct page *)map;
772} 772}
773 773
774static inline int valid_section(struct mem_section *section) 774static inline int present_section(struct mem_section *section)
775{ 775{
776 return (section && (section->section_mem_map & SECTION_MARKED_PRESENT)); 776 return (section && (section->section_mem_map & SECTION_MARKED_PRESENT));
777} 777}
778 778
779static inline int section_has_mem_map(struct mem_section *section) 779static inline int present_section_nr(unsigned long nr)
780{
781 return present_section(__nr_to_section(nr));
782}
783
784static inline int valid_section(struct mem_section *section)
780{ 785{
781 return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP)); 786 return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP));
782} 787}
@@ -798,6 +803,13 @@ static inline int pfn_valid(unsigned long pfn)
798 return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); 803 return valid_section(__nr_to_section(pfn_to_section_nr(pfn)));
799} 804}
800 805
806static inline int pfn_present(unsigned long pfn)
807{
808 if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
809 return 0;
810 return present_section(__nr_to_section(pfn_to_section_nr(pfn)));
811}
812
801/* 813/*
802 * These are _only_ used during initialisation, therefore they 814 * These are _only_ used during initialisation, therefore they
803 * can use __initdata ... They could have names to indicate 815 * can use __initdata ... They could have names to indicate