/* Reads/writes to various problem and priv2 registers require state changes, i.e. generate SPU events, modify channel counts, etc.  */
static void gen_spu_event(struct spu_context *ctx, u32 event)
/* Reads/writes to various problem and priv2 registers require state changes, i.e. generate SPU events, modify channel counts, etc.  */
static void gen_spu_event(struct spu_context *ctx, u32 event)
{
	u64 ch0_cnt;
	u64 ch0_data;
	u64 ch1_data;
	ch0_cnt = ctx->csa.spu_chnlcnt_RW[0];
	ch0_data = ctx->csa.spu_chnldata_RW[0];
	ch1_data = ctx->csa.spu_chnldata_RW[1];
	ctx->csa.spu_chnldata_RW[0] |= event;
	if ((ch0_cnt == 0) && !(ch0_data & event) && (ch1_data & event)) {
		ctx->csa.spu_chnlcnt_RW[0] = 1;
	}
}