1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _LINUX_HUGETLB_CMA_H 3 #define _LINUX_HUGETLB_CMA_H 4 5 #ifdef CONFIG_CMA 6 void hugetlb_cma_free_folio(struct folio *folio); 7 struct folio *hugetlb_cma_alloc_folio(struct hstate *h, gfp_t gfp_mask, 8 int nid, nodemask_t *nodemask); 9 struct huge_bootmem_page *hugetlb_cma_alloc_bootmem(struct hstate *h, int *nid, 10 bool node_exact); 11 void hugetlb_cma_check(void); 12 bool hugetlb_cma_exclusive_alloc(void); 13 unsigned long hugetlb_cma_total_size(void); 14 void hugetlb_cma_validate_params(void); 15 bool hugetlb_early_cma(struct hstate *h); 16 #else 17 static inline void hugetlb_cma_free_folio(struct folio *folio) 18 { 19 } 20 21 static inline struct folio *hugetlb_cma_alloc_folio(struct hstate *h, 22 gfp_t gfp_mask, int nid, nodemask_t *nodemask) 23 { 24 return NULL; 25 } 26 27 static inline 28 struct huge_bootmem_page *hugetlb_cma_alloc_bootmem(struct hstate *h, int *nid, 29 bool node_exact) 30 { 31 return NULL; 32 } 33 34 static inline void hugetlb_cma_check(void) 35 { 36 } 37 38 static inline bool hugetlb_cma_exclusive_alloc(void) 39 { 40 return false; 41 } 42 43 static inline unsigned long hugetlb_cma_total_size(void) 44 { 45 return 0; 46 } 47 48 static inline void hugetlb_cma_validate_params(void) 49 { 50 } 51 52 static inline bool hugetlb_early_cma(struct hstate *h) 53 { 54 return false; 55 } 56 #endif 57 #endif 58