aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/io.h')
-rw-r--r--arch/powerpc/include/asm/io.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index e746becd9d6f..7f19fbd3ba55 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -29,12 +29,14 @@ extern struct pci_dev *isa_bridge_pcidev;
29 29
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/compiler.h> 31#include <linux/compiler.h>
32#include <linux/mm.h>
32#include <asm/page.h> 33#include <asm/page.h>
33#include <asm/byteorder.h> 34#include <asm/byteorder.h>
34#include <asm/synch.h> 35#include <asm/synch.h>
35#include <asm/delay.h> 36#include <asm/delay.h>
36#include <asm/mmu.h> 37#include <asm/mmu.h>
37#include <asm/ppc_asm.h> 38#include <asm/ppc_asm.h>
39#include <asm/pgtable.h>
38 40
39#ifdef CONFIG_PPC64 41#ifdef CONFIG_PPC64
40#include <asm/paca.h> 42#include <asm/paca.h>
@@ -804,6 +806,8 @@ extern void __iounmap_at(void *ea, unsigned long size);
804 */ 806 */
805static inline unsigned long virt_to_phys(volatile void * address) 807static inline unsigned long virt_to_phys(volatile void * address)
806{ 808{
809 WARN_ON(IS_ENABLED(CONFIG_DEBUG_VIRTUAL) && !virt_addr_valid(address));
810
807 return __pa((unsigned long)address); 811 return __pa((unsigned long)address);
808} 812}
809 813
@@ -827,7 +831,14 @@ static inline void * phys_to_virt(unsigned long address)
827/* 831/*
828 * Change "struct page" to physical address. 832 * Change "struct page" to physical address.
829 */ 833 */
830#define page_to_phys(page) ((phys_addr_t)page_to_pfn(page) << PAGE_SHIFT) 834static inline phys_addr_t page_to_phys(struct page *page)
835{
836 unsigned long pfn = page_to_pfn(page);
837
838 WARN_ON(IS_ENABLED(CONFIG_DEBUG_VIRTUAL) && !pfn_valid(pfn));
839
840 return PFN_PHYS(pfn);
841}
831 842
832/* 843/*
833 * 32 bits still uses virt_to_bus() for it's implementation of DMA 844 * 32 bits still uses virt_to_bus() for it's implementation of DMA