-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SRAM allocator for avr32, which is just a thin wrapper around genalloc. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
- Loading branch information
Haavard Skinnemoen
authored and
Haavard Skinnemoen
committed
Jul 2, 2008
1 parent
7951f18
commit b83d6ee
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 */ |