1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/const.h>
7 #include <asm/page_offset.h>
9 /* PAGE_SHIFT determines the page size */
10 #if defined(CONFIG_SUN3) || defined(CONFIG_COLDFIRE)
15 #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
16 #define PAGE_MASK (~(PAGE_SIZE-1))
17 #define PAGE_OFFSET (PAGE_OFFSET_RAW)
22 * These are used to make use of C type-checking..
24 #if !defined(CONFIG_MMU) || CONFIG_PGTABLE_LEVELS == 3
25 typedef struct { unsigned long pmd
; } pmd_t
;
26 #define pmd_val(x) ((&x)->pmd)
27 #define __pmd(x) ((pmd_t) { (x) } )
30 typedef struct { unsigned long pte
; } pte_t
;
31 typedef struct { unsigned long pgd
; } pgd_t
;
32 typedef struct { unsigned long pgprot
; } pgprot_t
;
34 #if defined(CONFIG_SUN3)
36 * Sun3 still uses the asm-generic/pgalloc.h code and thus needs this
37 * definition. It would be possible to unify Sun3 and ColdFire pgalloc and have
38 * all of m68k use the same type.
40 typedef struct page
*pgtable_t
;
42 typedef pte_t
*pgtable_t
;
45 #define pte_val(x) ((x).pte)
46 #define pgd_val(x) ((x).pgd)
47 #define pgprot_val(x) ((x).pgprot)
49 #define __pte(x) ((pte_t) { (x) } )
50 #define __pgd(x) ((pgd_t) { (x) } )
51 #define __pgprot(x) ((pgprot_t) { (x) } )
53 extern unsigned long _rambase
;
54 extern unsigned long _ramstart
;
55 extern unsigned long _ramend
;
57 #endif /* !__ASSEMBLY__ */
60 #include <asm/page_mm.h>
62 #include <asm/page_no.h>
65 #ifdef CONFIG_DISCONTIGMEM
66 #define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT))
67 #define __pfn_to_phys(pfn) PFN_PHYS(pfn)
70 #include <asm-generic/getorder.h>
72 #endif /* _M68K_PAGE_H */