home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / src / linux-headers-2.6.28-15 / arch / avr32 / mach-at32ap / include / mach / sram.h < prev   
Encoding:
C/C++ Source or Header  |  2008-12-24  |  671 b   |  31 lines

  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.  
  13. #include <linux/genalloc.h>
  14.  
  15. extern struct gen_pool *sram_pool;
  16.  
  17. static inline unsigned long sram_alloc(size_t len)
  18. {
  19.     if (!sram_pool)
  20.         return 0UL;
  21.  
  22.     return gen_pool_alloc(sram_pool, len);
  23. }
  24.  
  25. static inline void sram_free(unsigned long addr, size_t len)
  26. {
  27.     return gen_pool_free(sram_pool, addr, len);
  28. }
  29.  
  30. #endif /* __ASM_AVR32_ARCH_SRAM_H */
  31.