From patchwork Thu Jul 30 03:08:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 7927 X-Patchwork-Delegate: vapier@gentoo.org Received: (qmail 94266 invoked by alias); 30 Jul 2015 03:08:48 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 94217 invoked by uid 89); 30 Jul 2015 03:08:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Subject: [PATCH/committed] hppa: rewrite INLINE_SYSCALL Date: Wed, 29 Jul 2015 23:08:37 -0400 Message-Id: <1438225717-30195-1-git-send-email-vapier@gentoo.org> The semi-recent SYSCALL_CANCEL macro imposes a slight nuance on the implementation of INLINE_SYSCALL: the nr argument cannot be expanded directly but must be passed on to another macro which may expand it. Most arches don't notice because INLINE_SYSCALL is defined in terms of INTERNAL_SYSCALL which has the additional layer of expansion, but on hppa, it was attempting to expand it directly. That causes build errors like so: ../sysdeps/unix/sysv/linux/sigsuspend.c: In function '__sigsuspend': ../sysdeps/unix/sysv/linux/sigsuspend.c:31:62: error: implicit declaration of function 'LOAD_ARGS___SYSCALL_NARGS' ../sysdeps/unix/sysv/linux/sigsuspend.c:31:304: error: called object 'LOAD_ARGS___SYSCALL_NARGS(set, 8)' is not a function So rewrite hppa's INLINE_SYSCALL to use INTERNAL_SYSCALL like other arches do. This is also a nice clean up as the two macros had quite a bit of duplicated logic. --- ChangeLog | 5 +++++ sysdeps/unix/sysv/linux/hppa/sysdep.h | 29 +++++++---------------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f393fd..8a19531 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-07-30 Mike Frysinger + + * sysdeps/unix/sysv/linux/hppa/sysdep.h (INLINE_SYSCALL): Rewrite + from scratch to use INTERNAL_SYSCALL. + 2015-07-29 H.J. Lu [BZ #18078] diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h index ac47814..17c8738 100644 --- a/sysdeps/unix/sysv/linux/hppa/sysdep.h +++ b/sysdeps/unix/sysv/linux/hppa/sysdep.h @@ -362,28 +362,13 @@ L(pre_end): ASM_LINE_SEP \ #undef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) \ ({ \ - long __sys_res; \ - { \ - register unsigned long __res asm("r28"); \ - PIC_REG_DEF \ - LOAD_ARGS_##nr(args) \ - /* FIXME: HACK save/load r19 around syscall */ \ - asm volatile( \ - SAVE_ASM_PIC \ - " ble 0x100(%%sr2, %%r0)\n" \ - " ldi %1, %%r20\n" \ - LOAD_ASM_PIC \ - : "=r" (__res) \ - : "i" (SYS_ify(name)) PIC_REG_USE ASM_ARGS_##nr \ - : "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \ - ); \ - __sys_res = (long)__res; \ - } \ - if ( (unsigned long)__sys_res >= (unsigned long)-4095 ){ \ - __set_errno(-__sys_res); \ - __sys_res = -1; \ - } \ - __sys_res; \ + long __sys_res = INTERNAL_SYSCALL (name, , nr, args); \ + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (__sys_res, ))) \ + { \ + __set_errno (INTERNAL_SYSCALL_ERRNO (__sys_res, )); \ + __sys_res = -1; \ + } \ + __sys_res; \ }) /* INTERNAL_SYSCALL_DECL - Allows us to setup some function static