hugetlb_cma.h 1.2 KB

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