2 * access to SPU privileged registers
4 #include <linux/module.h>
9 void spu_int_mask_and(struct spu
*spu
, int class, u64 mask
)
13 old_mask
= in_be64(&spu
->priv1
->int_mask_RW
[class]);
14 out_be64(&spu
->priv1
->int_mask_RW
[class], old_mask
& mask
);
16 EXPORT_SYMBOL_GPL(spu_int_mask_and
);
18 void spu_int_mask_or(struct spu
*spu
, int class, u64 mask
)
22 old_mask
= in_be64(&spu
->priv1
->int_mask_RW
[class]);
23 out_be64(&spu
->priv1
->int_mask_RW
[class], old_mask
| mask
);
25 EXPORT_SYMBOL_GPL(spu_int_mask_or
);
27 void spu_int_mask_set(struct spu
*spu
, int class, u64 mask
)
29 out_be64(&spu
->priv1
->int_mask_RW
[class], mask
);
31 EXPORT_SYMBOL_GPL(spu_int_mask_set
);
33 u64
spu_int_mask_get(struct spu
*spu
, int class)
35 return in_be64(&spu
->priv1
->int_mask_RW
[class]);
37 EXPORT_SYMBOL_GPL(spu_int_mask_get
);
39 void spu_int_stat_clear(struct spu
*spu
, int class, u64 stat
)
41 out_be64(&spu
->priv1
->int_stat_RW
[class], stat
);
43 EXPORT_SYMBOL_GPL(spu_int_stat_clear
);
45 u64
spu_int_stat_get(struct spu
*spu
, int class)
47 return in_be64(&spu
->priv1
->int_stat_RW
[class]);
49 EXPORT_SYMBOL_GPL(spu_int_stat_get
);
51 void spu_int_route_set(struct spu
*spu
, u64 route
)
53 out_be64(&spu
->priv1
->int_route_RW
, route
);
55 EXPORT_SYMBOL_GPL(spu_int_route_set
);
57 u64
spu_mfc_dar_get(struct spu
*spu
)
59 return in_be64(&spu
->priv1
->mfc_dar_RW
);
61 EXPORT_SYMBOL_GPL(spu_mfc_dar_get
);
63 u64
spu_mfc_dsisr_get(struct spu
*spu
)
65 return in_be64(&spu
->priv1
->mfc_dsisr_RW
);
67 EXPORT_SYMBOL_GPL(spu_mfc_dsisr_get
);
69 void spu_mfc_dsisr_set(struct spu
*spu
, u64 dsisr
)
71 out_be64(&spu
->priv1
->mfc_dsisr_RW
, dsisr
);
73 EXPORT_SYMBOL_GPL(spu_mfc_dsisr_set
);
75 void spu_mfc_sdr_set(struct spu
*spu
, u64 sdr
)
77 out_be64(&spu
->priv1
->mfc_sdr_RW
, sdr
);
79 EXPORT_SYMBOL_GPL(spu_mfc_sdr_set
);
81 void spu_mfc_sr1_set(struct spu
*spu
, u64 sr1
)
83 out_be64(&spu
->priv1
->mfc_sr1_RW
, sr1
);
85 EXPORT_SYMBOL_GPL(spu_mfc_sr1_set
);
87 u64
spu_mfc_sr1_get(struct spu
*spu
)
89 return in_be64(&spu
->priv1
->mfc_sr1_RW
);
91 EXPORT_SYMBOL_GPL(spu_mfc_sr1_get
);
93 void spu_mfc_tclass_id_set(struct spu
*spu
, u64 tclass_id
)
95 out_be64(&spu
->priv1
->mfc_tclass_id_RW
, tclass_id
);
97 EXPORT_SYMBOL_GPL(spu_mfc_tclass_id_set
);
99 u64
spu_mfc_tclass_id_get(struct spu
*spu
)
101 return in_be64(&spu
->priv1
->mfc_tclass_id_RW
);
103 EXPORT_SYMBOL_GPL(spu_mfc_tclass_id_get
);
105 void spu_tlb_invalidate(struct spu
*spu
)
107 out_be64(&spu
->priv1
->tlb_invalidate_entry_W
, 0ul);
109 EXPORT_SYMBOL_GPL(spu_tlb_invalidate
);
111 void spu_resource_allocation_groupID_set(struct spu
*spu
, u64 id
)
113 out_be64(&spu
->priv1
->resource_allocation_groupID_RW
, id
);
115 EXPORT_SYMBOL_GPL(spu_resource_allocation_groupID_set
);
117 u64
spu_resource_allocation_groupID_get(struct spu
*spu
)
119 return in_be64(&spu
->priv1
->resource_allocation_groupID_RW
);
121 EXPORT_SYMBOL_GPL(spu_resource_allocation_groupID_get
);
123 void spu_resource_allocation_enable_set(struct spu
*spu
, u64 enable
)
125 out_be64(&spu
->priv1
->resource_allocation_enable_RW
, enable
);
127 EXPORT_SYMBOL_GPL(spu_resource_allocation_enable_set
);
129 u64
spu_resource_allocation_enable_get(struct spu
*spu
)
131 return in_be64(&spu
->priv1
->resource_allocation_enable_RW
);
133 EXPORT_SYMBOL_GPL(spu_resource_allocation_enable_get
);