From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37355 invoked by alias); 1 Jan 2018 17:18:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 37344 invoked by uid 89); 1 Jan 2018 17:18:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:2871, H*Ad:U*patches X-HELO: relay1.mentorg.com Date: Mon, 01 Jan 2018 17:18:00 -0000 From: Joseph Myers To: Palmer Dabbelt CC: , Subject: Re: [PATCH v3 15/19] RISC-V: Linux Syscall Interface In-Reply-To: <20171227060534.3998-16-palmer@dabbelt.com> Message-ID: References: <20171227060534.3998-1-palmer@dabbelt.com> <20171227060534.3998-16-palmer@dabbelt.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2018-01/txt/msg00052.txt.bz2 On Tue, 26 Dec 2017, Palmer Dabbelt wrote: > diff --git a/sysdeps/unix/sysv/linux/riscv/arch-fork.h b/sysdeps/unix/sysv/linux/riscv/arch-fork.h > new file mode 100644 > index 000000000000..9a2465b58e5a > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/riscv/arch-fork.h > @@ -0,0 +1,27 @@ > +/* Internal definitions for thread-friendly fork implementation. Linux/i386. > + Copyright (C) 2002-2017 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + Contributed by Ulrich Drepper , 2002. No "Contributed by" in new files, even when copied. > diff --git a/sysdeps/unix/sysv/linux/riscv/pt-vfork.S b/sysdeps/unix/sysv/linux/riscv/pt-vfork.S > +/* libpthread used to have its own vfork implementation that differed > + from libc's only in having a pointless micro-optimization. There > + is no longer any use to having a separate copy in libpthread, but > + the historical ABI requires it. For static linking, there is no > + need to provide anything here--the libc version will be linked in. > + For shared library ABI compatibility, there must be __vfork and > + vfork symbols in libpthread.so. */ > + > +#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \ > + || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)) No file for a new port should include SHLIB_COMPAT conditionals on versions that don't exist for that port. I think that means this file can just be a one-line /* Not needed. */ or similar comment (no copyright / license notice needed in that case). > +long > +syscall (long syscall_number, long arg1, long arg2, long arg3, long arg4, > + long arg5, long arg6, long arg7) > +{ > + long ret; long int. > + INTERNAL_SYSCALL_DECL (err); > + > + ret = INTERNAL_SYSCALL_NCS (syscall_number, err, 7, arg1, arg2, arg3, arg4, > + arg5, arg6, arg7); > + > + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) > + { > + extern long __syscall_error (long neg_errno); > + return __syscall_error (ret); Avoid such block-scope function declarations. Include some header that declares __syscall_error instead. > diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h > +/* Define a macro which expands into the inline wrapper code for a system > + call. */ > +# undef INLINE_SYSCALL > +# define INLINE_SYSCALL(name, nr, args...) \ > + ({ INTERNAL_SYSCALL_DECL (err); \ > + long __sys_result = INTERNAL_SYSCALL (name, err, nr, args); \ long int. > +# define INTERNAL_SYSCALL_ERROR_P(val, err) ((unsigned long) (val) > -4096UL) unsigned long int. > +# define internal_syscall0(number, err, dummy...) \ > +({ \ > + long _sys_result; \ > + \ > + { \ > + register long __a7 asm("a7") = number; \ > + register long __a0 asm("a0"); \ More uses of long int, throughout all these macros. -- Joseph S. Myers joseph@codesourcery.com