[Cbe-oss-dev] bug in libspe1.2
Daniel Johansson
danjo133 at gmail.com
Wed Apr 25 04:03:18 EST 2007
Hello,
I have found a bug in the libspe1.2 in spu_mfcio.h that ships with sdk2.
These two defines on row 174 and 175:
#define mfc_ea2h(ea) (unsigned int)((unsigned long long)(ea)>>32)
#define mfc_ea2l(ea) (unsigned int)(ea)
They are used by all MFC DMA defines, i.e.
#define mfc_put(ls,ea,size,tag,tid,rid)spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_PUT_CMD))
etc.
The libspe documentation says that the main-memory address should be
sent as a void* but these defines treat the void* as a signed int,
this is a problem if the allocated array is larger than 2<<17, then
the allocation will be in 0xf??????? range and the resulting 64bit
address will be wrong.
Best regards, Daniel
More information about the cbe-oss-dev
mailing list