2 * Contiguous Memory Allocator for ppc KVM hash pagetable based on CMA
3 * for DMA mapping framework
5 * Copyright IBM Corporation, 2013
6 * Author Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
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.
15 #ifndef __POWERPC_KVM_CMA_ALLOC_H__
16 #define __POWERPC_KVM_CMA_ALLOC_H__
18 * Both RMA and Hash page allocation will be multiple of 256K.
20 #define KVM_CMA_CHUNK_ORDER 18
22 extern struct page
*kvm_alloc_cma(unsigned long nr_pages
,
23 unsigned long align_pages
);
24 extern bool kvm_release_cma(struct page
*pages
, unsigned long nr_pages
);
25 extern long kvm_cma_declare_contiguous(phys_addr_t size
,
26 phys_addr_t alignment
) __init
;