From aa6d5b20254a21b69092dd839b70ee148303ef25 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 20 Jul 2007 21:39:44 +0200 Subject: [CELL] cell: add per BE structure with info about its SPUs Addition of a spufs-global "cbe_info" array. Each entry contains information about one Cell/B.E. node, namelly: * list of spus (both free and busy spus are in this list); * list of free spus (replacing the static spu_list from spu_base.c) * number of spus; * number of reserved (non scheduleable) spus. SPE affinity implementation actually requires only access to one spu per BE node (since it implements its own pointer to walk through the other spus of the ring) and the number of scheduleable spus (n_spus - non_sched_spus) However having this more general structure can be useful for other functionalities, concentrating per-cbe statistics / data. Signed-off-by: Andre Detsch Signed-off-by: Arnd Bergmann --- include/asm-powerpc/spu.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index 12442acdc76f..2f2fe9f1c097 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h @@ -122,6 +122,7 @@ struct spu { struct spu_problem __iomem *problem; struct spu_priv2 __iomem *priv2; struct list_head list; + struct list_head cbe_list; struct list_head sched_list; struct list_head full_list; int number; @@ -181,6 +182,15 @@ struct spu { } stats; }; +struct cbe_spu_info { + struct list_head spus; + struct list_head free_spus; + int n_spus; + atomic_t reserved_spus; +}; + +extern struct cbe_spu_info cbe_spu_info[]; + struct spu *spu_alloc(void); struct spu *spu_alloc_node(int node); void spu_free(struct spu *spu); -- cgit v1.2.2