Go to the documentation of this file. 1 #ifndef _M68K_PAGE_MM_H
2 #define _M68K_PAGE_MM_H
6 #include <linux/compiler.h>
7 #include <asm/module.h>
9 #define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
10 #define free_user_page(page, addr) free_page(addr)
15 #ifdef CPU_M68040_OR_M68060_ONLY
22 "move16 %1@+,%0@+\n\t"
23 "move16 %1@+,%0@+\n\t"
26 :
"=a" (to),
"=a" (from),
"=d" (tmp)
27 :
"0" (to),
"1" (from) ,
"2" (
PAGE_SIZE / 32 - 1)
43 "move16 %2@+,%0@+\n\t"
48 :
"=a" (sp),
"=d" (tmp)
49 :
"a" (page),
"0" (sp),
54 #define clear_page(page) memset((page), 0, PAGE_SIZE)
55 #define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
58 #define clear_user_page(addr, vaddr, page) \
59 do { clear_page(addr); \
60 flush_dcache_page(page); \
62 #define copy_user_page(to, from, vaddr, page) \
63 do { copy_page(to, from); \
64 flush_dcache_page(page); \
71 #define WANT_PAGE_VIRTUAL
83 #define __pa(vaddr) ___pa((void *)(long)(vaddr))
84 static inline void *
__va(
unsigned long paddr)
97 #define __pa(x) ___pa((unsigned long)(x))
98 static inline unsigned long ___pa(
unsigned long x)
105 return (x+0x2000000);
108 static inline void *
__va(
unsigned long x)
116 return (
void *)(x-0x2000000);
126 #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
127 #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
131 #ifdef CONFIG_SINGLE_MEMORY_CHUNK
132 #define __virt_to_node(addr) (&pg_data_map[0])
148 #define __virt_to_node(addr) (pg_data_table[(unsigned long)(addr) >> __virt_to_node_shift()])
151 #define virt_to_page(addr) ({ \
152 pfn_to_page(virt_to_pfn(addr)); \
154 #define page_to_virt(page) ({ \
155 pfn_to_virt(page_to_pfn(page)); \
158 #define pfn_to_page(pfn) ({ \
159 unsigned long __pfn = (pfn); \
160 struct pglist_data *pgdat; \
161 pgdat = __virt_to_node((unsigned long)pfn_to_virt(__pfn)); \
162 pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn); \
164 #define page_to_pfn(_page) ({ \
165 const struct page *__p = (_page); \
166 struct pglist_data *pgdat; \
167 pgdat = &pg_data_map[page_to_nid(__p)]; \
168 ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \
171 #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
172 #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
176 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
177 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)