diff options
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r-- | arch/powerpc/mm/mem.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 8e2eb6611b0b..d974b79a3068 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include <asm/vdso.h> | 51 | #include <asm/vdso.h> |
52 | #include <asm/fixmap.h> | 52 | #include <asm/fixmap.h> |
53 | #include <asm/swiotlb.h> | 53 | #include <asm/swiotlb.h> |
54 | #include <asm/rtas.h> | ||
54 | 55 | ||
55 | #include "mmu_decl.h" | 56 | #include "mmu_decl.h" |
56 | 57 | ||
@@ -553,7 +554,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, | |||
553 | #if (defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_PPC_FSL_BOOK3E)) \ | 554 | #if (defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_PPC_FSL_BOOK3E)) \ |
554 | && defined(CONFIG_HUGETLB_PAGE) | 555 | && defined(CONFIG_HUGETLB_PAGE) |
555 | if (is_vm_hugetlb_page(vma)) | 556 | if (is_vm_hugetlb_page(vma)) |
556 | book3e_hugetlb_preload(vma->vm_mm, address, *ptep); | 557 | book3e_hugetlb_preload(vma, address, *ptep); |
557 | #endif | 558 | #endif |
558 | } | 559 | } |
559 | 560 | ||
@@ -585,3 +586,23 @@ static int add_system_ram_resources(void) | |||
585 | return 0; | 586 | return 0; |
586 | } | 587 | } |
587 | subsys_initcall(add_system_ram_resources); | 588 | subsys_initcall(add_system_ram_resources); |
589 | |||
590 | #ifdef CONFIG_STRICT_DEVMEM | ||
591 | /* | ||
592 | * devmem_is_allowed(): check to see if /dev/mem access to a certain address | ||
593 | * is valid. The argument is a physical page number. | ||
594 | * | ||
595 | * Access has to be given to non-kernel-ram areas as well, these contain the | ||
596 | * PCI mmio resources as well as potential bios/acpi data regions. | ||
597 | */ | ||
598 | int devmem_is_allowed(unsigned long pfn) | ||
599 | { | ||
600 | if (iomem_is_exclusive(pfn << PAGE_SHIFT)) | ||
601 | return 0; | ||
602 | if (!page_is_ram(pfn)) | ||
603 | return 1; | ||
604 | if (page_is_rtas_user_buf(pfn)) | ||
605 | return 1; | ||
606 | return 0; | ||
607 | } | ||
608 | #endif /* CONFIG_STRICT_DEVMEM */ | ||