| .. | .. |
|---|
| 4 | 4 | |
|---|
| 5 | 5 | #include <linux/init.h> |
|---|
| 6 | 6 | #include <linux/types.h> |
|---|
| 7 | +#include <linux/numa.h> |
|---|
| 7 | 8 | |
|---|
| 8 | 9 | /* |
|---|
| 9 | 10 | * There is always at least global CMA area and a few optional |
|---|
| .. | .. |
|---|
| 17 | 18 | |
|---|
| 18 | 19 | #endif |
|---|
| 19 | 20 | |
|---|
| 21 | +#define CMA_MAX_NAME 64 |
|---|
| 22 | + |
|---|
| 20 | 23 | struct cma; |
|---|
| 24 | + |
|---|
| 25 | +struct cma_alloc_info { |
|---|
| 26 | + unsigned long nr_migrated; |
|---|
| 27 | + unsigned long nr_reclaimed; |
|---|
| 28 | + unsigned long nr_mapped; |
|---|
| 29 | + unsigned int nr_isolate_fail; |
|---|
| 30 | + unsigned int nr_migrate_fail; |
|---|
| 31 | + unsigned int nr_test_fail; |
|---|
| 32 | +}; |
|---|
| 21 | 33 | |
|---|
| 22 | 34 | extern unsigned long totalcma_pages; |
|---|
| 23 | 35 | extern phys_addr_t cma_get_base(const struct cma *cma); |
|---|
| 24 | 36 | extern unsigned long cma_get_size(const struct cma *cma); |
|---|
| 25 | 37 | extern const char *cma_get_name(const struct cma *cma); |
|---|
| 26 | 38 | |
|---|
| 27 | | -extern int __init cma_declare_contiguous(phys_addr_t base, |
|---|
| 39 | +extern int __init cma_declare_contiguous_nid(phys_addr_t base, |
|---|
| 28 | 40 | phys_addr_t size, phys_addr_t limit, |
|---|
| 29 | 41 | phys_addr_t alignment, unsigned int order_per_bit, |
|---|
| 30 | | - bool fixed, const char *name, struct cma **res_cma); |
|---|
| 42 | + bool fixed, const char *name, struct cma **res_cma, |
|---|
| 43 | + int nid); |
|---|
| 44 | +static inline int __init cma_declare_contiguous(phys_addr_t base, |
|---|
| 45 | + phys_addr_t size, phys_addr_t limit, |
|---|
| 46 | + phys_addr_t alignment, unsigned int order_per_bit, |
|---|
| 47 | + bool fixed, const char *name, struct cma **res_cma) |
|---|
| 48 | +{ |
|---|
| 49 | + return cma_declare_contiguous_nid(base, size, limit, alignment, |
|---|
| 50 | + order_per_bit, fixed, name, res_cma, NUMA_NO_NODE); |
|---|
| 51 | +} |
|---|
| 31 | 52 | extern int cma_init_reserved_mem(phys_addr_t base, phys_addr_t size, |
|---|
| 32 | 53 | unsigned int order_per_bit, |
|---|
| 33 | 54 | const char *name, |
|---|
| 34 | 55 | struct cma **res_cma); |
|---|
| 35 | 56 | extern struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, |
|---|
| 36 | | - bool no_warn); |
|---|
| 57 | + gfp_t gfp_mask); |
|---|
| 37 | 58 | extern bool cma_release(struct cma *cma, const struct page *pages, unsigned int count); |
|---|
| 59 | +#ifdef CONFIG_NO_GKI |
|---|
| 38 | 60 | extern unsigned long cma_used_pages(void); |
|---|
| 39 | | - |
|---|
| 61 | +#endif |
|---|
| 40 | 62 | extern int cma_for_each_area(int (*it)(struct cma *cma, void *data), void *data); |
|---|
| 41 | | - |
|---|
| 42 | | -extern void set_cma_area_inactive(struct cma *cma); |
|---|
| 43 | | - |
|---|
| 44 | 63 | #endif |
|---|