diff options
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 5b337cf8fb86..b65166de1d9d 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -412,6 +412,16 @@ static inline spinlock_t *huge_pte_lockptr(struct hstate *h, | |||
412 | return &mm->page_table_lock; | 412 | return &mm->page_table_lock; |
413 | } | 413 | } |
414 | 414 | ||
415 | static inline bool hugepages_supported(void) | ||
416 | { | ||
417 | /* | ||
418 | * Some platform decide whether they support huge pages at boot | ||
419 | * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when | ||
420 | * there is no such support | ||
421 | */ | ||
422 | return HPAGE_SHIFT != 0; | ||
423 | } | ||
424 | |||
415 | #else /* CONFIG_HUGETLB_PAGE */ | 425 | #else /* CONFIG_HUGETLB_PAGE */ |
416 | struct hstate {}; | 426 | struct hstate {}; |
417 | #define alloc_huge_page_node(h, nid) NULL | 427 | #define alloc_huge_page_node(h, nid) NULL |