sram.h 671 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Simple SRAM allocator
  3. *
  4. * Copyright (C) 2008 Atmel Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_AVR32_ARCH_SRAM_H
  11. #define __ASM_AVR32_ARCH_SRAM_H
  12. #include <linux/genalloc.h>
  13. extern struct gen_pool *sram_pool;
  14. static inline unsigned long sram_alloc(size_t len)
  15. {
  16. if (!sram_pool)
  17. return 0UL;
  18. return gen_pool_alloc(sram_pool, len);
  19. }
  20. static inline void sram_free(unsigned long addr, size_t len)
  21. {
  22. return gen_pool_free(sram_pool, addr, len);
  23. }
  24. #endif /* __ASM_AVR32_ARCH_SRAM_H */