On Sat, Apr 07, 2001 at 12:55:24PM +0200, Maciej W. Rozycki wrote: > > You are right, of course. That's why glibc contains two versions of > _test_and_set() code. If compiled for MIPS I, glibc uses a syscall > (currently sysmips()), while for MIPS II and higher it uses inline > assembly code which makes use of LL/SC. > > That's exactly the way glibc does CPU-model-specific code for other > archs. The problem is that it is compile time - I would like to have a runtime version - Just export the existance of ll/sc to userspace somewhow. > > I've seen the hybrid proposal of having libc determine the LL/SC > > capability of the processor and either executing the instructions > > or doing the syscall as appropriate. While that would allow > > near-optimal performance on all systems, I find it troublesome, > > both on the principle that the OS should conceal hardware > > implementation details from the user, and on the practical basis > > that glibc is the last place I would want to put more CPU-specific > > cruft. But reasonable people can disagree. > > I don't like run-time detection either. The compile-time choice is > sufficient enough. The _test_and_set() library function already hides > implementation details from the user. It isnt sufficent as we need a glibc beeing able to run on old decstations AND on newer machines like the Lasat machine which has an R5000. Flo -- Florian Lohoff flo@rfc822.org +49-5201-669912 Why is it called "common sense" when nobody seems to have any?