From a8a6aa0f060e98f9af170c0905d3d5af3b3fa21d Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 7 Sep 2010 15:49:00 +1000 Subject: m68k: move definition of THREAD_SIZE into thread_info_mm.h Move the definition of THREAD_SIZE from page_mm.h to thread_info_mm.h This logically associates it with the other thread definitions, and will make it easier to merge the MMU and non-MMU versions of page.h and thread_info.h. Signed-off-by: Greg Ungerer Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/page_mm.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'arch/m68k/include/asm/page_mm.h') diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h index d009f3ea39a..eeb6764c105 100644 --- a/arch/m68k/include/asm/page_mm.h +++ b/arch/m68k/include/asm/page_mm.h @@ -14,12 +14,6 @@ #include -#if PAGE_SHIFT < 13 -#define THREAD_SIZE (8192) -#else -#define THREAD_SIZE PAGE_SIZE -#endif - #ifndef __ASSEMBLY__ #include -- cgit v1.2.3-70-g09d2 From 138ff3462f53a7370bef15443e623ecba1c350bf Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 7 Sep 2010 15:49:10 +1000 Subject: m68k/m68knommu: clean up page.h There is a lot of common defines in the MMU and non-MMU variants of page.h. Factor out the common stuff into the master page.h. It still includes the underlying page_mm.h or page_no.h, but they only contain the real differences now. Signed-off-by: Greg Ungerer Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/page.h | 48 ++++++++++++++++++++++++++++++++++++-- arch/m68k/include/asm/page_mm.h | 49 +++------------------------------------ arch/m68k/include/asm/page_no.h | 51 +++++------------------------------------ 3 files changed, 55 insertions(+), 93 deletions(-) (limited to 'arch/m68k/include/asm/page_mm.h') diff --git a/arch/m68k/include/asm/page.h b/arch/m68k/include/asm/page.h index f2b4480cc98..dfebb7c1e37 100644 --- a/arch/m68k/include/asm/page.h +++ b/arch/m68k/include/asm/page.h @@ -1,5 +1,49 @@ -#ifdef __uClinux__ -#include "page_no.h" +#ifndef _M68K_PAGE_H +#define _M68K_PAGE_H + +#include +#include +#include + +/* PAGE_SHIFT determines the page size */ +#ifndef CONFIG_SUN3 +#define PAGE_SHIFT (12) #else +#define PAGE_SHIFT (13) +#endif +#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1)) +#define PAGE_OFFSET (PAGE_OFFSET_RAW) + +#ifndef __ASSEMBLY__ + +/* + * These are used to make use of C type-checking.. + */ +typedef struct { unsigned long pte; } pte_t; +typedef struct { unsigned long pmd[16]; } pmd_t; +typedef struct { unsigned long pgd; } pgd_t; +typedef struct { unsigned long pgprot; } pgprot_t; +typedef struct page *pgtable_t; + +#define pte_val(x) ((x).pte) +#define pmd_val(x) ((&x)->pmd[0]) +#define pgd_val(x) ((x).pgd) +#define pgprot_val(x) ((x).pgprot) + +#define __pte(x) ((pte_t) { (x) } ) +#define __pmd(x) ((pmd_t) { (x) } ) +#define __pgd(x) ((pgd_t) { (x) } ) +#define __pgprot(x) ((pgprot_t) { (x) } ) + +#endif /* !__ASSEMBLY__ */ + +#ifdef CONFIG_MMU #include "page_mm.h" +#else +#include "page_no.h" #endif + +#include + +#endif /* _M68K_PAGE_H */ diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h index eeb6764c105..66f0b3938cb 100644 --- a/arch/m68k/include/asm/page_mm.h +++ b/arch/m68k/include/asm/page_mm.h @@ -1,23 +1,9 @@ -#ifndef _M68K_PAGE_H -#define _M68K_PAGE_H - -#include - -/* PAGE_SHIFT determines the page size */ -#ifndef CONFIG_SUN3 -#define PAGE_SHIFT (12) -#else -#define PAGE_SHIFT (13) -#endif -#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) -#define PAGE_MASK (~(PAGE_SIZE-1)) - -#include +#ifndef _M68K_PAGE_MM_H +#define _M68K_PAGE_MM_H #ifndef __ASSEMBLY__ #include - #include #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) @@ -78,33 +64,6 @@ static inline void clear_page(void *page) flush_dcache_page(page); \ } while (0) -/* - * These are used to make use of C type-checking.. - */ -typedef struct { unsigned long pte; } pte_t; -typedef struct { unsigned long pmd[16]; } pmd_t; -typedef struct { unsigned long pgd; } pgd_t; -typedef struct { unsigned long pgprot; } pgprot_t; -typedef struct page *pgtable_t; - -#define pte_val(x) ((x).pte) -#define pmd_val(x) ((&x)->pmd[0]) -#define pgd_val(x) ((x).pgd) -#define pgprot_val(x) ((x).pgprot) - -#define __pte(x) ((pte_t) { (x) } ) -#define __pmd(x) ((pmd_t) { (x) } ) -#define __pgd(x) ((pgd_t) { (x) } ) -#define __pgprot(x) ((pgprot_t) { (x) } ) - -#endif /* !__ASSEMBLY__ */ - -#include - -#define PAGE_OFFSET (PAGE_OFFSET_RAW) - -#ifndef __ASSEMBLY__ - extern unsigned long m68k_memoffset; #ifndef CONFIG_SUN3 @@ -217,6 +176,4 @@ static inline __attribute_const__ int __virt_to_node_shift(void) #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#include - -#endif /* _M68K_PAGE_H */ +#endif /* _M68K_PAGE_MM_H */ diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h index 8029a33e03c..90595721185 100644 --- a/arch/m68k/include/asm/page_no.h +++ b/arch/m68k/include/asm/page_no.h @@ -1,18 +1,11 @@ -#ifndef _M68KNOMMU_PAGE_H -#define _M68KNOMMU_PAGE_H - -#include - -/* PAGE_SHIFT determines the page size */ - -#define PAGE_SHIFT (12) -#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) -#define PAGE_MASK (~(PAGE_SIZE-1)) - -#include +#ifndef _M68K_PAGE_NO_H +#define _M68K_PAGE_NO_H #ifndef __ASSEMBLY__ +extern unsigned long memory_start; +extern unsigned long memory_end; + #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) #define free_user_page(page, addr) free_page(addr) @@ -26,36 +19,6 @@ alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE -/* - * These are used to make use of C type-checking.. - */ -typedef struct { unsigned long pte; } pte_t; -typedef struct { unsigned long pmd[16]; } pmd_t; -typedef struct { unsigned long pgd; } pgd_t; -typedef struct { unsigned long pgprot; } pgprot_t; -typedef struct page *pgtable_t; - -#define pte_val(x) ((x).pte) -#define pmd_val(x) ((&x)->pmd[0]) -#define pgd_val(x) ((x).pgd) -#define pgprot_val(x) ((x).pgprot) - -#define __pte(x) ((pte_t) { (x) } ) -#define __pmd(x) ((pmd_t) { (x) } ) -#define __pgd(x) ((pgd_t) { (x) } ) -#define __pgprot(x) ((pgprot_t) { (x) } ) - -extern unsigned long memory_start; -extern unsigned long memory_end; - -#endif /* !__ASSEMBLY__ */ - -#include - -#define PAGE_OFFSET (PAGE_OFFSET_RAW) - -#ifndef __ASSEMBLY__ - #define __pa(vaddr) ((unsigned long)(vaddr)) #define __va(paddr) ((void *)(paddr)) @@ -74,6 +37,4 @@ extern unsigned long memory_end; #endif /* __ASSEMBLY__ */ -#include - -#endif /* _M68KNOMMU_PAGE_H */ +#endif /* _M68K_PAGE_NO_H */ -- cgit v1.2.3-70-g09d2 From 22e58f9de5d140116eb3a30d5e54396e3030bed2 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 2 Oct 2010 19:32:41 +0200 Subject: m68k: __pa(): cast arg to long Fixes this: drivers/char/mem.c: In function 'mmap_kmem': drivers/char/mem.c:342: warning: cast to pointer from integer of different size by doing what other archtiectures do. Cc: Geert Uytterhoeven Signed-off-by: Andrew Morton Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/page_mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/m68k/include/asm/page_mm.h') diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h index 66f0b3938cb..31d5570d656 100644 --- a/arch/m68k/include/asm/page_mm.h +++ b/arch/m68k/include/asm/page_mm.h @@ -80,7 +80,7 @@ static inline unsigned long ___pa(void *vaddr) : "0" (vaddr), "i" (m68k_fixup_memoffset)); return paddr; } -#define __pa(vaddr) ___pa((void *)(vaddr)) +#define __pa(vaddr) ___pa((void *)(long)(vaddr)) static inline void *__va(unsigned long paddr) { void *vaddr; -- cgit v1.2.3-70-g09d2