diff options
Diffstat (limited to 'include/asm-powerpc/spu_priv1.h')
-rw-r--r-- | include/asm-powerpc/spu_priv1.h | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/include/asm-powerpc/spu_priv1.h b/include/asm-powerpc/spu_priv1.h index 300c458b6d06..69dcb0c53884 100644 --- a/include/asm-powerpc/spu_priv1.h +++ b/include/asm-powerpc/spu_priv1.h | |||
@@ -21,12 +21,13 @@ | |||
21 | #define _SPU_PRIV1_H | 21 | #define _SPU_PRIV1_H |
22 | #if defined(__KERNEL__) | 22 | #if defined(__KERNEL__) |
23 | 23 | ||
24 | #include <linux/types.h> | ||
25 | |||
24 | struct spu; | 26 | struct spu; |
25 | 27 | ||
26 | /* access to priv1 registers */ | 28 | /* access to priv1 registers */ |
27 | 29 | ||
28 | struct spu_priv1_ops | 30 | struct spu_priv1_ops { |
29 | { | ||
30 | void (*int_mask_and) (struct spu *spu, int class, u64 mask); | 31 | void (*int_mask_and) (struct spu *spu, int class, u64 mask); |
31 | void (*int_mask_or) (struct spu *spu, int class, u64 mask); | 32 | void (*int_mask_or) (struct spu *spu, int class, u64 mask); |
32 | void (*int_mask_set) (struct spu *spu, int class, u64 mask); | 33 | void (*int_mask_set) (struct spu *spu, int class, u64 mask); |
@@ -37,7 +38,7 @@ struct spu_priv1_ops | |||
37 | u64 (*mfc_dar_get) (struct spu *spu); | 38 | u64 (*mfc_dar_get) (struct spu *spu); |
38 | u64 (*mfc_dsisr_get) (struct spu *spu); | 39 | u64 (*mfc_dsisr_get) (struct spu *spu); |
39 | void (*mfc_dsisr_set) (struct spu *spu, u64 dsisr); | 40 | void (*mfc_dsisr_set) (struct spu *spu, u64 dsisr); |
40 | void (*mfc_sdr_set) (struct spu *spu, u64 sdr); | 41 | void (*mfc_sdr_setup) (struct spu *spu); |
41 | void (*mfc_sr1_set) (struct spu *spu, u64 sr1); | 42 | void (*mfc_sr1_set) (struct spu *spu, u64 sr1); |
42 | u64 (*mfc_sr1_get) (struct spu *spu); | 43 | u64 (*mfc_sr1_get) (struct spu *spu); |
43 | void (*mfc_tclass_id_set) (struct spu *spu, u64 tclass_id); | 44 | void (*mfc_tclass_id_set) (struct spu *spu, u64 tclass_id); |
@@ -112,9 +113,9 @@ spu_mfc_dsisr_set (struct spu *spu, u64 dsisr) | |||
112 | } | 113 | } |
113 | 114 | ||
114 | static inline void | 115 | static inline void |
115 | spu_mfc_sdr_set (struct spu *spu, u64 sdr) | 116 | spu_mfc_sdr_setup (struct spu *spu) |
116 | { | 117 | { |
117 | spu_priv1_ops->mfc_sdr_set(spu, sdr); | 118 | spu_priv1_ops->mfc_sdr_setup(spu); |
118 | } | 119 | } |
119 | 120 | ||
120 | static inline void | 121 | static inline void |
@@ -171,12 +172,41 @@ spu_resource_allocation_enable_get (struct spu *spu) | |||
171 | return spu_priv1_ops->resource_allocation_enable_get(spu); | 172 | return spu_priv1_ops->resource_allocation_enable_get(spu); |
172 | } | 173 | } |
173 | 174 | ||
174 | /* The declarations folowing are put here for convenience | 175 | /* spu management abstraction */ |
175 | * and only intended to be used by the platform setup code | 176 | |
176 | * for initializing spu_priv1_ops. | 177 | struct spu_management_ops { |
178 | int (*enumerate_spus)(int (*fn)(void *data)); | ||
179 | int (*create_spu)(struct spu *spu, void *data); | ||
180 | int (*destroy_spu)(struct spu *spu); | ||
181 | }; | ||
182 | |||
183 | extern const struct spu_management_ops* spu_management_ops; | ||
184 | |||
185 | static inline int | ||
186 | spu_enumerate_spus (int (*fn)(void *data)) | ||
187 | { | ||
188 | return spu_management_ops->enumerate_spus(fn); | ||
189 | } | ||
190 | |||
191 | static inline int | ||
192 | spu_create_spu (struct spu *spu, void *data) | ||
193 | { | ||
194 | return spu_management_ops->create_spu(spu, data); | ||
195 | } | ||
196 | |||
197 | static inline int | ||
198 | spu_destroy_spu (struct spu *spu) | ||
199 | { | ||
200 | return spu_management_ops->destroy_spu(spu); | ||
201 | } | ||
202 | |||
203 | /* | ||
204 | * The declarations folowing are put here for convenience | ||
205 | * and only intended to be used by the platform setup code. | ||
177 | */ | 206 | */ |
178 | 207 | ||
179 | extern const struct spu_priv1_ops spu_priv1_mmio_ops; | 208 | extern const struct spu_priv1_ops spu_priv1_mmio_ops; |
209 | extern const struct spu_management_ops spu_management_of_ops; | ||
180 | 210 | ||
181 | #endif /* __KERNEL__ */ | 211 | #endif /* __KERNEL__ */ |
182 | #endif | 212 | #endif |