diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-18 00:24:27 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-18 00:24:27 +0000 |
commit | b9558d5f86c471a125abf1fb3a3882fb053b1f8c (patch) | |
tree | 707b53ec64e740a7da87d5f36485e3cd9b1c794e /include/asm-m68k/virtconvert.h | |
parent | b3ac367c7a3e6047abe74817db27e34e759f279f (diff) |
Merge with Linux 2.3.41.
Diffstat (limited to 'include/asm-m68k/virtconvert.h')
-rw-r--r-- | include/asm-m68k/virtconvert.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/include/asm-m68k/virtconvert.h b/include/asm-m68k/virtconvert.h index 302308d88..4841264ab 100644 --- a/include/asm-m68k/virtconvert.h +++ b/include/asm-m68k/virtconvert.h @@ -9,6 +9,7 @@ #include <linux/config.h> #include <asm/setup.h> +#include <asm/page.h> #ifdef CONFIG_AMIGA #include <asm/amigahw.h> @@ -34,22 +35,22 @@ extern inline unsigned long mm_ptov(unsigned long paddr) #endif #ifdef CONFIG_SINGLE_MEMORY_CHUNK -extern inline unsigned long virt_to_phys(volatile void * address) +extern inline unsigned long virt_to_phys(volatile void *vaddr) { - unsigned long voff = (unsigned long) address; + unsigned long voff = (unsigned long)vaddr - PAGE_OFFSET; if (voff < m68k_memory[0].size) - return m68k_memory[0].addr + voff; - else - return mm_vtop_fallback(voff); + return voff + m68k_memory[0].addr; + return mm_vtop_fallback((unsigned long)vaddr); } extern inline void * phys_to_virt(unsigned long paddr) { - unsigned long base = m68k_memory[0].addr; + unsigned long poff = paddr - m68k_memory[0].addr; + + if (poff < m68k_memory[0].size) + return (void *)(poff + PAGE_OFFSET); - if ((paddr >= base) && (paddr < (base + m68k_memory[0].size))) - return (void *)(paddr - base); #ifdef CONFIG_AMIGA /* * if on an amiga and address is in first 16M, move it |