This is the mail archive of the newlib@sources.redhat.com 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: [PATCH] Add support for scanf, gets in h8300 simulator


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


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