[POWERPC] spufs: Read from signal files only if data is there
authorDwayne Grant McConnell <decimal@us.ibm.com>
Mon, 20 Nov 2006 17:45:01 +0000 (18:45 +0100)
committerPaul Mackerras <paulus@samba.org>
Mon, 4 Dec 2006 09:39:50 +0000 (20:39 +1100)
commit17f88cebc2c3aff9d90f0d49f6e0628835eddc32
treed22b5b04d4bd4d3cc2ab87dcee28918c2abbd2fa
parent69a2f00ce5d3a19a70b36f08eaf9049677277710
[POWERPC] spufs: Read from signal files only if data is there

We need to check the channel count of the signal notification registers
before reading them, because it can be undefined when the count is
zero. In order to read count and data atomically, we read from the
saved context.

This patch uses spu_acquire_saved() to force a context save before a
/signal1 or /signal2 read. Because of this it is no longer necessary to
have backing_ops and hw_ops versions of this function so they have been
removed.

Regular applications should not rely on reading this register
to be fast, as it's conceptually a write-only file from the PPE
perspective.

Signed-off-by: Dwayne Grant McConnell <decimal@us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/cell/spufs/file.c
arch/powerpc/platforms/cell/spufs/hw_ops.c