ia64/linux-2.6.18-xen.hg

view include/asm-m68k/mmu_context.h @ 452:c7ed6fe5dca0

kexec: dont initialise regions in reserve_memory()

There is no need to initialise efi_memmap_res and boot_param_res in
reserve_memory() for the initial xen domain as it is done in
machine_kexec_setup_resources() using values from the kexec hypercall.

Signed-off-by: Simon Horman <horms@verge.net.au>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 28 10:55:18 2008 +0000 (2008-02-28)
parents 831230e53067
children
line source
1 #ifndef __M68K_MMU_CONTEXT_H
2 #define __M68K_MMU_CONTEXT_H
5 static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
6 {
7 }
9 #ifndef CONFIG_SUN3
11 #include <asm/setup.h>
12 #include <asm/page.h>
13 #include <asm/pgalloc.h>
15 static inline int init_new_context(struct task_struct *tsk,
16 struct mm_struct *mm)
17 {
18 mm->context = virt_to_phys(mm->pgd);
19 return 0;
20 }
22 #define destroy_context(mm) do { } while(0)
24 static inline void switch_mm_0230(struct mm_struct *mm)
25 {
26 unsigned long crp[2] = {
27 0x80000000 | _PAGE_TABLE, mm->context
28 };
29 unsigned long tmp;
31 asm volatile (".chip 68030");
33 /* flush MC68030/MC68020 caches (they are virtually addressed) */
34 asm volatile (
35 "movec %%cacr,%0;"
36 "orw %1,%0; "
37 "movec %0,%%cacr"
38 : "=d" (tmp) : "di" (FLUSH_I_AND_D));
40 /* Switch the root pointer. For a 030-only kernel,
41 * avoid flushing the whole ATC, we only need to
42 * flush the user entries. The 68851 does this by
43 * itself. Avoid a runtime check here.
44 */
45 asm volatile (
46 #ifdef CPU_M68030_ONLY
47 "pmovefd %0,%%crp; "
48 "pflush #0,#4"
49 #else
50 "pmove %0,%%crp"
51 #endif
52 : : "m" (crp[0]));
54 asm volatile (".chip 68k");
55 }
57 static inline void switch_mm_0460(struct mm_struct *mm)
58 {
59 asm volatile (".chip 68040");
61 /* flush address translation cache (user entries) */
62 asm volatile ("pflushan");
64 /* switch the root pointer */
65 asm volatile ("movec %0,%%urp" : : "r" (mm->context));
67 if (CPU_IS_060) {
68 unsigned long tmp;
70 /* clear user entries in the branch cache */
71 asm volatile (
72 "movec %%cacr,%0; "
73 "orl %1,%0; "
74 "movec %0,%%cacr"
75 : "=d" (tmp): "di" (0x00200000));
76 }
78 asm volatile (".chip 68k");
79 }
81 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
82 {
83 if (prev != next) {
84 if (CPU_IS_020_OR_030)
85 switch_mm_0230(next);
86 else
87 switch_mm_0460(next);
88 }
89 }
91 #define deactivate_mm(tsk,mm) do { } while (0)
93 static inline void activate_mm(struct mm_struct *prev_mm,
94 struct mm_struct *next_mm)
95 {
96 next_mm->context = virt_to_phys(next_mm->pgd);
98 if (CPU_IS_020_OR_030)
99 switch_mm_0230(next_mm);
100 else
101 switch_mm_0460(next_mm);
102 }
104 #else /* CONFIG_SUN3 */
105 #include <asm/sun3mmu.h>
106 #include <linux/sched.h>
108 extern unsigned long get_free_context(struct mm_struct *mm);
109 extern void clear_context(unsigned long context);
111 /* set the context for a new task to unmapped */
112 static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
113 {
114 mm->context = SUN3_INVALID_CONTEXT;
115 return 0;
116 }
118 /* find the context given to this process, and if it hasn't already
119 got one, go get one for it. */
120 static inline void get_mmu_context(struct mm_struct *mm)
121 {
122 if(mm->context == SUN3_INVALID_CONTEXT)
123 mm->context = get_free_context(mm);
124 }
126 /* flush context if allocated... */
127 static inline void destroy_context(struct mm_struct *mm)
128 {
129 if(mm->context != SUN3_INVALID_CONTEXT)
130 clear_context(mm->context);
131 }
133 static inline void activate_context(struct mm_struct *mm)
134 {
135 get_mmu_context(mm);
136 sun3_put_context(mm->context);
137 }
139 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
140 {
141 activate_context(tsk->mm);
142 }
144 #define deactivate_mm(tsk,mm) do { } while (0)
146 static inline void activate_mm(struct mm_struct *prev_mm,
147 struct mm_struct *next_mm)
148 {
149 activate_context(next_mm);
150 }
152 #endif
153 #endif