Skip to content

Commit

Permalink
[ARM] 2939/1: Fix compilation error in arch/arm/mm/flush.c
Browse files Browse the repository at this point in the history
Patch from Catalin Marinas

When CONFIG_CPU_CACHE_VIPT is defined, the flush_pfn_alias() function is
implicitely declared and it later conflicts with its actual definition.
This patch moves the function definition to the beginning of the file.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Catalin Marinas authored and Russell King committed Sep 30, 2005
1 parent dce79af commit 481467d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions arch/arm/mm/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@

#ifdef CONFIG_CPU_CACHE_VIPT

#define ALIAS_FLUSH_START 0xffff4000

#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)

static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
{
unsigned long to = ALIAS_FLUSH_START + (CACHE_COLOUR(vaddr) << PAGE_SHIFT);

set_pte(TOP_PTE(to), pfn_pte(pfn, PAGE_KERNEL));
flush_tlb_kernel_page(to);

asm( "mcrr p15, 0, %1, %0, c14\n"
" mcrr p15, 0, %1, %0, c5\n"
:
: "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES)
: "cc");
}

void flush_cache_mm(struct mm_struct *mm)
{
if (cache_is_vivt()) {
Expand Down Expand Up @@ -67,24 +85,6 @@ void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsig
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)

static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
{
unsigned long to = ALIAS_FLUSH_START + (CACHE_COLOUR(vaddr) << PAGE_SHIFT);

set_pte(TOP_PTE(to), pfn_pte(pfn, PAGE_KERNEL));
flush_tlb_kernel_page(to);

asm( "mcrr p15, 0, %1, %0, c14\n"
" mcrr p15, 0, %1, %0, c5\n"
:
: "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES)
: "cc");
}
#else
#define flush_pfn_alias(pfn,vaddr) do { } while (0)
#endif
Expand Down

0 comments on commit 481467d

Please sign in to comment.