summaryrefslogtreecommitdiffstats
path: root/include/asm-m68k/page.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-18 00:24:27 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-18 00:24:27 +0000
commitb9558d5f86c471a125abf1fb3a3882fb053b1f8c (patch)
tree707b53ec64e740a7da87d5f36485e3cd9b1c794e /include/asm-m68k/page.h
parentb3ac367c7a3e6047abe74817db27e34e759f279f (diff)
Merge with Linux 2.3.41.
Diffstat (limited to 'include/asm-m68k/page.h')
-rw-r--r--include/asm-m68k/page.h78
1 files changed, 24 insertions, 54 deletions
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index 6a3d9df66..23dd731c8 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -25,16 +25,14 @@
#ifndef __ASSEMBLY__
-#define STRICT_MM_TYPECHECKS
-
-#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
+#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
#define free_user_page(page, addr) free_page(addr)
/*
* We don't need to check for alignment etc.
*/
#ifdef CPU_M68040_OR_M68060_ONLY
-static inline void copy_page(unsigned long to, unsigned long from)
+static inline void copy_page(void *to, void *from)
{
unsigned long tmp;
@@ -49,11 +47,10 @@ static inline void copy_page(unsigned long to, unsigned long from)
);
}
-static inline void clear_page(unsigned long page)
+static inline void clear_page(void *page)
{
- unsigned long data, sp, tmp;
-
- sp = page;
+ unsigned long data, tmp;
+ void *sp = page;
data = 0;
@@ -75,11 +72,10 @@ static inline void clear_page(unsigned long page)
}
#else
-#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
-#define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE)
+#define clear_page(page) memset((page), 0, PAGE_SIZE)
+#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
#endif
-#ifdef STRICT_MM_TYPECHECKS
/*
* These are used to make use of C type-checking..
*/
@@ -98,55 +94,29 @@ typedef struct { unsigned long pgprot; } pgprot_t;
#define __pgd(x) ((pgd_t) { (x) } )
#define __pgprot(x) ((pgprot_t) { (x) } )
-#else
-/*
- * .. while these make it easier on the compiler
- */
-typedef unsigned long pte_t;
-typedef struct { unsigned long pmd[16]; } pmd_t;
-typedef unsigned long pgd_t;
-typedef unsigned long pgprot_t;
+/* to align the pointer to the (next) page boundary */
+#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
-#define pte_val(x) (x)
-#define pmd_val(x) ((&x)->pmd[0])
-#define pgd_val(x) (x)
-#define pgprot_val(x) (x)
+#endif /* !__ASSEMBLY__ */
-#define __pte(x) (x)
-#define __pmd(x) ((pmd_t) { (x) } )
-#define __pgd(x) (x)
-#define __pgprot(x) (x)
+#include <asm/page_offset.h>
-#endif
+#define PAGE_OFFSET (PAGE_OFFSET_RAW)
-/* to align the pointer to the (next) page boundary */
-#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
+#ifndef __ASSEMBLY__
-/* This handles the memory map.. */
#ifndef CONFIG_SUN3
-#define PAGE_OFFSET 0
+
+#ifdef CONFIG_SINGLE_MEMORY_CHUNK
+extern unsigned long m68k_memoffset;
+
+#define __pa(vaddr) ((unsigned long)(vaddr)+m68k_memoffset)
+#define __va(paddr) ((void *)((unsigned long)(paddr)-m68k_memoffset))
#else
-#define PAGE_OFFSET 0x0E000000
+#define __pa(vaddr) virt_to_phys((void *)vaddr)
+#define __va(paddr) phys_to_virt((unsigned long)paddr)
#endif
-#ifndef CONFIG_SUN3
-#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
-/*
- * A hacky workaround for the problems with mmap() of frame buffer
- * memory in the lower 16MB physical memoryspace.
- *
- * This is a short term solution, we will have to deal properly
- * with this in 2.3.x.
- */
-extern inline void *__va(unsigned long physaddr)
-{
-#ifdef CONFIG_AMIGA
- if (MACH_IS_AMIGA && (physaddr < 16*1024*1024))
- return (void *)0xffffffff;
- else
-#endif
- return (void *)(physaddr+PAGE_OFFSET);
-}
#else /* !CONFIG_SUN3 */
/* This #define is a horrible hack to suppress lots of warnings. --m */
#define __pa(x) ___pa((unsigned long)x)
@@ -172,9 +142,7 @@ static inline void *__va(unsigned long x)
}
#endif /* CONFIG_SUN3 */
-#define MAP_NR(addr) (__pa(addr) >> PAGE_SHIFT)
-
-#endif /* !__ASSEMBLY__ */
+#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)
#ifndef CONFIG_SUN3
#define BUG() do { \
@@ -192,6 +160,8 @@ static inline void *__va(unsigned long x)
BUG(); \
} while (0)
+#endif /* __ASSEMBLY__ */
+
#endif /* __KERNEL__ */
#endif /* _M68K_PAGE_H */