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 3/4] Nios II: Linux specific parts


On Fri, 28 Mar 2014, Chung-Lin Tang wrote:

>         * sysdeps/unix/sysv/linux/nios2/configure.in: New file.

Use configure.ac, not configure.in.

> +#define atomic_compare_and_exchange_val_acq(mem, newval, oldval)	\
> +  __sync_val_compare_and_swap (mem, oldval, newval)
> +#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval)	\
> +  (! __sync_bool_compare_and_swap (mem, oldval, newval))

You can assume new-enough GCC to have __atomic_* - is there a reason 
you're not using those (with explicit memory model) instead of the older 
__sync_* (which don't allow a memory model to be specified)?  Even if 
there's no difference between acq/rel on present hardware, using 
__atomic_* could be better on future hardware....

(If __atomic_* requires libatomic but __sync_* only needs functions from 
libgcc, that would be a good reason to keep using __sync_* for now.)

> diff --git a/sysdeps/unix/sysv/linux/nios2/clone.S b/sysdeps/unix/sysv/linux/nios2/clone.S

I don't see any special CFI handling in this file.  clone tends to need 
some (see other architectures for examples); in particular, in the child 
after the syscall the return address may need to be marked as undefined so 
that backtracing in GDB doesn't try to backtrace past clone.

> diff --git a/sysdeps/unix/sysv/linux/nios2/configure.in b/sysdeps/unix/sysv/linux/nios2/configure.in
> new file mode 100644
> index 0000000..29ca193
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/nios2/configure.in
> @@ -0,0 +1,4 @@
> +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
> +# Local configure fragment for sysdeps/unix/sysv/linux/nios2.
> +
> +arch_minimum_kernel=3.8.0

As discussed, .ac and should be 10.0.0 until the kernel port is upstream.

> diff --git a/sysdeps/unix/sysv/linux/nios2/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/nios2/nptl/lowlevellock.h

I'd expect this file to include the *_requeue_pi support (bug 14920), as 
in other lowlevellock.h files.

> diff --git a/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h b/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h

> +/*
> +#include <sys/procfs.h>
> +*/
> +
> +/* We need the signal context definitions even if they are not used
> +   included in <signal.h>.  */
> +/*#include <bits/sigcontext.h>*/

No, don't have commented-out #includes - work out what #includes are 
actually needed, remove any that aren't needed.

-- 
Joseph S. Myers
joseph@codesourcery.com


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