cache.c (4f2c0a4acffbec01079c28f839422e64ddeff004) cache.c (61e150fb310729c98227a5edf6e4a3619edc3702)
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1999-2006 Helge Deller <deller@gmx.de> (07-13-1999)
7 * Copyright (C) 1999 SuSE GmbH Nuernberg
8 * Copyright (C) 2000 Philipp Rumpf (prumpf@tux.org)

--- 385 unchanged lines hidden (view full) ---

394
395void flush_dcache_page(struct page *page)
396{
397 struct address_space *mapping = page_mapping_file(page);
398 struct vm_area_struct *mpnt;
399 unsigned long offset;
400 unsigned long addr, old_addr = 0;
401 unsigned long count = 0;
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1999-2006 Helge Deller <deller@gmx.de> (07-13-1999)
7 * Copyright (C) 1999 SuSE GmbH Nuernberg
8 * Copyright (C) 2000 Philipp Rumpf (prumpf@tux.org)

--- 385 unchanged lines hidden (view full) ---

394
395void flush_dcache_page(struct page *page)
396{
397 struct address_space *mapping = page_mapping_file(page);
398 struct vm_area_struct *mpnt;
399 unsigned long offset;
400 unsigned long addr, old_addr = 0;
401 unsigned long count = 0;
402 unsigned long flags;
402 pgoff_t pgoff;
403
404 if (mapping && !mapping_mapped(mapping)) {
405 set_bit(PG_dcache_dirty, &page->flags);
406 return;
407 }
408
409 flush_kernel_dcache_page_addr(page_address(page));

--- 5 unchanged lines hidden (view full) ---

415
416 /*
417 * We have carefully arranged in arch_get_unmapped_area() that
418 * *any* mappings of a file are always congruently mapped (whether
419 * declared as MAP_PRIVATE or MAP_SHARED), so we only need
420 * to flush one address here for them all to become coherent
421 * on machines that support equivalent aliasing
422 */
403 pgoff_t pgoff;
404
405 if (mapping && !mapping_mapped(mapping)) {
406 set_bit(PG_dcache_dirty, &page->flags);
407 return;
408 }
409
410 flush_kernel_dcache_page_addr(page_address(page));

--- 5 unchanged lines hidden (view full) ---

416
417 /*
418 * We have carefully arranged in arch_get_unmapped_area() that
419 * *any* mappings of a file are always congruently mapped (whether
420 * declared as MAP_PRIVATE or MAP_SHARED), so we only need
421 * to flush one address here for them all to become coherent
422 * on machines that support equivalent aliasing
423 */
423 flush_dcache_mmap_lock(mapping);
424 flush_dcache_mmap_lock_irqsave(mapping, flags);
424 vma_interval_tree_foreach(mpnt, &mapping->i_mmap, pgoff, pgoff) {
425 offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
426 addr = mpnt->vm_start + offset;
427 if (parisc_requires_coherency()) {
428 pte_t *ptep;
429
430 ptep = get_ptep(mpnt->vm_mm, addr);
431 if (ptep && pte_needs_flush(*ptep))

--- 23 unchanged lines hidden (view full) ---

455 if (old_addr)
456 pr_err("INEQUIVALENT ALIASES 0x%lx and 0x%lx in file %pD\n",
457 old_addr, addr, mpnt->vm_file);
458 old_addr = addr;
459 }
460 }
461 WARN_ON(++count == 4096);
462 }
425 vma_interval_tree_foreach(mpnt, &mapping->i_mmap, pgoff, pgoff) {
426 offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
427 addr = mpnt->vm_start + offset;
428 if (parisc_requires_coherency()) {
429 pte_t *ptep;
430
431 ptep = get_ptep(mpnt->vm_mm, addr);
432 if (ptep && pte_needs_flush(*ptep))

--- 23 unchanged lines hidden (view full) ---

456 if (old_addr)
457 pr_err("INEQUIVALENT ALIASES 0x%lx and 0x%lx in file %pD\n",
458 old_addr, addr, mpnt->vm_file);
459 old_addr = addr;
460 }
461 }
462 WARN_ON(++count == 4096);
463 }
463 flush_dcache_mmap_unlock(mapping);
464 flush_dcache_mmap_unlock_irqrestore(mapping, flags);
464}
465EXPORT_SYMBOL(flush_dcache_page);
466
467/* Defined in arch/parisc/kernel/pacache.S */
468EXPORT_SYMBOL(flush_kernel_dcache_range_asm);
469EXPORT_SYMBOL(flush_kernel_icache_range_asm);
470
471#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */

--- 304 unchanged lines hidden ---
465}
466EXPORT_SYMBOL(flush_dcache_page);
467
468/* Defined in arch/parisc/kernel/pacache.S */
469EXPORT_SYMBOL(flush_kernel_dcache_range_asm);
470EXPORT_SYMBOL(flush_kernel_icache_range_asm);
471
472#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */

--- 304 unchanged lines hidden ---