From patchwork Fri Jul 3 15:41:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 491121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6E36B140775 for ; Sat, 4 Jul 2015 01:42:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=sourceware.org header.i=@sourceware.org header.b=U2rNpy+n; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; q=dns; s=default; b=BU+ F2q1glXuA36PbFb/+eg/t2uydEF5rcsb8Zo6vKBBbSSQtchofCjnXIlsJ0DQYvS9 B0LRXdV763Srn3CPBRVegYVUy+cxJyHLIDIl0iCe9gpMi2EjagOc/K68158zKIsx JPTMPdN/O+F2J1QgpsqVjlQD0Yuv+dz6ir5i+Yyk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; s=default; bh=Od8W0ygkj jxyhCi8rpZ2ZAWIPVs=; b=U2rNpy+nfjJwZUKRwLEVE/HPsfXF1gQNQhkCokaCl /DBOzIBcq5QoB4bxmfkvUT2DQxfSvfkPJsrvOizrMmK/2nGUl37t5j8kYrc760hZ 5QILSOhLCYBjuoPgou/6OW3xRF3iD92J+Zr8vucey6nz2Y8/NQEJLfTu9d5LfAK1 xc= Received: (qmail 6172 invoked by alias); 3 Jul 2015 15:41:56 -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 6162 invoked by uid 89); 3 Jul 2015 15:41:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f178.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=KzUA69HEm7Sib3dGwkEuwIGp3nUaii6vOp0+8BlzqaA=; b=cWjOzhN5YgUd5bfqwKttZs2gcFbuw40ZGaxpCDUsTBtI1Gg+CtuPqF5DJH1oislXr+ UgqrM3ZnRSoJiSauFidK1J+Q9Rct/JL49czoPk8Y09ZeOrY6KMRSUxPFk+1wDRMUPJjw wHchl4Cid5Kv/AXWP9YXwUyZfj8ynPRNvhhQy+kTpel+HlXNOL7LyBdY218VpNBZPrRS cWIa5X1GJZ3TQnbb68X+ey8Jh4ct/HxW5kgjFljA5zhEbHMD1Uz8Z1xKpt6ConT5mOmv hd14lC3uu6DDffb5xyuuyqHbitPh4uiWSIcNUy/vV+EI1bVnd68/8lrfzyCOC/h/gfLi k/3g== X-Gm-Message-State: ALoCoQlOGdr99QGWyDm3PVwBqCioeCVAu2Jlr5ypiETG5oYpWfjZwrilqbeGpXuQv273YI6aBHvn X-Received: by 10.129.34.135 with SMTP id i129mr42463615ywi.104.1435938111262; Fri, 03 Jul 2015 08:41:51 -0700 (PDT) Message-ID: <5596AD3B.1060903@linaro.org> Date: Fri, 03 Jul 2015 12:41:47 -0300 From: Adhemerval Zanella User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: GNU C Library Subject: [PATCH] i386: Assembly Implementation cleanup This patch removes i386 assembly implementation for epoll_wait, mmap, mmap64, semtimeop now that i386 have 6 argument syscall support from C code. The mmap implementation used is the wordsize-32 generic linux one. Tested in i386. --- * sysdeps/unix/sysv/linux/i386/mmap.c: New file. * sysdeps/unix/sysv/linux/i386/epoll_pwait.S: Remove file. * sysdeps/unix/sysv/linux/i386/mmap.S: Likewise. * sysdeps/unix/sysv/linux/i386/mmap64.S: Likewise. * sysdeps/unix/sysv/linux/i386/semtimedop.S: Likewise. -- diff --git a/sysdeps/unix/sysv/linux/i386/epoll_pwait.S b/sysdeps/unix/sysv/linux/i386/epoll_pwait.S deleted file mode 100644 index 65cfb98..0000000 --- a/sysdeps/unix/sysv/linux/i386/epoll_pwait.S +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (C) 2007-2015 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 - . */ - -#include -#define _ERRNO_H -#include -#define _SIGNAL_H -#include - - - .text -ENTRY (epoll_pwait) - -#ifdef __NR_epoll_pwait - - /* Save registers. */ - pushl %ebp - cfi_adjust_cfa_offset (4) - pushl %ebx - cfi_adjust_cfa_offset (4) - pushl %esi - cfi_adjust_cfa_offset (4) - pushl %edi - cfi_adjust_cfa_offset (4) - cfi_rel_offset (edi, 0) - cfi_rel_offset (esi, 4) - cfi_rel_offset (ebx, 8) - cfi_rel_offset (ebp, 12) - - movl 20(%esp), %ebx - movl 24(%esp), %ecx - movl 28(%esp), %edx - movl 32(%esp), %esi - movl 36(%esp), %edi - movl $_NSIG/8, %ebp - movl $__NR_epoll_pwait, %eax - - ENTER_KERNEL - - /* Restore registers. */ - popl %edi - cfi_adjust_cfa_offset (-4) - cfi_restore (edi) - popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) - popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) - popl %ebp - cfi_adjust_cfa_offset (-4) - cfi_restore (ebp) - - /* If 0 > %eax > -4096 there was an error. */ - cmpl $-4096, %eax - ja SYSCALL_ERROR_LABEL - - /* Successful; return the syscall's value. */ -#else - movl $-ENOSYS, %eax - jmp SYSCALL_ERROR_LABEL -#endif - ret -PSEUDO_END (epoll_pwait) diff --git a/sysdeps/unix/sysv/linux/i386/mmap.S b/sysdeps/unix/sysv/linux/i386/mmap.S deleted file mode 100644 index daf807a..0000000 --- a/sysdeps/unix/sysv/linux/i386/mmap.S +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (C) 1995-2015 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 - . */ - -#include - -#define EINVAL 22 - - .text - -ENTRY (__mmap) - - /* Save registers. */ - pushl %ebp - cfi_adjust_cfa_offset (4) - pushl %ebx - cfi_adjust_cfa_offset (4) - pushl %esi - cfi_adjust_cfa_offset (4) - pushl %edi - cfi_adjust_cfa_offset (4) - - movl 20(%esp), %ebx - cfi_rel_offset (ebx, 8) - movl 24(%esp), %ecx - movl 28(%esp), %edx - movl 32(%esp), %esi - cfi_rel_offset (esi, 4) - movl 36(%esp), %edi - cfi_rel_offset (edi, 0) - movl 40(%esp), %ebp - cfi_rel_offset (ebp, 12) - testl $0xfff, %ebp - movl $-EINVAL, %eax - jne L(skip) - shrl $12, %ebp /* mmap2 takes the offset in pages. */ - - movl $SYS_ify(mmap2), %eax /* System call number in %eax. */ - - /* Do the system call trap. */ - ENTER_KERNEL -L(skip): - /* Restore registers. */ - popl %edi - cfi_adjust_cfa_offset (-4) - cfi_restore (edi) - popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) - popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) - popl %ebp - cfi_adjust_cfa_offset (-4) - cfi_restore (ebp) - - /* If 0 > %eax > -4096 there was an error. */ - cmpl $-4096, %eax - ja SYSCALL_ERROR_LABEL - - /* Successful; return the syscall's value. */ - ret - -PSEUDO_END (__mmap) - -weak_alias (__mmap, mmap) diff --git a/sysdeps/unix/sysv/linux/i386/mmap.c b/sysdeps/unix/sysv/linux/i386/mmap.c new file mode 100644 index 0000000..2cb4907 --- /dev/null +++ b/sysdeps/unix/sysv/linux/i386/mmap.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2015 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 + . */ + +#include diff --git a/sysdeps/unix/sysv/linux/i386/mmap64.S b/sysdeps/unix/sysv/linux/i386/mmap64.S deleted file mode 100644 index 3cf6eb9..0000000 --- a/sysdeps/unix/sysv/linux/i386/mmap64.S +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright (C) 1995-2015 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 - . */ - -#include - -#define EINVAL 22 -#define ENOSYS 38 - -#define SVRSP 16 /* saved register space */ -#define PARMS 4+SVRSP /* space for 4 saved regs */ -#define ADDR PARMS -#define LEN ADDR+4 -#define PROT LEN+4 -#define FLAGS PROT+4 -#define FD FLAGS+4 -#define OFFLO FD+4 -#define OFFHI OFFLO+4 - - .text -ENTRY (__mmap64) - - /* Save registers. */ - pushl %ebp - cfi_adjust_cfa_offset (4) - pushl %ebx - cfi_adjust_cfa_offset (4) - pushl %esi - cfi_adjust_cfa_offset (4) - pushl %edi - cfi_adjust_cfa_offset (4) - - movl OFFLO(%esp), %edx - movl OFFHI(%esp), %ecx - testl $0xfff, %edx - jne L(einval) - shrdl $12, %ecx, %edx /* mmap2 takes the offset in pages. */ - shrl $12, %ecx - jne L(einval) - movl %edx, %ebp - cfi_rel_offset (ebp, 12) - - movl ADDR(%esp), %ebx - cfi_rel_offset (ebx, 8) - movl LEN(%esp), %ecx - movl PROT(%esp), %edx - movl FLAGS(%esp), %esi - cfi_rel_offset (esi, 4) - movl FD(%esp), %edi - cfi_rel_offset (edi, 0) - - movl $SYS_ify(mmap2), %eax /* System call number in %eax. */ - - /* Do the system call trap. */ -L(do_syscall): - ENTER_KERNEL - - /* Restore registers. */ - popl %edi - cfi_adjust_cfa_offset (-4) - cfi_restore (edi) - popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) - popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) - popl %ebp - cfi_adjust_cfa_offset (-4) - cfi_restore (ebp) - - /* If 0 > %eax > -4096 there was an error. */ - cmpl $-4096, %eax - ja SYSCALL_ERROR_LABEL - - /* Successful; return the syscall's value. */ - ret - - cfi_adjust_cfa_offset (16) - cfi_rel_offset (ebp, 12) - cfi_rel_offset (ebx, 8) - cfi_rel_offset (esi, 4) - cfi_rel_offset (edi, 0) - /* This means the offset value is too large. */ -L(einval): - popl %edi - cfi_adjust_cfa_offset (-4) - cfi_restore (edi) - popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) - popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) - popl %ebp - cfi_adjust_cfa_offset (-4) - cfi_restore (ebp) - movl $-EINVAL, %eax - jmp SYSCALL_ERROR_LABEL - -PSEUDO_END (__mmap64) - -weak_alias (__mmap64, mmap64) diff --git a/sysdeps/unix/sysv/linux/i386/semtimedop.S b/sysdeps/unix/sysv/linux/i386/semtimedop.S deleted file mode 100644 index 80477b7..0000000 --- a/sysdeps/unix/sysv/linux/i386/semtimedop.S +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2003. - - 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 - . */ - -#include - -#define SYSOP_semtimedop 4 - -#define SVRSP 12 /* saved register space */ -#define PARMS 4+SVRSP /* space for 3 saved regs */ -#define SEMID PARMS -#define SOPS SEMID+4 -#define NSOPS SOPS+4 -#define TIMEOUT NSOPS+4 - - .text -ENTRY (semtimedop) - - pushl %ebp - cfi_adjust_cfa_offset (4) - pushl %ebx - cfi_adjust_cfa_offset (4) - pushl %edi - cfi_adjust_cfa_offset (4) - - movl $SYSOP_semtimedop, %ebx - cfi_rel_offset (ebx, 4) - movl SEMID(%esp), %ecx - movl NSOPS(%esp), %edx - movl SOPS(%esp), %edi - cfi_rel_offset (edi, 0) - movl TIMEOUT(%esp), %ebp - cfi_rel_offset (ebp, 8) - movl $__NR_ipc, %eax - - ENTER_KERNEL - - /* Restore registers. */ - popl %edi - cfi_adjust_cfa_offset (-4) - cfi_restore (edi) - popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) - popl %ebp - cfi_adjust_cfa_offset (-4) - cfi_restore (ebp) - - /* If 0 > %eax > -4096 there was an error. */ - cmpl $-4096, %eax - ja SYSCALL_ERROR_LABEL - - /* Successful; return the syscall's value. */ - ret - -#ifdef PIC - .align 4 -#endif -PSEUDO_END (semtimedop)