aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-m68knommu/page.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-m68knommu/page.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-m68knommu/page.h')
-rw-r--r--include/asm-m68knommu/page.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h
new file mode 100644
index 000000000000..05e03df0ec29
--- /dev/null
+++ b/include/asm-m68knommu/page.h
@@ -0,0 +1,95 @@
1#ifndef _M68KNOMMU_PAGE_H
2#define _M68KNOMMU_PAGE_H
3
4#include <linux/config.h>
5
6/* PAGE_SHIFT determines the page size */
7
8#define PAGE_SHIFT (12)
9#define PAGE_SIZE (1UL << PAGE_SHIFT)
10#define PAGE_MASK (~(PAGE_SIZE-1))
11
12#ifdef __KERNEL__
13
14#include <asm/setup.h>
15
16#ifndef __ASSEMBLY__
17
18#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
19#define free_user_page(page, addr) free_page(addr)
20
21#define clear_page(page) memset((page), 0, PAGE_SIZE)
22#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
23
24#define clear_user_page(page, vaddr, pg) clear_page(page)
25#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
26
27#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr)
28#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
29
30/*
31 * These are used to make use of C type-checking..
32 */
33typedef struct { unsigned long pte; } pte_t;
34typedef struct { unsigned long pmd[16]; } pmd_t;
35typedef struct { unsigned long pgd; } pgd_t;
36typedef struct { unsigned long pgprot; } pgprot_t;
37
38#define pte_val(x) ((x).pte)
39#define pmd_val(x) ((&x)->pmd[0])
40#define pgd_val(x) ((x).pgd)
41#define pgprot_val(x) ((x).pgprot)
42
43#define __pte(x) ((pte_t) { (x) } )
44#define __pmd(x) ((pmd_t) { (x) } )
45#define __pgd(x) ((pgd_t) { (x) } )
46#define __pgprot(x) ((pgprot_t) { (x) } )
47
48/* to align the pointer to the (next) page boundary */
49#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
50
51/* Pure 2^n version of get_order */
52extern __inline__ int get_order(unsigned long size)
53{
54 int order;
55
56 size = (size-1) >> (PAGE_SHIFT-1);
57 order = -1;
58 do {
59 size >>= 1;
60 order++;
61 } while (size);
62 return order;
63}
64
65extern unsigned long memory_start;
66extern unsigned long memory_end;
67
68#endif /* !__ASSEMBLY__ */
69
70#include <asm/page_offset.h>
71
72#define PAGE_OFFSET (PAGE_OFFSET_RAW)
73
74#ifndef __ASSEMBLY__
75
76#define __pa(vaddr) virt_to_phys((void *)vaddr)
77#define __va(paddr) phys_to_virt((unsigned long)paddr)
78
79#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
80#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
81
82#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
83#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
84
85#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn))
86#define page_to_pfn(page) virt_to_pfn(page_to_virt(page))
87
88#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
89 ((void *)(kaddr) < (void *)memory_end))
90
91#endif /* __ASSEMBLY__ */
92
93#endif /* __KERNEL__ */
94
95#endif /* _M68KNOMMU_PAGE_H */