cma.h 515 B

12345678910111213141516171819202122232425
  1. #ifndef __MM_CMA_H__
  2. #define __MM_CMA_H__
  3. struct cma {
  4. unsigned long base_pfn;
  5. unsigned long count;
  6. unsigned long *bitmap;
  7. unsigned int order_per_bit; /* Order of pages represented by one bit */
  8. struct mutex lock;
  9. #ifdef CONFIG_CMA_DEBUGFS
  10. struct hlist_head mem_head;
  11. spinlock_t mem_head_lock;
  12. #endif
  13. };
  14. extern struct cma cma_areas[MAX_CMA_AREAS];
  15. extern unsigned cma_area_count;
  16. static inline unsigned long cma_bitmap_maxno(struct cma *cma)
  17. {
  18. return cma->count >> cma->order_per_bit;
  19. }
  20. #endif