diff options
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r-- | arch/arm/mm/mmu.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index b590a4c92462..f86ce1a9f525 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -356,44 +356,6 @@ const struct mem_type *get_mem_type(unsigned int type) | |||
356 | } | 356 | } |
357 | EXPORT_SYMBOL(get_mem_type); | 357 | EXPORT_SYMBOL(get_mem_type); |
358 | 358 | ||
359 | #define PTE_SET_FN(_name, pteop) \ | ||
360 | static int pte_set_##_name(pte_t *ptep, pgtable_t token, unsigned long addr, \ | ||
361 | void *data) \ | ||
362 | { \ | ||
363 | pte_t pte = pteop(*ptep); \ | ||
364 | \ | ||
365 | set_pte_ext(ptep, pte, 0); \ | ||
366 | return 0; \ | ||
367 | } \ | ||
368 | |||
369 | #define SET_MEMORY_FN(_name, callback) \ | ||
370 | int set_memory_##_name(unsigned long addr, int numpages) \ | ||
371 | { \ | ||
372 | unsigned long start = addr; \ | ||
373 | unsigned long size = PAGE_SIZE*numpages; \ | ||
374 | unsigned end = start + size; \ | ||
375 | \ | ||
376 | if (start < MODULES_VADDR || start >= MODULES_END) \ | ||
377 | return -EINVAL;\ | ||
378 | \ | ||
379 | if (end < MODULES_VADDR || end >= MODULES_END) \ | ||
380 | return -EINVAL; \ | ||
381 | \ | ||
382 | apply_to_page_range(&init_mm, start, size, callback, NULL); \ | ||
383 | flush_tlb_kernel_range(start, end); \ | ||
384 | return 0;\ | ||
385 | } | ||
386 | |||
387 | PTE_SET_FN(ro, pte_wrprotect) | ||
388 | PTE_SET_FN(rw, pte_mkwrite) | ||
389 | PTE_SET_FN(x, pte_mkexec) | ||
390 | PTE_SET_FN(nx, pte_mknexec) | ||
391 | |||
392 | SET_MEMORY_FN(ro, pte_set_ro) | ||
393 | SET_MEMORY_FN(rw, pte_set_rw) | ||
394 | SET_MEMORY_FN(x, pte_set_x) | ||
395 | SET_MEMORY_FN(nx, pte_set_nx) | ||
396 | |||
397 | /* | 359 | /* |
398 | * Adjust the PMD section entries according to the CPU in use. | 360 | * Adjust the PMD section entries according to the CPU in use. |
399 | */ | 361 | */ |