2 * drivers/video/tegra/nvmap_heap.h
6 * Copyright (c) 2010, NVIDIA Corporation.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef __NVMAP_HEAP_H
24 #define __NVMAP_HEAP_H
28 struct attribute_group;
30 struct nvmap_heap_block {
35 #define NVMAP_HEAP_MIN_BUDDY_SIZE 8192
37 struct nvmap_heap *nvmap_heap_create(struct device *parent, const char *name,
38 unsigned long base, size_t len,
39 unsigned int buddy_size, void *arg);
41 void nvmap_heap_destroy(struct nvmap_heap *heap);
43 void *nvmap_heap_device_to_arg(struct device *dev);
45 void *nvmap_heap_to_arg(struct nvmap_heap *heap);
47 struct nvmap_heap_block *nvmap_heap_alloc(struct nvmap_heap *heap, size_t len,
48 size_t align, unsigned int prot);
50 struct nvmap_heap *nvmap_block_to_heap(struct nvmap_heap_block *b);
52 void nvmap_heap_free(struct nvmap_heap_block *block);
54 int nvmap_heap_create_group(struct nvmap_heap *heap,
55 const struct attribute_group *grp);
57 void nvmap_heap_remove_group(struct nvmap_heap *heap,
58 const struct attribute_group *grp);
60 int __init nvmap_heap_init(void);
62 void nvmap_heap_deinit(void);