Commit cbbcefb7 authored by Hirokazu Takata's avatar Hirokazu Takata Committed by Linus Torvalds

[PATCH] m32r: Support pgprot_noncached()

This patch updates include/asm-m32r/pgtable.h to add pgprot_noncached().
It is required to fix a problem of an userspace application, which mmaps
io registers.

This patch also modifies drivers/video/fbmem.c to support noncachable
framebuffer access for m32r.
In this routine, pgprot_writecombine() is used hopefully, even though
the current m32r never does write-combining or write-coalescing...

Please apply this.

	* include/asm-m32r/pgtable.h
	  (pgprot_noncached, pgprot_writecombine): Newly added.

	* drivers/video/fbmem.c (fb_mmap): Add m32r support.
Signed-off-by: default avatarMamoru Sakugawa <sakugawa@linux-m32r.org>
Signed-off-by: default avatarHirokazu Takata <takata@linux-m32r.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 536a77b9
...@@ -938,7 +938,8 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) ...@@ -938,7 +938,8 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
#elif defined(__hppa__) #elif defined(__hppa__)
pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE; pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
#elif defined(__ia64__) || defined(__arm__) || defined(__sh__) #elif defined(__ia64__) || defined(__arm__) || defined(__sh__) || \
defined(__m32r__)
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
#else #else
#warning What do we have to do here?? #warning What do we have to do here??
......
...@@ -342,6 +342,19 @@ static __inline__ void ptep_mkdirty(pte_t *ptep) ...@@ -342,6 +342,19 @@ static __inline__ void ptep_mkdirty(pte_t *ptep)
set_bit(_PAGE_BIT_DIRTY, ptep); set_bit(_PAGE_BIT_DIRTY, ptep);
} }
/*
* Macro and implementation to make a page protection as uncachable.
*/
static __inline__ pgprot_t pgprot_noncached(pgprot_t _prot)
{
unsigned long prot = pgprot_val(_prot);
prot |= _PAGE_NONCACHABLE;
return __pgprot(prot);
}
#define pgprot_writecombine(prot) pgprot_noncached(prot)
/* /*
* Conversion functions: convert a page and protection to a page entry, * Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to. * and a page entry and page directory to the page they refer to.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment