dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/arch/sh/include/asm/sram.h

39 lines
631 B
C

#ifndef __ASM_SRAM_H
#define __ASM_SRAM_H
#ifdef CONFIG_HAVE_SRAM_POOL
#include <linux/spinlock.h>
#include <linux/genalloc.h>
/* arch/sh/mm/sram.c */
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);
}
#else
static inline unsigned long sram_alloc(size_t len)
{
return 0;
}
static inline void sram_free(unsigned long addr, size_t len)
{
}
#endif /* CONFIG_HAVE_SRAM_POOL */
#endif /* __ASM_SRAM_H */