diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2006-02-05 21:24:53 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-02-07 05:51:53 -0500 |
commit | 09f5dc44aeff9f792a807a7dca64c1791d98d8c8 (patch) | |
tree | 9cc57118c3ce54087ecfff0870432313fc733edf /arch/powerpc/mm/mem.c | |
parent | 95eff20feb679a2223a6da1e7f272fe9aa99591e (diff) |
[PATCH] powerpc: Cleanup, consolidating icache dirtying logic
The code to mark a page as icache dirty (so that it will later be
icache-dcache flushed when we try to execute from it) is duplicated in
three places: flush_dcache_page() does this marking and nothing else,
but clear_user_page() and copy_user_page() duplicate it, since those
functions make the page icache dirty themselves.
This patch makes those other functions call flush_dcache_page()
instead, so the logic's all in one place. This will make life less
confusing if we ever need to tweak the details of the the lazy icache
flush mechanism.
arch/powerpc/mm/mem.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r-- | arch/powerpc/mm/mem.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 15aac0d78dfa..550517c2dd42 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -435,17 +435,12 @@ void clear_user_page(void *page, unsigned long vaddr, struct page *pg) | |||
435 | { | 435 | { |
436 | clear_page(page); | 436 | clear_page(page); |
437 | 437 | ||
438 | if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) | ||
439 | return; | ||
440 | /* | 438 | /* |
441 | * We shouldnt have to do this, but some versions of glibc | 439 | * We shouldnt have to do this, but some versions of glibc |
442 | * require it (ld.so assumes zero filled pages are icache clean) | 440 | * require it (ld.so assumes zero filled pages are icache clean) |
443 | * - Anton | 441 | * - Anton |
444 | */ | 442 | */ |
445 | 443 | flush_dcache_page(pg); | |
446 | /* avoid an atomic op if possible */ | ||
447 | if (test_bit(PG_arch_1, &pg->flags)) | ||
448 | clear_bit(PG_arch_1, &pg->flags); | ||
449 | } | 444 | } |
450 | EXPORT_SYMBOL(clear_user_page); | 445 | EXPORT_SYMBOL(clear_user_page); |
451 | 446 | ||
@@ -469,12 +464,7 @@ void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, | |||
469 | return; | 464 | return; |
470 | #endif | 465 | #endif |
471 | 466 | ||
472 | if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) | 467 | flush_dcache_page(pg); |
473 | return; | ||
474 | |||
475 | /* avoid an atomic op if possible */ | ||
476 | if (test_bit(PG_arch_1, &pg->flags)) | ||
477 | clear_bit(PG_arch_1, &pg->flags); | ||
478 | } | 468 | } |
479 | 469 | ||
480 | void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, | 470 | void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, |