diff options
author | Krishna Reddy <vdumpa@nvidia.com> | 2012-01-10 16:33:33 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 01:36:00 -0700 |
commit | 015f410e3252be38f6a01a8644f3835756debbc8 (patch) | |
tree | 9e5bf0cfb508b9c8e8e76a3384c3503997a1e230 /include | |
parent | ca0b08bd6d222955ea8f4e69aec8e18f18a02402 (diff) |
lib: genalloc: Add API to allocate at specified addr.
Add API to allocate at specified alloc address.
Change-Id: I188e5430220c050026c6a3e17a586012d9a9fa04
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/74468
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Rebase-Id: R93cbd801fbaea15cd4b0b579826b659d220618d7
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/genalloc.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 661d374aeb2d..98bead69d488 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h @@ -93,7 +93,17 @@ static inline int gen_pool_add(struct gen_pool *pool, unsigned long addr, return gen_pool_add_virt(pool, addr, -1, size, nid); } extern void gen_pool_destroy(struct gen_pool *); -extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); +extern unsigned long gen_pool_alloc_addr(struct gen_pool *, + size_t, unsigned long); +/** + * gen_pool_alloc - allocate special memory from the pool + * @pool: pool to allocate from + * @size: number of bytes to allocate from the pool + */ +static inline unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size) +{ + return gen_pool_alloc_addr(pool, size); +} extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); extern void gen_pool_for_each_chunk(struct gen_pool *, void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *); |