[Cbe-oss-dev] [PATCH] cell: move SPU affinity init to spu_management_of_ops
Geert Uytterhoeven
Geert.Uytterhoeven at sonycom.com
Tue Aug 7 01:23:37 EST 2007
On Wed, 25 Jul 2007, Andre Detsch wrote:
> This patch moves affinity initialization code from spu_base.c to a
> new spu_management_of_ops function (init_affinity), which is empty
> in the case of PS3. This fixes a linking problem that was happening
> when compiling for PS3.
> --- linux-2.6.22.orig/arch/powerpc/platforms/ps3/spu.c
> +++ linux-2.6.22/arch/powerpc/platforms/ps3/spu.c
> @@ -426,12 +426,18 @@ static int ps3_disable_spu(struct spu_co
> return -ENOSYS;
> }
>
> +static int ps3_init_affinity(void)
> +{
> + return 0;
> +}
> +
> const struct spu_management_ops spu_management_ps3_ops = {
> .enumerate_spus = ps3_enumerate_spus,
> .create_spu = ps3_create_spu,
> .destroy_spu = ps3_destroy_spu,
> .enable_spu = ps3_enable_spu,
> .disable_spu = ps3_disable_spu,
> + .init_affinity = ps3_init_affinity,
What about just leaving it NULL here...
> ===================================================================
> --- linux-2.6.22.orig/include/asm-powerpc/spu_priv1.h
> +++ linux-2.6.22/include/asm-powerpc/spu_priv1.h
> @@ -215,6 +216,12 @@ spu_disable_spu (struct spu_context *ctx
> return spu_management_ops->disable_spu(ctx);
> }
>
> +static inline int
> +spu_init_affinity (void)
> +{
> + return spu_management_ops->init_affinity();
> +}
> +
... and checking for a non-NULL init_affinity pointer first here?
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven at sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
More information about the cbe-oss-dev
mailing list