21 #ifndef _SPU_CONTEXT_UTILS_H_
22 #define _SPU_CONTEXT_UTILS_H_
28 unsigned long long ull;
62 static struct spu_lscsa *
dummy = (
struct spu_lscsa *)0;
63 #define LSCSA_BYTE_OFFSET(_field) \
64 ((char *)(&(dummy->_field)) - (char *)(&(dummy->gprs[0].slot[0])))
65 #define LSCSA_QW_OFFSET(_field) (LSCSA_BYTE_OFFSET(_field) >> 4)
67 static inline void set_event_mask(
void)
69 unsigned int event_mask = 0;
76 spu_writech(SPU_WrEventMask, event_mask);
79 static inline void set_tag_mask(
void)
81 unsigned int tag_mask = 1;
88 spu_writech(MFC_WrTagMask, tag_mask);
91 static inline void build_dma_list(
addr64 lscsa_ea)
101 ea_low = lscsa_ea.
ui[1];
104 for (i = 0; i < 15; i++, ea_low += 16384) {
105 dma_list[
i].size = 16384;
106 dma_list[
i].ea_low = ea_low;
110 static inline void enqueue_putllc(
addr64 lscsa_ea)
113 unsigned int size = 128;
114 unsigned int tag_id = 0;
115 unsigned int cmd = 0xB4;
123 spu_writech(MFC_LSA, ls);
124 spu_writech(MFC_EAH, lscsa_ea.
ui[0]);
125 spu_writech(MFC_EAL, lscsa_ea.
ui[1]);
126 spu_writech(MFC_Size, size);
127 spu_writech(MFC_TagID, tag_id);
128 spu_writech(MFC_Cmd, cmd);
131 static inline void set_tag_update(
void)
133 unsigned int update_any = 1;
139 spu_writech(MFC_WrTagUpdate, update_any);
142 static inline void read_tag_status(
void)
148 spu_readch(MFC_RdTagStat);
151 static inline void read_llar_status(
void)
157 spu_readch(MFC_RdAtomicStat);