[RFC 0/4] cell offloaded stdio
Jeff Johnston
jjohnstn@redhat.com
Thu Oct 19 22:23:00 GMT 2006
jschopp wrote:
> These probably aren't ready for inclusion in the main cvs repository
> yet, but I would like some feedback on patch number 4. I'm also sending
> them out without changelogs and rebasing because others are using them
> and they include some bugfixes. They are very functional and have gone
> through a decent amount of testing.
>
> Patch number 4 attempts to solve the problem that on the cell spu the
> architecture dictates that FILE* is in fact an int, with stdout etc
> having predefined constant int values. Meanwhile newlib wants FILE* to
> be a real structure, with stdout etc just being set up during library
> init. This patch is a crude hack, but a very functional one.
>
> I'm of the opinion that after some minor cleanup and adding a changelog
> up these patches could be merged in. Then the long term solution to
> patch 4 is to split stdio.h into an architecture neutral bit and an
> architecture specific bit. This would allow the cell spu to get its int
> FILE*, and everyone else to not have any functional changes. Patch 4
> could then be reverted.
>
You mean like sys/stdio.h which is already included?
> But I wanted to get some feedback before I pursue this course of action,
> to save myself some time and potential frustration.
>
I would have advised just adding a special spe_send function for I/O
which passes the FILE pointer in and does the magic on the other side.
This saves you having to edit each and every file if you decide to
change the mechanism.
Remind me again why you are overriding all user-visible I/O functions
and not simply the underlying functions used internally by newlib (e.g.
__vfprintf_r which is used by the entire printf family of functions)?
For example, if a non stdio C function in newlib needs to do some I/O
internally for its purposes, it will call _xxxx_r routines which you
haven't overridden.
-- Jeff J.
More information about the Newlib
mailing list