This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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]

[patches] Re: nptl/sysdeps/generic not activated


At Wed, 3 Nov 2004 12:08:46 -0800,
Roland McGrath wrote:
> 
> Yeah, I think we knew that.  The couple of files there are probably way out
> of date with respect to the API the real files should define, too, which is
> lame since they really only exist as documentation for what you need to write.

True, atomic_add_zero is called with the arguments in the wrong order.
This is the first patch below.

> If those files should be used at all, it should be done by the generic
> configure code for all add-ons.  So far there has not really been any
> add-on that had sysdeps/generic files that would really get used.

The second patch below seems to do the trick for me.  

A third issue is that the files nptl/sysdeps/${cpu}/tls.h are linux
specific, they have hard coded system calls in them.  They should be
moved down the sysdeps hierarchy.  Of course there are more linuxisms,
for example the pid_t pid in nptl/descr.h, but I guess pointing those
out individually is a waste of everybodies time.  I'll first have to
actually do a more or less complete port before submitting further
patches on those issues.  However, this points out one problem with
the ports concept: A port can not contain ports of other add-ons.
Ie, I can not put a nptl/ directory into my add-on and put nptl sysdep
stuff there.  When porting across operating systems, this is relevant.
Not sure if much can be done about this, though.

Thanks,
Marcus



In the nptl directory:

2004-11-03  Marcus Brinkmann  <marcus@gnu.org>

	* sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
	order of arguments in invocation of atomic_add_zero.

Index: nptl/sysdeps/generic/lowlevellock.h
===================================================================
RCS file: /cvs/glibc/libc/nptl/sysdeps/generic/lowlevellock.h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 lowlevellock.h
--- nptl/sysdeps/generic/lowlevellock.h	26 Nov 2002 22:50:46 -0000	1.1.1.1
+++ nptl/sysdeps/generic/lowlevellock.h	3 Nov 2004 20:47:27 -0000
@@ -76,7 +76,7 @@ __generic_mutex_unlock (int *mutex)
   /* Adding 0x80000000 to the counter results in 0 if and only if
      there are not other interested threads - we can return (this is
      the fastpath).  */
-  if (atomic_add_zero (0x80000000, mutex))
+  if (atomic_add_zero (mutex, 0x80000000))
     return;
 
   /* There are other threads waiting for this mutex, wake one of them


In the main directory:

2004-11-03  Marcus Brinkmann  <marcus@gnu.org>

	* configure.in (sysnames): Append sysdeps/generic for each
        add-on.

Index: configure.in
===================================================================
RCS file: /cvs/glibc/libc/configure.in,v
retrieving revision 1.430
diff -u -p -r1.430 configure.in
--- configure.in	26 Oct 2004 01:35:54 -0000	1.430
+++ configure.in	3 Nov 2004 20:56:22 -0000
@@ -593,6 +593,14 @@ for d in $add_ons_pfx ''; do
       done
     done
   done
+  if test -n "$d"; then
+    try="${d}sysdeps/generic"
+    test -n "$enable_debug_configure" &&
+    echo "$0 DEBUG: try $try" >&2
+    if test -d $srcdir/$try; then
+      sysnames="$sysnames $try"
+    fi
+  fi
 done
 IFS="$ac_save_ifs"
 


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