[Cbe-oss-dev] [PATCH] libspe2 Fix signal type initialization

Kazunori Asayama asayama at sm.sony.co.jp
Thu Sep 27 12:43:09 EST 2007


"D. Herrendoerfer" <d.herrendoerfer at herrendoerfer.name> wrote:
> It was reported in the cell Forum, that the Implementation does
> the opposite of what the Documentation says, so we need to
> fix the kernel documentation and the libspe implementation.
> 

I don't think so. The current spufs implementation is consistent with
the current spufs spec document, and there is no need to fix any of
the kernel, libspe2 or documents:

--- arch/powerpc/platforms/cell/spufs/file.c ---
static void spufs_signal1_type_set(void *data, u64 val)
{
	struct spu_context *ctx = data;

	spu_acquire(ctx);
	ctx->ops->signal1_type_set(ctx, val);
	spu_release(ctx);
}

--- arch/powerpc/platforms/cell/spufs/backing_ops.c ---
static void spu_backing_signal1_type_set(struct spu_context *ctx, u64 val)
{
	u64 tmp;

	spin_lock(&ctx->csa.register_lock);
	tmp = ctx->csa.priv2.spu_cfg_RW;
	if (val)
		tmp |= 1;
	else
		tmp &= ~1;
	ctx->csa.priv2.spu_cfg_RW = tmp;
	spin_unlock(&ctx->csa.register_lock);
}

--- arch/powerpc/platforms/cell/spufs/hw_ops.c ---
static void spu_hw_signal1_type_set(struct spu_context *ctx, u64 val)
{
	struct spu *spu = ctx->spu;
	struct spu_priv2 __iomem *priv2 = spu->priv2;
	u64 tmp;

	spin_lock_irq(&spu->register_lock);
	tmp = in_be64(&priv2->spu_cfg_RW);
	if (val)
		tmp |= 1;
	else
		tmp &= ~1;
	out_be64(&priv2->spu_cfg_RW, tmp);
	spin_unlock_irq(&spu->register_lock);
}
---

And the CBEA spec says in the "SPU Configuration Register" section:

---
  0 Signal notification 1 mode is overwrite (POR default).
  1 Signal notification 1 mode is logical OR.
---


I.e., when the value "1" is written to the signal1_type node, the SNR
1 will enter "Or" mode.


I suppose that you are saying about the following article. Right ?

  http://www.ibm.com/developerworks/forums/dw_thread.jsp?forum=739&thread=175794&cat=46

I think that it is a bug of the ppu-gdb:

--- SDK 2.1 gdb/spu-tdep.c ---
      if (signal1_pending)
	printf_filtered (_("Signal 1 control word 0x%08llx (Type %s)\n"),
			 (unsigned long long) signal1,
			 signal1_type? "Overwrite" : "Or");
      else
	printf_filtered (_("Signal 1 not pending (Type %s)\n"),
			 signal1_type? "Overwrite" : "Or");

      if (signal2_pending)
	printf_filtered (_("Signal 2 control word 0x%08llx (Type %s)\n"),
			 (unsigned long long) signal2,
			 signal2_type? "Overwrite" : "Or");
      else
	printf_filtered (_("Signal 2 not pending (Type %s)\n"),
			 signal2_type? "Overwrite" : "Or");
---

The same problem still exists in the SDK 3.0 ER.

Ulrich, could you check that ?

---
(ASAYAMA Kazunori
  (asayama at sm.sony.co.jp))
t



More information about the cbe-oss-dev mailing list