[PATCH] Add support for scanf, gets in h8300 simulator

Dhananjay R. Deshpande dhananjayd@kpit.com
Fri May 17 03:23:00 GMT 2002

> >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.

I have implemented this alternative. Submitting patch again in separate email.



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