This is the mail archive of the libc-alpha@sourceware.org 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: [PATCH 1/2] AArch64 glibc port


Marcus Shawcroft <marcus.shawcroft@linaro.org> writes:

> +#define ARCH_PLTEXIT_MEMBERS \
> +    ElfW(Addr) (*aarch64_gnu_pltexit) (ElfW(Sym) *,                     \
> +				       unsigned int,                    \
> +				       uintptr_t *,			\
> +				       uintptr_t *,			\
> +				       struct La_aarch64_regs *,	\

This is now supposed to be const (the declaration in bits/link.h is
already correct).

> diff -x .git -uNr glibc.orig/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c glibc/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c
> --- glibc.orig/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c	1970-01-01 01:00:00.000000000 +0100
> +++ glibc/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c	2012-09-24 13:12:34.000000000 +0100
> @@ -0,0 +1,29 @@
> +/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
> +
> +   This file is part of the GNU C Library.
> +
> +   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, see
> +   <http://www.gnu.org/licenses/>.  */
> +
> +#include <atomic.h>
> +#include "pthreadP.h"
> +
> +int
> +pthread_spin_lock (pthread_spinlock_t *lock)
> +{
> +  while (atomic_compare_and_exchange_val_acq (lock, 1, 0) != 0)
> +    while (*lock != 0)
> +      ;
> +  return 0;
> +}

Please use the generic version.

> diff -x .git -uNr glibc.orig/ports/sysdeps/aarch64/nptl/pthread_spin_trylock.c glibc/ports/sysdeps/aarch64/nptl/pthread_spin_trylock.c
> --- glibc.orig/ports/sysdeps/aarch64/nptl/pthread_spin_trylock.c	1970-01-01 01:00:00.000000000 +0100
> +++ glibc/ports/sysdeps/aarch64/nptl/pthread_spin_trylock.c	2012-09-24 13:12:43.000000000 +0100
> @@ -0,0 +1,27 @@
> +/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
> +
> +   This file is part of the GNU C Library.
> +
> +   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, see
> +   <http://www.gnu.org/licenses/>.  */
> +
> +#include <errno.h>
> +#include <atomic.h>
> +#include "pthreadP.h"
> +
> +int
> +pthread_spin_trylock (pthread_spinlock_t *lock)
> +{
> +  return atomic_compare_and_exchange_val_acq (lock, 1, 0) ? EBUSY : 0;
> +}

Please use the generic version.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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