aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap/include/mach/sram.h
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-08-05 13:49:09 +0200
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-08-05 13:49:09 +0200
commit964d219b6a8a79ea4c8d77b6dcdcbbcda403c392 (patch)
treee83c41834dec8650362689573eb4e35619d4350f /arch/avr32/mach-at32ap/include/mach/sram.h
parentavr32: Move include/asm-avr32 to arch/avr32/include/asm (diff)
downloadlinux-dev-964d219b6a8a79ea4c8d77b6dcdcbbcda403c392.tar.xz
linux-dev-964d219b6a8a79ea4c8d77b6dcdcbbcda403c392.zip
avr32: Introduce arch/avr32/mach-*/include/mach
Add arch/avr32/mach-*/include to include search path and copy all the files from include/asm/arch there. The old files will be removed once ARM does the same change and all common drivers are converted. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Diffstat (limited to '')
-rw-r--r--arch/avr32/mach-at32ap/include/mach/sram.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/avr32/mach-at32ap/include/mach/sram.h b/arch/avr32/mach-at32ap/include/mach/sram.h
new file mode 100644
index 000000000000..4838dae7601a
--- /dev/null
+++ b/arch/avr32/mach-at32ap/include/mach/sram.h
@@ -0,0 +1,30 @@
+/*
+ * Simple SRAM allocator
+ *
+ * Copyright (C) 2008 Atmel Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __ASM_AVR32_ARCH_SRAM_H
+#define __ASM_AVR32_ARCH_SRAM_H
+
+#include <linux/genalloc.h>
+
+extern struct gen_pool *sram_pool;
+
+static inline unsigned long sram_alloc(size_t len)
+{
+ if (!sram_pool)
+ return 0UL;
+
+ return gen_pool_alloc(sram_pool, len);
+}
+
+static inline void sram_free(unsigned long addr, size_t len)
+{
+ return gen_pool_free(sram_pool, addr, len);
+}
+
+#endif /* __ASM_AVR32_ARCH_SRAM_H */