aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/spu.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-07-20 15:39:54 -0400
committerArnd Bergmann <arnd@klappe.arndb.de>2007-07-20 15:42:28 -0400
commit486acd4850dde6d2f8c7f431432f3914c4bfb5f5 (patch)
tree610d93bad54ca3626a55ae78c9cde4a302aecc45 /include/asm-powerpc/spu.h
parent1474855d0878cced6f39f51f3c2bd7428b44cb1e (diff)
[CELL] spufs: rework list management and associated locking
This sorts out the various lists and related locks in the spu code. In detail: - the per-node free_spus and active_list are gone. Instead struct spu gained an alloc_state member telling whether the spu is free or not - the per-node spus array is now locked by a per-node mutex, which takes over from the global spu_lock and the per-node active_mutex - the spu_alloc* and spu_free function are gone as the state change is now done inline in the spufs code. This allows some more sharing of code for the affinity vs normal case and more efficient locking - some little refactoring in the affinity code for this locking scheme Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'include/asm-powerpc/spu.h')
-rw-r--r--include/asm-powerpc/spu.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index a0f7fc8e23bb..8836c0f1f2f7 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -121,10 +121,9 @@ struct spu {
121 unsigned long problem_phys; 121 unsigned long problem_phys;
122 struct spu_problem __iomem *problem; 122 struct spu_problem __iomem *problem;
123 struct spu_priv2 __iomem *priv2; 123 struct spu_priv2 __iomem *priv2;
124 struct list_head list;
125 struct list_head cbe_list; 124 struct list_head cbe_list;
126 struct list_head sched_list;
127 struct list_head full_list; 125 struct list_head full_list;
126 enum { SPU_FREE, SPU_USED } alloc_state;
128 int number; 127 int number;
129 unsigned int irqs[3]; 128 unsigned int irqs[3];
130 u32 node; 129 u32 node;
@@ -187,18 +186,16 @@ struct spu {
187}; 186};
188 187
189struct cbe_spu_info { 188struct cbe_spu_info {
189 struct mutex list_mutex;
190 struct list_head spus; 190 struct list_head spus;
191 struct list_head free_spus;
192 int n_spus; 191 int n_spus;
192 int nr_active;
193 atomic_t reserved_spus; 193 atomic_t reserved_spus;
194}; 194};
195 195
196extern struct cbe_spu_info cbe_spu_info[]; 196extern struct cbe_spu_info cbe_spu_info[];
197 197
198struct spu *spu_alloc(void); 198void spu_init_channels(struct spu *spu);
199struct spu *spu_alloc_node(int node);
200struct spu *spu_alloc_spu(struct spu *spu);
201void spu_free(struct spu *spu);
202int spu_irq_class_0_bottom(struct spu *spu); 199int spu_irq_class_0_bottom(struct spu *spu);
203int spu_irq_class_1_bottom(struct spu *spu); 200int spu_irq_class_1_bottom(struct spu *spu);
204void spu_irq_setaffinity(struct spu *spu, int cpu); 201void spu_irq_setaffinity(struct spu *spu, int cpu);