From patchwork Fri Mar 28 14:06:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: valentin popa X-Patchwork-Id: 334696 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 3391714008A for ; Sat, 29 Mar 2014 01:06:38 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 528A0306C6; Fri, 28 Mar 2014 14:06:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LkLOILByBwom; Fri, 28 Mar 2014 14:06:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 9B0E23069A; Fri, 28 Mar 2014 14:06:33 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id CC6C71BFA22 for ; Fri, 28 Mar 2014 14:06:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C7D258B02F for ; Fri, 28 Mar 2014 14:06:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3D20cbqFy23B for ; Fri, 28 Mar 2014 14:06:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ig0-f174.google.com (mail-ig0-f174.google.com [209.85.213.174]) by whitealder.osuosl.org (Postfix) with ESMTPS id 21D698B491 for ; Fri, 28 Mar 2014 14:06:31 +0000 (UTC) Received: by mail-ig0-f174.google.com with SMTP id h18so852965igc.7 for ; Fri, 28 Mar 2014 07:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=TbUsZH8TJGs0Kx8inpuBVmKWfn/uVRy4JVA7LfAAtUc=; b=Ioe2ONu4E3dJ3Z0ZTSstModwAqZ6BzhEFyWognSPbtozQLEro6T7W5K3rYiDNfBqTb EFwZF8BwWjhJ41ygBTorbAP7eoipW5ngFciWhlEW1Gq1B0+L+k4CJTtsegyz/B1+wJsb 4+3dN8ptGYdS1gnOkO3wudsBzIurtn2dJuLJ/hoJom0gf7B+Jcp0sLrnKBj8uLslcGI7 DCNffpnms+kGvW4M9iUi8B4wR377fNzwhqW8TRvaM6r/WH38UMtHq7CcCLDe6XftCpVK HmWOgjw7FWDDENtozB+a0EMRg0AwSC5uuxYJsrA6fujXwWVlXuSnVVwyIbOvJR/8oFJM Sq3w== MIME-Version: 1.0 X-Received: by 10.43.141.12 with SMTP id jc12mr7780272icc.21.1396015590605; Fri, 28 Mar 2014 07:06:30 -0700 (PDT) Received: by 10.50.73.98 with HTTP; Fri, 28 Mar 2014 07:06:30 -0700 (PDT) Date: Fri, 28 Mar 2014 16:06:30 +0200 Message-ID: Subject: linux: posix_fadvise: restore implementation for xtensa part II From: valentin popa To: uclibc@uclibc.org X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org Hi Baruch, I've attached a patch that you sent a while ago. The problem with it is that is made based on an arm fix, and fixes a xtensa issue, but brakes the other platforms that defines __NR_fadvise64. I can try to send a patch for this but for sure I will break xtensa, so maybe you can do it much better. Thanks! From 00571b43df2e0554d1b0716681832ba9975177c5 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Sun, 5 Jan 2014 11:44:02 +0200 Subject: [PATCH] libc: posix_fadvise: restore implementation for xtensa Commit ee84b8b400 (linux: posix_fadvise: use new SYSCALL_ALIGN_64BIT) removed posix_fadvise implementation for xtensa, since xtensa does not define __NR_fadvise64. Reuse the ARM support code to restore xtensa support. This commit is based Mike Frysinger's suggested patch. Cc: Mike Frysinger Signed-off-by: Baruch Siach Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/posix_fadvise.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libc/sysdeps/linux/common/posix_fadvise.c b/libc/sysdeps/linux/common/posix_fadvise.c index e102ce7..25c2941 100644 --- a/libc/sysdeps/linux/common/posix_fadvise.c +++ b/libc/sysdeps/linux/common/posix_fadvise.c @@ -10,18 +10,25 @@ #include -#if defined(__NR_fadvise64) || defined(__NR_arm_fadvise64_64) +#ifdef __NR_arm_fadvise64_64 +/* We handle the 64bit alignment issue which is why the arm guys renamed their + * syscall in the first place. So rename it back. + */ +# define __NR_fadvise64_64 __NR_arm_fadvise64_64 +#endif + +#if defined(__NR_fadvise64) || defined(__NR_fadvise64_64) # include # include # include -# ifdef __NR_arm_fadvise64_64 +# ifdef __NR_fadvise64_64 int posix_fadvise64(int fd, off64_t offset, off64_t len, int advice); # endif int posix_fadvise(int fd, off_t offset, off_t len, int advice) { -# ifdef __NR_arm_fadvise64_64 +# ifdef __NR_fadvise64_64 return posix_fadvise64(fd, offset, len, advice); # else int ret; @@ -41,7 +48,7 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advice) return 0; # endif } -# if defined __UCLIBC_HAS_LFS__ && ((!defined __NR_fadvise64_64 && !defined __NR_arm_fadvise64_64) || __WORDSIZE == 64) +# if defined __UCLIBC_HAS_LFS__ && (!defined __NR_fadvise64_64 || __WORDSIZE == 64) strong_alias(posix_fadvise,posix_fadvise64) # endif #endif -- 1.8.3.2