aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/spu.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2006-10-04 11:26:14 -0400
committerPaul Mackerras <paulus@samba.org>2006-10-04 19:21:01 -0400
commit9add11daeee2f6d69f6b86237f197824332a4a3b (patch)
tree526daebd5cac297c288503fe4dafecd02c0f492e /include/asm-powerpc/spu.h
parent28347bce8a837258e737873a55d31f2f424a6ea6 (diff)
[POWERPC] spufs: implement error event delivery to user space
This tries to fix spufs so we have an interface closer to what is specified in the man page for events returned in the third argument of spu_run. Fortunately, libspe has never been using the returned contents of that register, as they were the same as the return code of spu_run (duh!). Unlike the specification that we never implemented correctly, we now require a SPU_CREATE_EVENTS_ENABLED flag passed to spu_create, in order to get the new behavior. When this flag is not passed, spu_run will simply ignore the third argument now. Signed-off-by: Arnd Bergmann <arnd.bergmann@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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index f6c0a95e8209..87cc21e21946 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -138,6 +138,7 @@ struct spu {
138 void (* ibox_callback)(struct spu *spu); 138 void (* ibox_callback)(struct spu *spu);
139 void (* stop_callback)(struct spu *spu); 139 void (* stop_callback)(struct spu *spu);
140 void (* mfc_callback)(struct spu *spu); 140 void (* mfc_callback)(struct spu *spu);
141 void (* dma_callback)(struct spu *spu, int type);
141 142
142 char irq_c0[8]; 143 char irq_c0[8];
143 char irq_c1[8]; 144 char irq_c1[8];
@@ -169,6 +170,19 @@ extern struct spufs_calls {
169 struct module *owner; 170 struct module *owner;
170} spufs_calls; 171} spufs_calls;
171 172
173/* return status from spu_run, same as in libspe */
174#define SPE_EVENT_DMA_ALIGNMENT 0x0008 /*A DMA alignment error */
175#define SPE_EVENT_SPE_ERROR 0x0010 /*An illegal instruction error*/
176#define SPE_EVENT_SPE_DATA_SEGMENT 0x0020 /*A DMA segmentation error */
177#define SPE_EVENT_SPE_DATA_STORAGE 0x0040 /*A DMA storage error */
178#define SPE_EVENT_INVALID_DMA 0x0800 /* Invalid MFC DMA */
179
180/*
181 * Flags for sys_spu_create.
182 */
183#define SPU_CREATE_EVENTS_ENABLED 0x0001
184#define SPU_CREATE_FLAG_ALL 0x0001 /* mask of all valid flags */
185
172#ifdef CONFIG_SPU_FS_MODULE 186#ifdef CONFIG_SPU_FS_MODULE
173int register_spu_syscalls(struct spufs_calls *calls); 187int register_spu_syscalls(struct spufs_calls *calls);
174void unregister_spu_syscalls(struct spufs_calls *calls); 188void unregister_spu_syscalls(struct spufs_calls *calls);