Lines Matching full:cma
3 * CMA ProcFS Interface
8 #include <linux/cma.h>
14 #include "../../../mm/cma.h"
30 static void cma_procfs_show_bitmap(struct seq_file *s, struct cma *cma) in cma_procfs_show_bitmap() argument
32 int elements = DIV_ROUND_UP(cma_bitmap_maxno(cma), BITS_PER_BYTE * sizeof(u32)); in cma_procfs_show_bitmap()
34 u32 *array = (u32 *)cma->bitmap; in cma_procfs_show_bitmap()
48 static u64 cma_procfs_used_get(struct cma *cma) in cma_procfs_used_get() argument
52 mutex_lock(&cma->lock); in cma_procfs_used_get()
53 used = bitmap_weight(cma->bitmap, (int)cma_bitmap_maxno(cma)); in cma_procfs_used_get()
54 mutex_unlock(&cma->lock); in cma_procfs_used_get()
56 return (u64)used << cma->order_per_bit; in cma_procfs_used_get()
61 struct cma *cma = s->private; in cma_procfs_show() local
62 u64 used = cma_procfs_used_get(cma); in cma_procfs_show()
64 seq_printf(s, "Total: %lu KiB\n", cma->count << (PAGE_SHIFT - 10)); in cma_procfs_show()
67 cma_procfs_show_bitmap(s, cma); in cma_procfs_show()
72 static int cma_procfs_add_one(struct cma *cma, void *data) in cma_procfs_add_one() argument
76 proc_create_single_data(cma->name, 0, root, cma_procfs_show, cma); in cma_procfs_add_one()
91 MODULE_DESCRIPTION("ROCKCHIP CMA PROCFS Driver");
92 MODULE_ALIAS("platform:rk-cma");