aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/spu.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2006-01-04 14:31:30 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-08 23:44:49 -0500
commitf0831acc4b78e2d9737e8ed91b8b7505b21ddb83 (patch)
tree0c901e45cdc932776d3953cfcdf66015d6853bec /include/asm-powerpc/spu.h
parentce8ab8541203f6c7be5b2eeaa97f14f1d8d44e4f (diff)
[PATCH] spufs: abstract priv1 register access.
In a hypervisor based setup, direct access to the first priviledged register space can typically not be allowed to the kernel and has to be implemented through hypervisor calls. As suggested by Masato Noguchi, let's abstract the register access trough a number of function calls. Since there is currently no public specification of actual hypervisor calls to implement this, I only provide a place that makes it easier to hook into. Cc: Masato Noguchi <Masato.Noguchi@jp.sony.com> Cc: Geoff Levand <geoff.levand@am.sony.com> Signed-off-by: Arnd Bergmann <arndb@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/spu.h')
-rw-r--r--include/asm-powerpc/spu.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index 6b2aea0f6f20..3bf6a502aeaf 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -172,6 +172,29 @@ static inline void unregister_spu_syscalls(struct spufs_calls *calls)
172#endif /* MODULE */ 172#endif /* MODULE */
173 173
174 174
175/* access to priv1 registers */
176void spu_int_mask_and(struct spu *spu, int class, u64 mask);
177void spu_int_mask_or(struct spu *spu, int class, u64 mask);
178void spu_int_mask_set(struct spu *spu, int class, u64 mask);
179u64 spu_int_mask_get(struct spu *spu, int class);
180void spu_int_stat_clear(struct spu *spu, int class, u64 stat);
181u64 spu_int_stat_get(struct spu *spu, int class);
182void spu_int_route_set(struct spu *spu, u64 route);
183u64 spu_mfc_dar_get(struct spu *spu);
184u64 spu_mfc_dsisr_get(struct spu *spu);
185void spu_mfc_dsisr_set(struct spu *spu, u64 dsisr);
186void spu_mfc_sdr_set(struct spu *spu, u64 sdr);
187void spu_mfc_sr1_set(struct spu *spu, u64 sr1);
188u64 spu_mfc_sr1_get(struct spu *spu);
189void spu_mfc_tclass_id_set(struct spu *spu, u64 tclass_id);
190u64 spu_mfc_tclass_id_get(struct spu *spu);
191void spu_tlb_invalidate(struct spu *spu);
192void spu_resource_allocation_groupID_set(struct spu *spu, u64 id);
193u64 spu_resource_allocation_groupID_get(struct spu *spu);
194void spu_resource_allocation_enable_set(struct spu *spu, u64 enable);
195u64 spu_resource_allocation_enable_get(struct spu *spu);
196
197
175/* 198/*
176 * This defines the Local Store, Problem Area and Privlege Area of an SPU. 199 * This defines the Local Store, Problem Area and Privlege Area of an SPU.
177 */ 200 */
@@ -379,25 +402,21 @@ struct spu_priv1 {
379 402
380 403
381 /* Interrupt Area */ 404 /* Interrupt Area */
382 u64 int_mask_class0_RW; /* 0x100 */ 405 u64 int_mask_RW[3]; /* 0x100 */
383#define CLASS0_ENABLE_DMA_ALIGNMENT_INTR 0x1L 406#define CLASS0_ENABLE_DMA_ALIGNMENT_INTR 0x1L
384#define CLASS0_ENABLE_INVALID_DMA_COMMAND_INTR 0x2L 407#define CLASS0_ENABLE_INVALID_DMA_COMMAND_INTR 0x2L
385#define CLASS0_ENABLE_SPU_ERROR_INTR 0x4L 408#define CLASS0_ENABLE_SPU_ERROR_INTR 0x4L
386#define CLASS0_ENABLE_MFC_FIR_INTR 0x8L 409#define CLASS0_ENABLE_MFC_FIR_INTR 0x8L
387 u64 int_mask_class1_RW; /* 0x108 */
388#define CLASS1_ENABLE_SEGMENT_FAULT_INTR 0x1L 410#define CLASS1_ENABLE_SEGMENT_FAULT_INTR 0x1L
389#define CLASS1_ENABLE_STORAGE_FAULT_INTR 0x2L 411#define CLASS1_ENABLE_STORAGE_FAULT_INTR 0x2L
390#define CLASS1_ENABLE_LS_COMPARE_SUSPEND_ON_GET_INTR 0x4L 412#define CLASS1_ENABLE_LS_COMPARE_SUSPEND_ON_GET_INTR 0x4L
391#define CLASS1_ENABLE_LS_COMPARE_SUSPEND_ON_PUT_INTR 0x8L 413#define CLASS1_ENABLE_LS_COMPARE_SUSPEND_ON_PUT_INTR 0x8L
392 u64 int_mask_class2_RW; /* 0x110 */
393#define CLASS2_ENABLE_MAILBOX_INTR 0x1L 414#define CLASS2_ENABLE_MAILBOX_INTR 0x1L
394#define CLASS2_ENABLE_SPU_STOP_INTR 0x2L 415#define CLASS2_ENABLE_SPU_STOP_INTR 0x2L
395#define CLASS2_ENABLE_SPU_HALT_INTR 0x4L 416#define CLASS2_ENABLE_SPU_HALT_INTR 0x4L
396#define CLASS2_ENABLE_SPU_DMA_TAG_GROUP_COMPLETE_INTR 0x8L 417#define CLASS2_ENABLE_SPU_DMA_TAG_GROUP_COMPLETE_INTR 0x8L
397 u8 pad_0x118_0x140[0x28]; /* 0x118 */ 418 u8 pad_0x118_0x140[0x28]; /* 0x118 */
398 u64 int_stat_class0_RW; /* 0x140 */ 419 u64 int_stat_RW[3]; /* 0x140 */
399 u64 int_stat_class1_RW; /* 0x148 */
400 u64 int_stat_class2_RW; /* 0x150 */
401 u8 pad_0x158_0x180[0x28]; /* 0x158 */ 420 u8 pad_0x158_0x180[0x28]; /* 0x158 */
402 u64 int_route_RW; /* 0x180 */ 421 u64 int_route_RW; /* 0x180 */
403 422