linux-mips
[Top] [All Lists]

Re: Build failure for R3000 DECstation

To: Ralf Baechle <ralf@oss.sgi.com>
Subject: Re: Build failure for R3000 DECstation
From: Harald Koerfgen <Harald.Koerfgen@home.ivm.de>
Date: Tue, 14 Nov 2000 22:30:17 +0100 (CET)
Cc: linux-mips@oss.sgi.com
In-reply-to: <20001113104735.A3253@bacchus.dhis.org>
Organization: none
Reply-to: Harald Koerfgen <Harald.Koerfgen@home.ivm.de>
Sender: owner-linux-mips@oss.sgi.com
On 13-Nov-00 Ralf Baechle wrote:
> The sysmips(MIPS_ATOMIC_SET, ...) implementation used to be completly broken.
> I fixed it for CPUs with ll/sc and left the part with ll/sc to others.
> 
> Obviously none of them seemed to care so now I'm doing the quick fix.
> Frankly, a syscall which shouldn't be used doesn't deserve more attention ...

Well, it seems as if there are people with a different opinion. Fresh from the
glibc CVS (libc/sysdeps/unix/sysv/linux/mips/sys/tas.h):

# if (_MIPS_ISA >= _MIPS_ISA_MIPS2)

_EXTERN_INLINE int
_test_and_set (int *p, int v) __THROW
{
[ll/sc implementation snipped]
}

# else /* !(_MIPS_ISA >= _MIPS_ISA_MIPS2) */

_EXTERN_INLINE int
_test_and_set (int *p, int v) __THROW
{
  return sysmips (MIPS_ATOMIC_SET, (int) p, v, 0);
}

# endif /* !(_MIPS_ISA >= _MIPS_ISA_MIPS2) */

Personally I like this more than a kernel ll/sc emulation. A syscall is likely
to be faster than at least two illegal instruction exceptions. If you're
concerned about binary compatibilty, the syscall should work on ISA>=2 CPUs as
well.

-- 
Regards,
Harald

<Prev in Thread] Current Thread [Next in Thread>