/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1994 - 2003, 06, 07 by Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 2007 MIPS Technologies, Inc.
*/ #include <linux/fs.h> #include <linux/fcntl.h> #include <linux/kernel.h> #include <linux/linkage.h> #include <linux/export.h> #include <linux/sched.h> #include <linux/syscalls.h> #include <linux/mm.h> #include <linux/highmem.h> #include <linux/pagemap.h>
/* * We could optimize the case where the cache argument is not BCACHE but * that seems very atypical use ...
*/
SYSCALL_DEFINE3(cacheflush, unsignedlong, addr, unsignedlong, bytes, unsignedint, cache)
{ if (bytes == 0) return 0; if (!access_ok((void __user *) addr, bytes)) return -EFAULT;
if (mapping && !mapping_mapped(mapping)) {
folio_set_dcache_dirty(folio); return;
}
/* * We could delay the flush for the !folio_mapping case too. But that * case is for exec env/arg pages and those are %99 certainly going to * get faulted into the tlb (and thus flushed) anyways.
*/ for (i = 0; i < nr; i++) {
addr = (unsignedlong)kmap_local_page(nth_page(page, i));
flush_data_cache_page(addr);
kunmap_local((void *)addr);
}
}
EXPORT_SYMBOL(__flush_dcache_pages);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.