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