[PATCH] Add support for scanf, gets in h8300 simulator
Thomas Fitzsimmons
fitzsim@redhat.com
Thu May 16 12:58:00 GMT 2002
On Thu, 2002-05-16 at 01:44, Dhananjay R. Deshpande wrote:
> Hi,
>
> >Syscalls are usually handled a little differently. Have you considered
> >keeping the O_SYSCALL macro as is, and passing the syscall number to the
> >simulator in a designated register or memory location? Then in the
> >simulator in compile.c, replace the sim_callback->write_stdout call with
> >a switch statement that calls the appropriate sim_callback based on the
> >contents of the "syscall" register.
>
> I had implemented it in the same way earlier but passing syscall number as parameter makes simulator incompatible with previous builds of toolchain. This is because the current implementation of _write syscall is not passing syscall number as parameter. Any suggestion about this?
>
This change would only make previous versions of newlib (and binaries
linked with them) incompatible with the new simulator. So people with
old binaries can either use an older simulator, or recompile newlib and
relink their programs. Either way, IMO it's not too much to ask in
return for new syscalls.
Alternatively, you could keep your O_SYSCALL_WRITE, and change your
O_SYSCALL_READ to O_SYSCALL_GENERIC. Then all new syscalls would use
the generic method, and old binaries would keep working.
Tom
--
Thomas Fitzsimmons
Red Hat Canada Limited e-mail: fitzsim@redhat.com
2323 Yonge Street, Suite 300
Toronto, ON M4P2C9
More information about the Newlib
mailing list