Commit 14881d2b authored by Russell King's avatar Russell King

[ARM] Move cpu_switch_mm() and cpu_get_pgd() to asm/proc-fns.h

parent 144b6300
...@@ -7,9 +7,6 @@ ...@@ -7,9 +7,6 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#ifndef __ASSEMBLY__
#include <asm/memory.h>
#include <asm/page.h> #include <asm/page.h>
struct mm_struct; struct mm_struct;
...@@ -64,16 +61,4 @@ extern struct processor { ...@@ -64,16 +61,4 @@ extern struct processor {
#define cpu_do_idle() processor._do_idle() #define cpu_do_idle() processor._do_idle()
#define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz) #define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz)
#define cpu_set_pte(ptep, pte) processor.set_pte(ptep, pte) #define cpu_set_pte(ptep, pte) processor.set_pte(ptep, pte)
#define cpu_do_switch_mm(pgd,mm) processor.switch_mm(pgd,mm)
#define cpu_switch_mm(pgd,mm) processor.switch_mm(__virt_to_phys((unsigned long)(pgd)),mm)
#define cpu_get_pgd() \
({ \
unsigned long pg; \
__asm__("mrc p15, 0, %0, c2, c0, 0" \
: "=r" (pg) : : "cc"); \
pg &= ~0x3fff; \
(pgd_t *)phys_to_virt(pg); \
})
#endif
...@@ -27,12 +27,9 @@ ...@@ -27,12 +27,9 @@
#define cpu_reset __cpu_fn(CPU_NAME,_reset) #define cpu_reset __cpu_fn(CPU_NAME,_reset)
#define cpu_do_idle __cpu_fn(CPU_NAME,_do_idle) #define cpu_do_idle __cpu_fn(CPU_NAME,_do_idle)
#define cpu_dcache_clean_area __cpu_fn(CPU_NAME,_dcache_clean_area) #define cpu_dcache_clean_area __cpu_fn(CPU_NAME,_dcache_clean_area)
#define cpu__switch_mm __cpu_fn(CPU_NAME,_switch_mm) #define cpu_do_switch_mm __cpu_fn(CPU_NAME,_switch_mm)
#define cpu_set_pte __cpu_fn(CPU_NAME,_set_pte) #define cpu_set_pte __cpu_fn(CPU_NAME,_set_pte)
#ifndef __ASSEMBLY__
#include <asm/memory.h>
#include <asm/page.h> #include <asm/page.h>
struct mm_struct; struct mm_struct;
...@@ -42,20 +39,6 @@ extern void cpu_proc_init(void); ...@@ -42,20 +39,6 @@ extern void cpu_proc_init(void);
extern void cpu_proc_fin(void); extern void cpu_proc_fin(void);
extern int cpu_do_idle(void); extern int cpu_do_idle(void);
extern void cpu_dcache_clean_area(void *, int); extern void cpu_dcache_clean_area(void *, int);
extern void cpu__switch_mm(unsigned long pgd_phys, struct mm_struct *mm); extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
extern void cpu_set_pte(pte_t *ptep, pte_t pte); extern void cpu_set_pte(pte_t *ptep, pte_t pte);
extern volatile void cpu_reset(unsigned long addr); extern volatile void cpu_reset(unsigned long addr);
#define cpu_switch_mm(pgd,mm) cpu__switch_mm(__virt_to_phys((unsigned long)(pgd)),mm)
#define cpu_get_pgd() \
({ \
unsigned long pg; \
__asm__("mrc p15, 0, %0, c2, c0, 0" \
: "=r" (pg) : : "cc"); \
pg &= ~0x3fff; \
(pgd_t *)phys_to_virt(pg); \
})
#endif
...@@ -148,11 +148,27 @@ ...@@ -148,11 +148,27 @@
# endif # endif
#endif #endif
#ifndef __ASSEMBLY__
#ifndef MULTI_CPU #ifndef MULTI_CPU
#include "asm/cpu-single.h" #include "asm/cpu-single.h"
#else #else
#include "asm/cpu-multi32.h" #include "asm/cpu-multi32.h"
#endif #endif
#include <asm/memory.h>
#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)
#define cpu_get_pgd() \
({ \
unsigned long pg; \
__asm__("mrc p15, 0, %0, c2, c0, 0" \
: "=r" (pg) : : "cc"); \
pg &= ~0x3fff; \
(pgd_t *)phys_to_virt(pg); \
})
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* __ASM_PROCFNS_H */ #endif /* __ASM_PROCFNS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment