30 #include <spu_mfcio.h>
37 #define min(a,b) (((a)<(b))?(a):(b))
38 #define max(a,b) (((a)>(b))?(a):(b))
61 mfc_get(&cmd, program_data_ea,
sizeof(cmd), 0, 0, 0);
62 mfc_write_tag_mask(1<<0);
63 mfc_read_tag_status_all();
68 datatype = cmd.data.INIT.datatype;
69 if(datatype < 0 || datatype > 4) {
74 incDel = cmd.data.INIT.incDel;
94 if(
profile != NULL || datatype == -1)
return -1;
98 ls1 = cmd.data.CREATE_PROFILE.query.len;
110 mfc_write_tag_mask((1<<0)|(1<<1));
111 mfc_read_tag_status_all();
127 printf(
">>>> creating profile\n");
133 if(
profile == NULL ||
s1 == NULL)
return -1;
141 cmd.data.PUT_PROFILE.blockSize =
blockSize;
153 mfc_write_tag_mask(1<<0);
154 mfc_read_tag_status_all();
159 mfc_put(&cmd, program_data_ea,
sizeof(cmd), 0, 0, 0);
160 mfc_write_tag_mask(1<<0);
161 mfc_read_tag_status_all();
165 if(datatype == -1 ||
profile != NULL)
return -1;
170 ls1 = cmd.data.GET_PROFILE.profile.len;
171 blockSize = cmd.data.GET_PROFILE.profile.blockSize;
187 mfc_write_tag_mask(1<<0);
188 mfc_read_tag_status_all();
195 ls2 = cmd.data.ALIGN.db.len;
199 mfc_get(
s2+i, cmd.data.ALIGN.db.addr+i, ALIGN16(
min(ls2-i,
MAX_TRANSFER)*
sizeof(
char)), 0, 0, 0 );
200 mfc_write_tag_mask(1<<0);
201 mfc_read_tag_status_all();
208 printf(
">>>> creating profile\n");
220 mfc_write_tag_mask(1<<0);
221 mfc_read_tag_status_all();
229 mfc_put(&cmd, program_data_ea,
sizeof(cmd), 0, 0, 0);
230 mfc_write_tag_mask(1<<0);
231 mfc_read_tag_status_all();
243 ppu_addr_t program_data_ea = spu_read_in_mbox();
244 program_data_ea += ((
ppu_addr_t)spu_read_in_mbox())<<32;
247 spu_write_out_intr_mbox( res );