Aneesh Kumar K.V | fa61a4e3 | 2013-07-02 11:15:16 +0530 | [diff] [blame] | 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 | |
| 15 | #ifndef __POWERPC_KVM_CMA_ALLOC_H__ |
| 16 | #define __POWERPC_KVM_CMA_ALLOC_H__ |
Aneesh Kumar K.V | 990978e | 2013-07-02 11:15:18 +0530 | [diff] [blame] | 17 | /* |
| 18 | * Both RMA and Hash page allocation will be multiple of 256K. |
| 19 | */ |
| 20 | #define KVM_CMA_CHUNK_ORDER 18 |
| 21 | |
Aneesh Kumar K.V | fa61a4e3 | 2013-07-02 11:15:16 +0530 | [diff] [blame] | 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; |
| 27 | #endif |