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]

Re: bring mips*-linux back to a buildable state


On Jul 19, 2004, Andreas Jaeger <aj@suse.de> wrote:

> Alexandre Oliva <aoliva@redhat.com> writes:
>> These patches gets all 3 ABIs of mips64-linux to build and work again.

> Can you send them separtly, so that it's easier to comment on them?

The kernel tree I was using didn't define __NR_semtimedop nor
__NR_ipc, so linux/semtimedop.c didn't work.  I figured it would be
nice to have code that would work with whatever mips64 kernel
developers decided to implement (I don't know what it was), with a
fallback to older kernels that didn't have either.  If you know what
mips64 linux ended up using, feel free to simplify the code
accordingly.  Ideally, this patch to get semtimedop to adapt to
whatever the kernel has to offer should be pushed to the generic linux
code, but I thought I'd test the waters with a port that actually
needed the change first.

Index: ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* sysdeps/unix/sysv/linux/mips/mips64/semtimedop.c: New.

Index: sysdeps/unix/sysv/linux/mips/mips64/semtimedop.c
===================================================================
RCS file: sysdeps/unix/sysv/linux/mips/mips64/semtimedop.c
diff -N sysdeps/unix/sysv/linux/mips/mips64/semtimedop.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sysdeps/unix/sysv/linux/mips/mips64/semtimedop.c 2 Jul 2004 09:18:54 -0000
@@ -0,0 +1,45 @@
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Alexandre Oliva <aoliva@redhat.com>
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/syscall.h>
+
+#if defined __NR_semtimedop
+#include <errno.h>
+#include <sys/sem.h>
+#include <ipc_priv.h>
+
+#include <sysdep.h>
+
+int
+semtimedop (semid, sops, nsops, timeout)
+     int semid;
+     struct sembuf *sops;
+     size_t nsops;
+     const struct timespec *timeout;
+{
+  return INLINE_SYSCALL (semtimedop, 4, semid, sops, nsops, timeout);
+}
+
+#elif defined __NR_ipc
+# include <sysdeps/unix/sysv/linux/semtimedop.c>
+
+#else
+# include <sysdeps/generic/semtimedop.c>
+
+#endif
-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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