aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc/page.h
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2007-08-27 17:29:53 -0400
committerPaul Mackerras <paulus@samba.org>2007-09-17 01:15:04 -0400
commite6b6e3ffb9ee8926f9f2f7dc9147df73e27d5828 (patch)
treeecda5a24187801c1ad46e0d9d90a9fc5f547a52b /include/asm-ppc/page.h
parent8237bf080e9ef6adc3f2adce26060722685bbb15 (diff)
[POWERPC] Remove APUS support from arch/ppc
Current status of APUS: - arch/powerpc/: removed in 2.6.23 - arch/ppc/: marked BROKEN since 2 years This therefore removes the remaining parts of APUS support from arch/ppc, include/asm-ppc, arch/powerpc and include/asm-powerpc. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc/page.h')
-rw-r--r--include/asm-ppc/page.h44
1 files changed, 2 insertions, 42 deletions
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h
index fe95c8258cf9..ad4c5a1bc9d6 100644
--- a/include/asm-ppc/page.h
+++ b/include/asm-ppc/page.h
@@ -97,62 +97,22 @@ extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
97extern void copy_user_page(void *to, void *from, unsigned long vaddr, 97extern void copy_user_page(void *to, void *from, unsigned long vaddr,
98 struct page *pg); 98 struct page *pg);
99 99
100#ifndef CONFIG_APUS
101#define PPC_MEMSTART 0 100#define PPC_MEMSTART 0
102#define PPC_PGSTART 0
103#define PPC_MEMOFFSET PAGE_OFFSET 101#define PPC_MEMOFFSET PAGE_OFFSET
104#else
105extern unsigned long ppc_memstart;
106extern unsigned long ppc_pgstart;
107extern unsigned long ppc_memoffset;
108#define PPC_MEMSTART ppc_memstart
109#define PPC_PGSTART ppc_pgstart
110#define PPC_MEMOFFSET ppc_memoffset
111#endif
112 102
113#if defined(CONFIG_APUS) && !defined(MODULE)
114/* map phys->virtual and virtual->phys for RAM pages */
115static inline unsigned long ___pa(unsigned long v)
116{
117 unsigned long p;
118 asm volatile ("1: addis %0, %1, %2;"
119 ".section \".vtop_fixup\",\"aw\";"
120 ".align 1;"
121 ".long 1b;"
122 ".previous;"
123 : "=r" (p)
124 : "b" (v), "K" (((-PAGE_OFFSET) >> 16) & 0xffff));
125
126 return p;
127}
128static inline void* ___va(unsigned long p)
129{
130 unsigned long v;
131 asm volatile ("1: addis %0, %1, %2;"
132 ".section \".ptov_fixup\",\"aw\";"
133 ".align 1;"
134 ".long 1b;"
135 ".previous;"
136 : "=r" (v)
137 : "b" (p), "K" (((PAGE_OFFSET) >> 16) & 0xffff));
138
139 return (void*) v;
140}
141#else
142#define ___pa(vaddr) ((vaddr)-PPC_MEMOFFSET) 103#define ___pa(vaddr) ((vaddr)-PPC_MEMOFFSET)
143#define ___va(paddr) ((paddr)+PPC_MEMOFFSET) 104#define ___va(paddr) ((paddr)+PPC_MEMOFFSET)
144#endif
145 105
146extern int page_is_ram(unsigned long pfn); 106extern int page_is_ram(unsigned long pfn);
147 107
148#define __pa(x) ___pa((unsigned long)(x)) 108#define __pa(x) ___pa((unsigned long)(x))
149#define __va(x) ((void *)(___va((unsigned long)(x)))) 109#define __va(x) ((void *)(___va((unsigned long)(x))))
150 110
151#define ARCH_PFN_OFFSET (PPC_PGSTART) 111#define ARCH_PFN_OFFSET 0
152#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 112#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
153#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT) 113#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
154 114
155#define pfn_valid(pfn) (((pfn) - PPC_PGSTART) < max_mapnr) 115#define pfn_valid(pfn) ((pfn) < max_mapnr)
156#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 116#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
157 117
158/* Pure 2^n version of get_order */ 118/* Pure 2^n version of get_order */