Blackfin arch: introducing bfin_addr_dcachable

This patch introduces bfin_addr_dcachable() predicate, that simply tests is
address in cachable region or not.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
This commit is contained in:
Vitja Makarov 2008-10-13 15:23:56 +08:00 committed by Bryan Wu
parent 3094c981f2
commit 58c35bd31f
2 changed files with 15 additions and 0 deletions

View File

@ -92,4 +92,18 @@ extern unsigned long reserved_mem_icache_on;
extern void generate_cplb_tables(void); extern void generate_cplb_tables(void);
static inline int bfin_addr_dcachable(unsigned long addr)
{
#ifdef CONFIG_BFIN_DCACHE
if (addr < (_ramend - DMA_UNCACHED_REGION))
return 1;
#endif
if (reserved_mem_dcache_on &&
addr >= _ramend && addr < physical_mem_end)
return 1;
return 0;
}
#endif #endif

View File

@ -42,6 +42,7 @@ EXPORT_SYMBOL(memory_start);
EXPORT_SYMBOL(memory_end); EXPORT_SYMBOL(memory_end);
EXPORT_SYMBOL(physical_mem_end); EXPORT_SYMBOL(physical_mem_end);
EXPORT_SYMBOL(_ramend); EXPORT_SYMBOL(_ramend);
EXPORT_SYMBOL(reserved_mem_dcache_on);
#ifdef CONFIG_MTD_UCLINUX #ifdef CONFIG_MTD_UCLINUX
unsigned long memory_mtd_end, memory_mtd_start, mtd_size; unsigned long memory_mtd_end, memory_mtd_start, mtd_size;