Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7864
b: refs/heads/master
c: d7b6b35
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed Sep 8, 2005
1 parent 963d4af commit e494625
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b38d950d3aedf90c8b15b3c7c799b5eb53c47c45
refs/heads/master: d7b6b3589471c3856f1e6dc9c77abc4af962ffdb
52 changes: 52 additions & 0 deletions trunk/arch/arm/mm/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,58 @@
#include <asm/tlbflush.h>

#ifdef CONFIG_CPU_CACHE_VIPT

void flush_cache_mm(struct mm_struct *mm)
{
if (cache_is_vivt()) {
if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
__cpuc_flush_user_all();
return;
}

if (cache_is_vipt_aliasing()) {
asm( "mcr p15, 0, %0, c7, c14, 0\n"
" mcr p15, 0, %0, c7, c5, 0\n"
" mcr p15, 0, %0, c7, c10, 4"
:
: "r" (0)
: "cc");
}
}

void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
{
if (cache_is_vivt()) {
if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask))
__cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end),
vma->vm_flags);
return;
}

if (cache_is_vipt_aliasing()) {
asm( "mcr p15, 0, %0, c7, c14, 0\n"
" mcr p15, 0, %0, c7, c5, 0\n"
" mcr p15, 0, %0, c7, c10, 4"
:
: "r" (0)
: "cc");
}
}

void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn)
{
if (cache_is_vivt()) {
if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
unsigned long addr = user_addr & PAGE_MASK;
__cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags);
}
return;
}

if (cache_is_vipt_aliasing())
flush_pfn_alias(pfn, user_addr);
}

#define ALIAS_FLUSH_START 0xffff4000

#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
Expand Down
7 changes: 6 additions & 1 deletion trunk/include/asm-arm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ extern void dmac_flush_range(unsigned long, unsigned long);
* Convert calls to our calling convention.
*/
#define flush_cache_all() __cpuc_flush_kern_all()

#ifndef CONFIG_CPU_CACHE_VIPT
static inline void flush_cache_mm(struct mm_struct *mm)
{
if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
Expand All @@ -279,6 +279,11 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned l
__cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags);
}
}
#else
extern void flush_cache_mm(struct mm_struct *mm);
extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn);
#endif

/*
* flush_cache_user_range is used when we want to ensure that the
Expand Down

0 comments on commit e494625

Please sign in to comment.