aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs/spufs.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2007-12-20 02:39:59 -0500
committerPaul Mackerras <paulus@samba.org>2007-12-21 03:46:19 -0500
commit7cd58e43810852eeb7af5a0c803f3890bd08b581 (patch)
treed9ea5c0102d70c26c4a9b18aaf4db4e3b6d48fc1 /arch/powerpc/platforms/cell/spufs/spufs.h
parent9b1d21f858e8bad750ab19cac23dcbf79d099be3 (diff)
[POWERPC] spufs: move fault, lscsa_alloc and switch code to spufs module
Currently, part of the spufs code (switch.o, lscsa_alloc.o and fault.o) is compiled directly into the kernel. This change moves these components of spufs into the kernel. The lscsa and switch objects are fairly straightforward to move in. For the fault.o module, we split the fault-handling code into two parts: a/p/p/c/spu_fault.c and a/p/p/c/spufs/fault.c. The former is for the in-kernel spu_handle_mm_fault function, and we move the rest of the fault-handling code into spufs. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/spufs.h')
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h47
1 files changed, 11 insertions, 36 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 5e92ad32cc9..cce50f317c7 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -307,41 +307,16 @@ struct spufs_coredump_reader {
307extern struct spufs_coredump_reader spufs_coredump_read[]; 307extern struct spufs_coredump_reader spufs_coredump_read[];
308extern int spufs_coredump_num_notes; 308extern int spufs_coredump_num_notes;
309 309
310/* 310extern int spu_init_csa(struct spu_state *csa);
311 * This function is a little bit too large for an inline, but 311extern void spu_fini_csa(struct spu_state *csa);
312 * as fault.c is built into the kernel we can't move it out of 312extern int spu_save(struct spu_state *prev, struct spu *spu);
313 * line. 313extern int spu_restore(struct spu_state *new, struct spu *spu);
314 */ 314extern int spu_switch(struct spu_state *prev, struct spu_state *new,
315static inline void spuctx_switch_state(struct spu_context *ctx, 315 struct spu *spu);
316 enum spu_utilization_state new_state) 316extern int spu_alloc_lscsa(struct spu_state *csa);
317{ 317extern void spu_free_lscsa(struct spu_state *csa);
318 unsigned long long curtime; 318
319 signed long long delta; 319extern void spuctx_switch_state(struct spu_context *ctx,
320 struct timespec ts; 320 enum spu_utilization_state new_state);
321 struct spu *spu;
322 enum spu_utilization_state old_state;
323
324 ktime_get_ts(&ts);
325 curtime = timespec_to_ns(&ts);
326 delta = curtime - ctx->stats.tstamp;
327
328 WARN_ON(!mutex_is_locked(&ctx->state_mutex));
329 WARN_ON(delta < 0);
330
331 spu = ctx->spu;
332 old_state = ctx->stats.util_state;
333 ctx->stats.util_state = new_state;
334 ctx->stats.tstamp = curtime;
335
336 /*
337 * Update the physical SPU utilization statistics.
338 */
339 if (spu) {
340 ctx->stats.times[old_state] += delta;
341 spu->stats.times[old_state] += delta;
342 spu->stats.util_state = new_state;
343 spu->stats.tstamp = curtime;
344 }
345}
346 321
347#endif 322#endif