diff options
Diffstat (limited to 'arch/arm/mm/mmap.c')
-rw-r--r-- | arch/arm/mm/mmap.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index 29e54807c5bc..b0b5f4694070 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c | |||
@@ -114,3 +114,25 @@ full_search: | |||
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | |||
118 | /* | ||
119 | * You really shouldn't be using read() or write() on /dev/mem. This | ||
120 | * might go away in the future. | ||
121 | */ | ||
122 | int valid_phys_addr_range(unsigned long addr, size_t size) | ||
123 | { | ||
124 | if (addr + size > __pa(high_memory)) | ||
125 | return 0; | ||
126 | |||
127 | return 1; | ||
128 | } | ||
129 | |||
130 | /* | ||
131 | * We don't use supersection mappings for mmap() on /dev/mem, which | ||
132 | * means that we can't map the memory area above the 4G barrier into | ||
133 | * userspace. | ||
134 | */ | ||
135 | int valid_mmap_phys_addr_range(unsigned long pfn, size_t size) | ||
136 | { | ||
137 | return !(pfn + (size >> PAGE_SHIFT) > 0x00100000); | ||
138 | } | ||