This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC 0/3] Cell SPU offloaded stdio


jschopp <jschopp@austin.ibm.com> wrote:
> I'll have to try this myself soon.  But my initial impression is that you ended up with 
> FILE* being a pointer to a structure containing an int.  The problem is when you then pass 
> this on the stack to the ppe it will try to treat it as an int.  The end result is that 
> you end up having to do translation all over the place via the __sfp() function you made 
> which is really not very cheap or very clean.

No, that is not correct.

On PPE side, FILE*s are managed by C99 handlers in libspe by using a
table, and int (32bits) values, which associated with 'real' FILE*s on
PPE side by the handlers, are passed to/received from SPEs as 'pseudo'
FILE*s (FILE*s on PPE themselves are NOT passed to SPEs directly). See
the implementation of C99 handlers in libspe for details.

On SPE side, in my patches, such int values (i.e. 'pseudo' FILE*s) are
NOT translated at all. The function __sfp() is NOT a function to
translate FILE structure, but it is a function to allocate an SPE
specific FILE structure on SPE side, and it is called only when a new
FILE structure on SPE side is required; e.g. fopen(), tmpfile(), etc.

> I like most of the rest of it fine.  I'll have to think about the best way to address this 
> one issue and get back to you.

As mentioned above, I think that there is no issue as you are saying.
What do you think ?

Thanks,
--
(ASAYAMA Kazunori
  (asayama@sm.sony.co.jp))
t


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]