spufs platform dependent code

Geoff Levand geoffrey.levand at am.sony.com
Fri Jan 27 11:22:07 EST 2006


Arnd,

We need to consider how we will arrange the platform
dependent code in spufs.

First, we need to consider the run-time selection of
spu wrappers, etc. You seemed to think that a simple
comparison, as here, will be sufficient:

 if (firmware_has_feature(FW_FEATURE_HYPERVISOR))
 	hvcall_spu_get_irq_mask(spu->spu_magical_id, cls, &val);
 else
 	val = in_be64(&spu->priv1->int_stat_class0_RW + cls);

I see a problem in that in the general case, support for several
hypervisors and also 'raw hardware' will be compiled in.  I was
thinking it might work better to use an indirect call through a
pointer to a structure of function pointers.

 struct spu_ops *spu_ops;
 spu_ops->spu_get_irq_mask(spu->spu_magical_id, cls, &val);

The instance of the structure could be setup statically in
the platform code and the pointer set with a runtime check
or in the platform startup code.

Another point is that there is some platform dependent interrupt
and spu setup code in spu_base.c.  This needs to be moved
out and into a platform dependent file.  We currently have
spu_priv1.c with the platform dependent wrappers.  I
propose we rename spu_priv1.c to something
that hints that is the platform code for 'raw' access,
and move the platform code in spu_base.c to it.  Do you
have any recommended names, or any other suggestions?

-Geoff



More information about the Linuxppc64-dev mailing list