diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-11-01 09:38:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-11-01 09:38:20 -0500 |
commit | 4b1c46a383aafc137bc91a0f9698bfc11e062d1b (patch) | |
tree | dd8b793c534b6f83cc16f38ba96d0ff4722a7344 /include | |
parent | 30574b61611ccd29677989097f8c8a5d9a73d873 (diff) | |
parent | 4393c4f6788cee65095dd838cfeca6edefbfeb52 (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
[POWERPC] Make alignment exception always check exception table
[POWERPC] Disallow kprobes on emulate_step and branch_taken
[POWERPC] Make mmiowb's io_sync preempt safe
[POWERPC] Make high hugepage areas preempt safe
[POWERPC] Make current preempt-safe
[POWERPC] qe_lib: qe_issue_cmd writes wrong value to CECDR
[POWERPC] Use 4kB iommu pages even on 64kB-page systems
[POWERPC] Fix oprofile support for e500 in arch/powerpc
[POWERPC] Fix rmb() for e500-based machines it
[POWERPC] Fix various offb issues
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/current.h | 12 | ||||
-rw-r--r-- | include/asm-powerpc/io.h | 7 | ||||
-rw-r--r-- | include/asm-powerpc/iommu.h | 22 | ||||
-rw-r--r-- | include/asm-powerpc/oprofile_impl.h | 87 | ||||
-rw-r--r-- | include/asm-powerpc/pmc.h | 13 | ||||
-rw-r--r-- | include/asm-powerpc/system.h | 6 | ||||
-rw-r--r-- | include/asm-powerpc/tce.h | 3 |
7 files changed, 126 insertions, 24 deletions
diff --git a/include/asm-powerpc/current.h b/include/asm-powerpc/current.h index 1938d6abd255..b8708aedf925 100644 --- a/include/asm-powerpc/current.h +++ b/include/asm-powerpc/current.h | |||
@@ -14,7 +14,17 @@ struct task_struct; | |||
14 | #ifdef __powerpc64__ | 14 | #ifdef __powerpc64__ |
15 | #include <asm/paca.h> | 15 | #include <asm/paca.h> |
16 | 16 | ||
17 | #define current (get_paca()->__current) | 17 | static inline struct task_struct *get_current(void) |
18 | { | ||
19 | struct task_struct *task; | ||
20 | |||
21 | __asm__ __volatile__("ld %0,%1(13)" | ||
22 | : "=r" (task) | ||
23 | : "i" (offsetof(struct paca_struct, __current))); | ||
24 | |||
25 | return task; | ||
26 | } | ||
27 | #define current get_current() | ||
18 | 28 | ||
19 | #else | 29 | #else |
20 | 30 | ||
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index 3baff8b0fd5a..c2c5f14b5f5f 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
@@ -163,8 +163,11 @@ extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count); | |||
163 | 163 | ||
164 | static inline void mmiowb(void) | 164 | static inline void mmiowb(void) |
165 | { | 165 | { |
166 | __asm__ __volatile__ ("sync" : : : "memory"); | 166 | unsigned long tmp; |
167 | get_paca()->io_sync = 0; | 167 | |
168 | __asm__ __volatile__("sync; li %0,0; stb %0,%1(13)" | ||
169 | : "=&r" (tmp) : "i" (offsetof(struct paca_struct, io_sync)) | ||
170 | : "memory"); | ||
168 | } | 171 | } |
169 | 172 | ||
170 | /* | 173 | /* |
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h index a5e98641a2ae..39fad685ffab 100644 --- a/include/asm-powerpc/iommu.h +++ b/include/asm-powerpc/iommu.h | |||
@@ -22,17 +22,35 @@ | |||
22 | #define _ASM_IOMMU_H | 22 | #define _ASM_IOMMU_H |
23 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
24 | 24 | ||
25 | #include <asm/types.h> | 25 | #include <linux/compiler.h> |
26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
28 | #include <linux/dma-mapping.h> | 28 | #include <linux/dma-mapping.h> |
29 | #include <asm/types.h> | ||
30 | #include <asm/bitops.h> | ||
31 | |||
32 | #define IOMMU_PAGE_SHIFT 12 | ||
33 | #define IOMMU_PAGE_SIZE (ASM_CONST(1) << IOMMU_PAGE_SHIFT) | ||
34 | #define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1)) | ||
35 | #define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE) | ||
36 | |||
37 | #ifndef __ASSEMBLY__ | ||
38 | |||
39 | /* Pure 2^n version of get_order */ | ||
40 | static __inline__ __attribute_const__ int get_iommu_order(unsigned long size) | ||
41 | { | ||
42 | return __ilog2((size - 1) >> IOMMU_PAGE_SHIFT) + 1; | ||
43 | } | ||
44 | |||
45 | #endif /* __ASSEMBLY__ */ | ||
46 | |||
29 | 47 | ||
30 | /* | 48 | /* |
31 | * IOMAP_MAX_ORDER defines the largest contiguous block | 49 | * IOMAP_MAX_ORDER defines the largest contiguous block |
32 | * of dma space we can get. IOMAP_MAX_ORDER = 13 | 50 | * of dma space we can get. IOMAP_MAX_ORDER = 13 |
33 | * allows up to 2**12 pages (4096 * 4096) = 16 MB | 51 | * allows up to 2**12 pages (4096 * 4096) = 16 MB |
34 | */ | 52 | */ |
35 | #define IOMAP_MAX_ORDER 13 | 53 | #define IOMAP_MAX_ORDER 13 |
36 | 54 | ||
37 | struct iommu_table { | 55 | struct iommu_table { |
38 | unsigned long it_busno; /* Bus number this table belongs to */ | 56 | unsigned long it_busno; /* Bus number this table belongs to */ |
diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h index 5b33994cd488..07a10e590c1d 100644 --- a/include/asm-powerpc/oprofile_impl.h +++ b/include/asm-powerpc/oprofile_impl.h | |||
@@ -42,7 +42,7 @@ struct op_powerpc_model { | |||
42 | void (*reg_setup) (struct op_counter_config *, | 42 | void (*reg_setup) (struct op_counter_config *, |
43 | struct op_system_config *, | 43 | struct op_system_config *, |
44 | int num_counters); | 44 | int num_counters); |
45 | void (*cpu_setup) (void *); | 45 | void (*cpu_setup) (struct op_counter_config *); |
46 | void (*start) (struct op_counter_config *); | 46 | void (*start) (struct op_counter_config *); |
47 | void (*stop) (void); | 47 | void (*stop) (void); |
48 | void (*handle_interrupt) (struct pt_regs *, | 48 | void (*handle_interrupt) (struct pt_regs *, |
@@ -121,7 +121,90 @@ static inline void ctr_write(unsigned int i, unsigned int val) | |||
121 | break; | 121 | break; |
122 | } | 122 | } |
123 | } | 123 | } |
124 | #endif /* !CONFIG_FSL_BOOKE */ | 124 | #else /* CONFIG_FSL_BOOKE */ |
125 | static inline u32 get_pmlca(int ctr) | ||
126 | { | ||
127 | u32 pmlca; | ||
128 | |||
129 | switch (ctr) { | ||
130 | case 0: | ||
131 | pmlca = mfpmr(PMRN_PMLCA0); | ||
132 | break; | ||
133 | case 1: | ||
134 | pmlca = mfpmr(PMRN_PMLCA1); | ||
135 | break; | ||
136 | case 2: | ||
137 | pmlca = mfpmr(PMRN_PMLCA2); | ||
138 | break; | ||
139 | case 3: | ||
140 | pmlca = mfpmr(PMRN_PMLCA3); | ||
141 | break; | ||
142 | default: | ||
143 | panic("Bad ctr number\n"); | ||
144 | } | ||
145 | |||
146 | return pmlca; | ||
147 | } | ||
148 | |||
149 | static inline void set_pmlca(int ctr, u32 pmlca) | ||
150 | { | ||
151 | switch (ctr) { | ||
152 | case 0: | ||
153 | mtpmr(PMRN_PMLCA0, pmlca); | ||
154 | break; | ||
155 | case 1: | ||
156 | mtpmr(PMRN_PMLCA1, pmlca); | ||
157 | break; | ||
158 | case 2: | ||
159 | mtpmr(PMRN_PMLCA2, pmlca); | ||
160 | break; | ||
161 | case 3: | ||
162 | mtpmr(PMRN_PMLCA3, pmlca); | ||
163 | break; | ||
164 | default: | ||
165 | panic("Bad ctr number\n"); | ||
166 | } | ||
167 | } | ||
168 | |||
169 | static inline unsigned int ctr_read(unsigned int i) | ||
170 | { | ||
171 | switch(i) { | ||
172 | case 0: | ||
173 | return mfpmr(PMRN_PMC0); | ||
174 | case 1: | ||
175 | return mfpmr(PMRN_PMC1); | ||
176 | case 2: | ||
177 | return mfpmr(PMRN_PMC2); | ||
178 | case 3: | ||
179 | return mfpmr(PMRN_PMC3); | ||
180 | default: | ||
181 | return 0; | ||
182 | } | ||
183 | } | ||
184 | |||
185 | static inline void ctr_write(unsigned int i, unsigned int val) | ||
186 | { | ||
187 | switch(i) { | ||
188 | case 0: | ||
189 | mtpmr(PMRN_PMC0, val); | ||
190 | break; | ||
191 | case 1: | ||
192 | mtpmr(PMRN_PMC1, val); | ||
193 | break; | ||
194 | case 2: | ||
195 | mtpmr(PMRN_PMC2, val); | ||
196 | break; | ||
197 | case 3: | ||
198 | mtpmr(PMRN_PMC3, val); | ||
199 | break; | ||
200 | default: | ||
201 | break; | ||
202 | } | ||
203 | } | ||
204 | |||
205 | |||
206 | #endif /* CONFIG_FSL_BOOKE */ | ||
207 | |||
125 | 208 | ||
126 | extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth); | 209 | extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth); |
127 | 210 | ||
diff --git a/include/asm-powerpc/pmc.h b/include/asm-powerpc/pmc.h index 07d6a4279319..8588be68e0ad 100644 --- a/include/asm-powerpc/pmc.h +++ b/include/asm-powerpc/pmc.h | |||
@@ -32,18 +32,5 @@ void release_pmc_hardware(void); | |||
32 | void power4_enable_pmcs(void); | 32 | void power4_enable_pmcs(void); |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #ifdef CONFIG_FSL_BOOKE | ||
36 | void init_pmc_stop(int ctr); | ||
37 | void set_pmc_event(int ctr, int event); | ||
38 | void set_pmc_user_kernel(int ctr, int user, int kernel); | ||
39 | void set_pmc_marked(int ctr, int mark0, int mark1); | ||
40 | void pmc_start_ctr(int ctr, int enable); | ||
41 | void pmc_start_ctrs(int enable); | ||
42 | void pmc_stop_ctrs(void); | ||
43 | void dump_pmcs(void); | ||
44 | |||
45 | extern struct op_powerpc_model op_model_fsl_booke; | ||
46 | #endif | ||
47 | |||
48 | #endif /* __KERNEL__ */ | 35 | #endif /* __KERNEL__ */ |
49 | #endif /* _POWERPC_PMC_H */ | 36 | #endif /* _POWERPC_PMC_H */ |
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index 43627596003b..f7b1227d6454 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -25,8 +25,8 @@ | |||
25 | * | 25 | * |
26 | * We have to use the sync instructions for mb(), since lwsync doesn't | 26 | * We have to use the sync instructions for mb(), since lwsync doesn't |
27 | * order loads with respect to previous stores. Lwsync is fine for | 27 | * order loads with respect to previous stores. Lwsync is fine for |
28 | * rmb(), though. Note that lwsync is interpreted as sync by | 28 | * rmb(), though. Note that rmb() actually uses a sync on 32-bit |
29 | * 32-bit and older 64-bit CPUs. | 29 | * architectures. |
30 | * | 30 | * |
31 | * For wmb(), we use sync since wmb is used in drivers to order | 31 | * For wmb(), we use sync since wmb is used in drivers to order |
32 | * stores to system memory with respect to writes to the device. | 32 | * stores to system memory with respect to writes to the device. |
@@ -34,7 +34,7 @@ | |||
34 | * SMP since it is only used to order updates to system memory. | 34 | * SMP since it is only used to order updates to system memory. |
35 | */ | 35 | */ |
36 | #define mb() __asm__ __volatile__ ("sync" : : : "memory") | 36 | #define mb() __asm__ __volatile__ ("sync" : : : "memory") |
37 | #define rmb() __asm__ __volatile__ ("lwsync" : : : "memory") | 37 | #define rmb() __asm__ __volatile__ (__stringify(LWSYNC) : : : "memory") |
38 | #define wmb() __asm__ __volatile__ ("sync" : : : "memory") | 38 | #define wmb() __asm__ __volatile__ ("sync" : : : "memory") |
39 | #define read_barrier_depends() do { } while(0) | 39 | #define read_barrier_depends() do { } while(0) |
40 | 40 | ||
diff --git a/include/asm-powerpc/tce.h b/include/asm-powerpc/tce.h index c9483adbf599..f663634cccc9 100644 --- a/include/asm-powerpc/tce.h +++ b/include/asm-powerpc/tce.h | |||
@@ -22,6 +22,8 @@ | |||
22 | #define _ASM_POWERPC_TCE_H | 22 | #define _ASM_POWERPC_TCE_H |
23 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
24 | 24 | ||
25 | #include <asm/iommu.h> | ||
26 | |||
25 | /* | 27 | /* |
26 | * Tces come in two formats, one for the virtual bus and a different | 28 | * Tces come in two formats, one for the virtual bus and a different |
27 | * format for PCI | 29 | * format for PCI |
@@ -33,7 +35,6 @@ | |||
33 | 35 | ||
34 | #define TCE_SHIFT 12 | 36 | #define TCE_SHIFT 12 |
35 | #define TCE_PAGE_SIZE (1 << TCE_SHIFT) | 37 | #define TCE_PAGE_SIZE (1 << TCE_SHIFT) |
36 | #define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT) | ||
37 | 38 | ||
38 | #define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */ | 39 | #define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */ |
39 | 40 | ||