diff options
author | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2008-03-05 04:00:28 -0500 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-07-02 05:05:01 -0400 |
commit | b83d6ee17588f1a4fbfc8ef0451b0900a5ef5950 (patch) | |
tree | bde2ffd7f1ad14d8a6f15300a8e0d7b36224bbc9 /include/asm-avr32 | |
parent | 7951f188a0b7f9b2f181c692efb0d31082bec346 (diff) |
avr32: Add simple SRAM allocator
Add SRAM allocator for avr32, which is just a thin wrapper around
genalloc.
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'include/asm-avr32')
-rw-r--r-- | include/asm-avr32/arch-at32ap/sram.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/asm-avr32/arch-at32ap/sram.h b/include/asm-avr32/arch-at32ap/sram.h new file mode 100644 index 000000000000..4838dae7601a --- /dev/null +++ b/include/asm-avr32/arch-at32ap/sram.h | |||
@@ -0,0 +1,30 @@ | |||
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 */ | ||