xvmalloc.h 774 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * xvmalloc memory allocator
  3. *
  4. * Copyright (C) 2008, 2009, 2010 Nitin Gupta
  5. *
  6. * This code is released using a dual license strategy: BSD/GPL
  7. * You can choose the licence that better fits your requirements.
  8. *
  9. * Released under the terms of 3-clause BSD License
  10. * Released under the terms of GNU General Public License Version 2.0
  11. */
  12. #ifndef _XV_MALLOC_H_
  13. #define _XV_MALLOC_H_
  14. #include <linux/types.h>
  15. struct xv_pool;
  16. struct xv_pool *xv_create_pool(void);
  17. void xv_destroy_pool(struct xv_pool *pool);
  18. int xv_malloc(struct xv_pool *pool, u32 size, struct page **page,
  19. u32 *offset, gfp_t flags);
  20. void xv_free(struct xv_pool *pool, struct page *page, u32 offset);
  21. u32 xv_get_object_size(void *obj);
  22. u64 xv_get_total_size_bytes(struct xv_pool *pool);
  23. #endif