This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: Reentrancy support for multiprocessor systems
- From: "Likely, Grant" <Grant dot Likely at gdcanada dot com>
- To: "Newlib mailing list (E-mail)" <newlib at sources dot redhat dot com>
- Date: Tue, 18 Mar 2003 10:24:44 -0700
- Subject: Re: Reentrancy support for multiprocessor systems
What about for the back end BSP? The functions in libnosys put errno values
into the global definition of errno instead of using the macro. Is there a
way to make the library use reentrant versions of errno for BSP calls, or do
I need to replace _write_r, _read_r, etc with my own versions. If so, how
do I tell the library not to include the functions in libc/reent when
building?
If DYNAMIC_REENT could become an configuration option in a future release,
that would be wonderful. In the mean time I'll manage it as a patch.
Thanks,
g.
-----Original Message-----
From: J. Johnston [mailto:jjohnstn at redhat dot com]
Sent: Tuesday, March 18, 2003 9:59 AM
To: Likely, Grant
Cc: 'newlib at sources dot redhat dot com'
Subject: Re: Reentrancy support for multiprocessor systems
> Is it safe to modify the _impure_ptr pointer to be a macro that calls a
> function and returns the correct pointer? (just like the errno macro?)
Is
> there a better way to do this?
>
This is already done for you in libc/include/sys/reent.h. If you set the
__DYNAMIC_REENT__
flag on while compiling newlib, then all references to _REENT will call a
function __getreent(). You will need to supply a version of this function
that
can figure out which thread it is running under and pass back the
appropriate
reentrancy structure.
The flag currently must be set on manually and is meant to be set on in
either
configure.host or libc/include/sys/config.h but it could be modified to be a
newlib configuration option.
-- Jeff J.