From 4368902bb90f0e208387f336c3fce0e6b2a110fc Mon Sep 17 00:00:00 2001 From: Gilad Ben-Yossef Date: Tue, 22 Jan 2013 16:48:45 +0530 Subject: ARC: Add support for ioremap_prot API Implement ioremap_prot() to allow mapping IO memory with variable protection via TLB. Implementing this allows the /dev/mem driver to use its generic access() VMA callback, which in turn allows ptrace to examine data in memory mapped regions mapped via /dev/mem, such as Arc DCCM. The end result is that it is possible to examine values of variables placed into DCCM in user space programs via GDB. CC: Alexey Brodkin CC: Noam Camus Acked-by: Vineet Gupta Signed-off-by: Gilad Ben-Yossef Signed-off-by: Vineet Gupta --- arch/arc/include/asm/io.h | 2 ++ arch/arc/include/asm/page.h | 3 +++ 2 files changed, 5 insertions(+) (limited to 'arch/arc/include') diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h index d20051b..473424d 100644 --- a/arch/arc/include/asm/io.h +++ b/arch/arc/include/asm/io.h @@ -16,6 +16,8 @@ #define PCI_IOBASE ((void __iomem *)0) extern void __iomem *ioremap(unsigned long physaddr, unsigned long size); +extern void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size, + unsigned long flags); extern void iounmap(const void __iomem *addr); #define ioremap_nocache(phy, sz) ioremap(phy, sz) diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h index dfe1f8a..bdf5461 100644 --- a/arch/arc/include/asm/page.h +++ b/arch/arc/include/asm/page.h @@ -48,6 +48,8 @@ typedef unsigned long pgtable_t; #define __pgd(x) ((pgd_t) { (x) }) #define __pgprot(x) ((pgprot_t) { (x) }) +#define pte_pgprot(x) __pgprot(pte_val(x)) + #else /* !STRICT_MM_TYPECHECKS */ typedef unsigned long pte_t; @@ -60,6 +62,7 @@ typedef unsigned long pgtable_t; #define pgprot_val(x) (x) #define __pte(x) (x) #define __pgprot(x) (x) +#define pte_pgprot(x) (x) #endif -- cgit v1.1