This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [RFC 0/4] cell offloaded stdio
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: jschopp <jschopp at austin dot ibm dot com>
- Cc: newlib at sources dot redhat dot com
- Date: Thu, 19 Oct 2006 17:33:28 -0400
- Subject: Re: [RFC 0/4] cell offloaded stdio
- References: <4536AAE7.9000400@austin.ibm.com>
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.