2 * Defines an spu hypervisor abstraction layer.
4 * Copyright 2006 Sony Corp.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #if !defined(_SPU_PRIV1_H)
22 #if defined(__KERNEL__)
26 /* access to priv1 registers */
30 void (*int_mask_and) (struct spu *spu, int class, u64 mask);
31 void (*int_mask_or) (struct spu *spu, int class, u64 mask);
32 void (*int_mask_set) (struct spu *spu, int class, u64 mask);
33 u64 (*int_mask_get) (struct spu *spu, int class);
34 void (*int_stat_clear) (struct spu *spu, int class, u64 stat);
35 u64 (*int_stat_get) (struct spu *spu, int class);
36 void (*cpu_affinity_set) (struct spu *spu, int cpu);
37 u64 (*mfc_dar_get) (struct spu *spu);
38 u64 (*mfc_dsisr_get) (struct spu *spu);
39 void (*mfc_dsisr_set) (struct spu *spu, u64 dsisr);
40 void (*mfc_sdr_set) (struct spu *spu, u64 sdr);
41 void (*mfc_sr1_set) (struct spu *spu, u64 sr1);
42 u64 (*mfc_sr1_get) (struct spu *spu);
43 void (*mfc_tclass_id_set) (struct spu *spu, u64 tclass_id);
44 u64 (*mfc_tclass_id_get) (struct spu *spu);
45 void (*tlb_invalidate) (struct spu *spu);
46 void (*resource_allocation_groupID_set) (struct spu *spu, u64 id);
47 u64 (*resource_allocation_groupID_get) (struct spu *spu);
48 void (*resource_allocation_enable_set) (struct spu *spu, u64 enable);
49 u64 (*resource_allocation_enable_get) (struct spu *spu);
52 extern const struct spu_priv1_ops* spu_priv1_ops;
55 spu_int_mask_and (struct spu *spu, int class, u64 mask)
57 spu_priv1_ops->int_mask_and(spu, class, mask);
61 spu_int_mask_or (struct spu *spu, int class, u64 mask)
63 spu_priv1_ops->int_mask_or(spu, class, mask);
67 spu_int_mask_set (struct spu *spu, int class, u64 mask)
69 spu_priv1_ops->int_mask_set(spu, class, mask);
73 spu_int_mask_get (struct spu *spu, int class)
75 return spu_priv1_ops->int_mask_get(spu, class);
79 spu_int_stat_clear (struct spu *spu, int class, u64 stat)
81 spu_priv1_ops->int_stat_clear(spu, class, stat);
85 spu_int_stat_get (struct spu *spu, int class)
87 return spu_priv1_ops->int_stat_get (spu, class);
91 spu_cpu_affinity_set (struct spu *spu, int cpu)
93 spu_priv1_ops->cpu_affinity_set(spu, cpu);
97 spu_mfc_dar_get (struct spu *spu)
99 return spu_priv1_ops->mfc_dar_get(spu);
103 spu_mfc_dsisr_get (struct spu *spu)
105 return spu_priv1_ops->mfc_dsisr_get(spu);
109 spu_mfc_dsisr_set (struct spu *spu, u64 dsisr)
111 spu_priv1_ops->mfc_dsisr_set(spu, dsisr);
115 spu_mfc_sdr_set (struct spu *spu, u64 sdr)
117 spu_priv1_ops->mfc_sdr_set(spu, sdr);
121 spu_mfc_sr1_set (struct spu *spu, u64 sr1)
123 spu_priv1_ops->mfc_sr1_set(spu, sr1);
127 spu_mfc_sr1_get (struct spu *spu)
129 return spu_priv1_ops->mfc_sr1_get(spu);
133 spu_mfc_tclass_id_set (struct spu *spu, u64 tclass_id)
135 spu_priv1_ops->mfc_tclass_id_set(spu, tclass_id);
139 spu_mfc_tclass_id_get (struct spu *spu)
141 return spu_priv1_ops->mfc_tclass_id_get(spu);
145 spu_tlb_invalidate (struct spu *spu)
147 spu_priv1_ops->tlb_invalidate(spu);
151 spu_resource_allocation_groupID_set (struct spu *spu, u64 id)
153 spu_priv1_ops->resource_allocation_groupID_set(spu, id);
157 spu_resource_allocation_groupID_get (struct spu *spu)
159 return spu_priv1_ops->resource_allocation_groupID_get(spu);
163 spu_resource_allocation_enable_set (struct spu *spu, u64 enable)
165 spu_priv1_ops->resource_allocation_enable_set(spu, enable);
169 spu_resource_allocation_enable_get (struct spu *spu)
171 return spu_priv1_ops->resource_allocation_enable_get(spu);
174 /* The declarations folowing are put here for convenience
175 * and only intended to be used by the platform setup code
176 * for initializing spu_priv1_ops.
179 extern const struct spu_priv1_ops spu_priv1_mmio_ops;
181 #endif /* __KERNEL__ */