aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/pgtable.h
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2014-07-18 05:51:33 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-09-22 07:35:53 -0400
commit4b050ba7a66c3ff26cc329ea4db0e9fb2d66a064 (patch)
treefa1d1accffcd5bc39694d19e33a9cf82ffd47cc5 /arch/mips/include/asm/pgtable.h
parent4f12b91d2da577d81c580da62373fd37b31e0da1 (diff)
MIPS: pgtable.h: Implement the pgprot_writecombine function for MIPS
Previously, the pgprot_writecombine function was simply defined as pgprot_uncached in include/asm-generic/pgtable.h. This is not optimal for cores that can actually do write-combine memory writes so define this function to take into account the core's cache coherency attribute to achieve such behavior. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/7403/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/pgtable.h')
-rw-r--r--arch/mips/include/asm/pgtable.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index df49a308085c..d6d1928539b1 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -366,6 +366,16 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
366 return __pgprot(prot); 366 return __pgprot(prot);
367} 367}
368 368
369static inline pgprot_t pgprot_writecombine(pgprot_t _prot)
370{
371 unsigned long prot = pgprot_val(_prot);
372
373 /* cpu_data[0].writecombine is already shifted by _CACHE_SHIFT */
374 prot = (prot & ~_CACHE_MASK) | cpu_data[0].writecombine;
375
376 return __pgprot(prot);
377}
378
369/* 379/*
370 * Conversion functions: convert a page and protection to a page entry, 380 * Conversion functions: convert a page and protection to a page entry,
371 * and a page entry and page directory to the page they refer to. 381 * and a page entry and page directory to the page they refer to.