[PATCH v3] librt: fix mq_timed{send,receive} return instructions
Baruch Siach
baruch at tkos.co.il
Thu Nov 7 11:43:32 UTC 2013
Hi Bernhard,
On Thu, Nov 07, 2013 at 12:32:49PM +0100, Bernhard Reutner-Fischer wrote:
> On 7 November 2013 10:52, Baruch Siach <baruch at tkos.co.il> wrote:
> > Not all architectures use 'ret' as function return instruction. For example,
> > xtensa usually uses 'retw'. Use the ret_ERRVAL arch dependant macro instead.
> >
> > Signed-off-by: Baruch Siach <baruch at tkos.co.il>
> > ---
> > v3: Add a common ret_ERRVAL, and redefine for special archs (Bernhard
> > Reutner-Fischer)
> >
> > v2: Add ret_ERRVAL to architectures missing it as noted by Bernhard
> > Reutner-Fischer.
> > ---
> > libc/sysdeps/linux/arm/sysdep.h | 1 +
> > libc/sysdeps/linux/common/sysdep.h | 4 ++++
> > libc/sysdeps/linux/i386/sysdep.h | 2 --
> > libc/sysdeps/linux/ia64/sysdep.h | 1 -
> > libc/sysdeps/linux/mips/sysdep.h | 2 --
> > libc/sysdeps/linux/powerpc/powerpc32/sysdep.h | 1 +
> > libc/sysdeps/linux/powerpc/powerpc64/sysdep.h | 1 +
> > libc/sysdeps/linux/sh/sysdep.h | 2 --
> > libc/sysdeps/linux/x86_64/sysdep.h | 2 --
> > librt/mq_timedreceive.S | 2 +-
> > librt/mq_timedsend.S | 2 +-
> > 11 files changed, 9 insertions(+), 11 deletions(-)
>
> And where does e.g. xtensa pick that up?
xtensa defines ret_ERRVAL as 'retw' already, but the 'undef' is missing. I'll
add it in my next version of this patch.
> Can you commonize these, i.e. make sure that common/sysdep.h is
> included first, #defining unconditional the defaults, arches
> redefining stuff where they diverge.
> Then, as a second, follow-up fix librt to make use of the new ret_ERRVAL.
> Bonus points if you don't break any arch :)
OK. I can't promise anything about not breaking other archs, though, but I'll
try.
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
More information about the uClibc
mailing list