diff options
Diffstat (limited to 'arch/unicore32/include/asm')
-rw-r--r-- | arch/unicore32/include/asm/io.h | 27 | ||||
-rw-r--r-- | arch/unicore32/include/asm/pgtable.h | 10 | ||||
-rw-r--r-- | arch/unicore32/include/asm/ptrace.h | 1 |
3 files changed, 33 insertions, 5 deletions
diff --git a/arch/unicore32/include/asm/io.h b/arch/unicore32/include/asm/io.h index 39decb6e6f57..cb1d8fd2b16b 100644 --- a/arch/unicore32/include/asm/io.h +++ b/arch/unicore32/include/asm/io.h | |||
@@ -39,10 +39,37 @@ extern void __uc32_iounmap(volatile void __iomem *addr); | |||
39 | #define ioremap_nocache(cookie, size) __uc32_ioremap(cookie, size) | 39 | #define ioremap_nocache(cookie, size) __uc32_ioremap(cookie, size) |
40 | #define iounmap(cookie) __uc32_iounmap(cookie) | 40 | #define iounmap(cookie) __uc32_iounmap(cookie) |
41 | 41 | ||
42 | #define readb_relaxed readb | ||
43 | #define readw_relaxed readw | ||
44 | #define readl_relaxed readl | ||
45 | |||
42 | #define HAVE_ARCH_PIO_SIZE | 46 | #define HAVE_ARCH_PIO_SIZE |
43 | #define PIO_OFFSET (unsigned int)(PCI_IOBASE) | 47 | #define PIO_OFFSET (unsigned int)(PCI_IOBASE) |
44 | #define PIO_MASK (unsigned int)(IO_SPACE_LIMIT) | 48 | #define PIO_MASK (unsigned int)(IO_SPACE_LIMIT) |
45 | #define PIO_RESERVED (PIO_OFFSET + PIO_MASK + 1) | 49 | #define PIO_RESERVED (PIO_OFFSET + PIO_MASK + 1) |
46 | 50 | ||
51 | #ifdef CONFIG_STRICT_DEVMEM | ||
52 | |||
53 | #include <linux/ioport.h> | ||
54 | #include <linux/mm.h> | ||
55 | |||
56 | /* | ||
57 | * devmem_is_allowed() checks to see if /dev/mem access to a certain | ||
58 | * address is valid. The argument is a physical page number. | ||
59 | * We mimic x86 here by disallowing access to system RAM as well as | ||
60 | * device-exclusive MMIO regions. This effectively disable read()/write() | ||
61 | * on /dev/mem. | ||
62 | */ | ||
63 | static inline int devmem_is_allowed(unsigned long pfn) | ||
64 | { | ||
65 | if (iomem_is_exclusive(pfn << PAGE_SHIFT)) | ||
66 | return 0; | ||
67 | if (!page_is_ram(pfn)) | ||
68 | return 1; | ||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | #endif /* CONFIG_STRICT_DEVMEM */ | ||
73 | |||
47 | #endif /* __KERNEL__ */ | 74 | #endif /* __KERNEL__ */ |
48 | #endif /* __UNICORE_IO_H__ */ | 75 | #endif /* __UNICORE_IO_H__ */ |
diff --git a/arch/unicore32/include/asm/pgtable.h b/arch/unicore32/include/asm/pgtable.h index 233c25880df4..ed6f7d000fba 100644 --- a/arch/unicore32/include/asm/pgtable.h +++ b/arch/unicore32/include/asm/pgtable.h | |||
@@ -87,16 +87,16 @@ extern pgprot_t pgprot_kernel; | |||
87 | 87 | ||
88 | #define PAGE_NONE pgprot_user | 88 | #define PAGE_NONE pgprot_user |
89 | #define PAGE_SHARED __pgprot(pgprot_val(pgprot_user | PTE_READ \ | 89 | #define PAGE_SHARED __pgprot(pgprot_val(pgprot_user | PTE_READ \ |
90 | | PTE_WRITE) | 90 | | PTE_WRITE)) |
91 | #define PAGE_SHARED_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ | 91 | #define PAGE_SHARED_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ |
92 | | PTE_WRITE \ | 92 | | PTE_WRITE \ |
93 | | PTE_EXEC) | 93 | | PTE_EXEC)) |
94 | #define PAGE_COPY __pgprot(pgprot_val(pgprot_user | PTE_READ) | 94 | #define PAGE_COPY __pgprot(pgprot_val(pgprot_user | PTE_READ) |
95 | #define PAGE_COPY_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ | 95 | #define PAGE_COPY_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ |
96 | | PTE_EXEC) | 96 | | PTE_EXEC)) |
97 | #define PAGE_READONLY __pgprot(pgprot_val(pgprot_user | PTE_READ) | 97 | #define PAGE_READONLY __pgprot(pgprot_val(pgprot_user | PTE_READ)) |
98 | #define PAGE_READONLY_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ | 98 | #define PAGE_READONLY_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ |
99 | | PTE_EXEC) | 99 | | PTE_EXEC)) |
100 | #define PAGE_KERNEL pgprot_kernel | 100 | #define PAGE_KERNEL pgprot_kernel |
101 | #define PAGE_KERNEL_EXEC __pgprot(pgprot_val(pgprot_kernel | PTE_EXEC)) | 101 | #define PAGE_KERNEL_EXEC __pgprot(pgprot_val(pgprot_kernel | PTE_EXEC)) |
102 | 102 | ||
diff --git a/arch/unicore32/include/asm/ptrace.h b/arch/unicore32/include/asm/ptrace.h index 9df53d991c78..02bf5a415bf5 100644 --- a/arch/unicore32/include/asm/ptrace.h +++ b/arch/unicore32/include/asm/ptrace.h | |||
@@ -55,6 +55,7 @@ static inline int valid_user_regs(struct pt_regs *regs) | |||
55 | 55 | ||
56 | #define instruction_pointer(regs) ((regs)->UCreg_pc) | 56 | #define instruction_pointer(regs) ((regs)->UCreg_pc) |
57 | #define user_stack_pointer(regs) ((regs)->UCreg_sp) | 57 | #define user_stack_pointer(regs) ((regs)->UCreg_sp) |
58 | #define profile_pc(regs) instruction_pointer(regs) | ||
58 | 59 | ||
59 | #endif /* __ASSEMBLY__ */ | 60 | #endif /* __ASSEMBLY__ */ |
60 | #endif | 61 | #endif |