book3s_hv_cma.h 927 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Contiguous Memory Allocator for ppc KVM hash pagetable based on CMA
  3. * for DMA mapping framework
  4. *
  5. * Copyright IBM Corporation, 2013
  6. * Author Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of the
  11. * License or (at your optional) any later version of the license.
  12. *
  13. */
  14. #ifndef __POWERPC_KVM_CMA_ALLOC_H__
  15. #define __POWERPC_KVM_CMA_ALLOC_H__
  16. /*
  17. * Both RMA and Hash page allocation will be multiple of 256K.
  18. */
  19. #define KVM_CMA_CHUNK_ORDER 18
  20. extern struct page *kvm_alloc_cma(unsigned long nr_pages,
  21. unsigned long align_pages);
  22. extern bool kvm_release_cma(struct page *pages, unsigned long nr_pages);
  23. extern long kvm_cma_declare_contiguous(phys_addr_t size,
  24. phys_addr_t alignment) __init;
  25. #endif