From patchwork Mon May 18 07:32:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshinori Sato X-Patchwork-Id: 473288 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 04F641401B5 for ; Mon, 18 May 2015 17:52:53 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EC477319BB; Mon, 18 May 2015 07:52:52 +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 qMKyfFzEi47v; Mon, 18 May 2015 07:52:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 8D20B32B92; Mon, 18 May 2015 07:52:49 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id AD9851C22AD for ; Mon, 18 May 2015 07:52:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A813794FC5 for ; Mon, 18 May 2015 07:52:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pQQIN+W959jB for ; Mon, 18 May 2015 07:52:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail2.asahi-net.or.jp (mail2.asahi-net.or.jp [202.224.39.198]) by hemlock.osuosl.org (Postfix) with ESMTP id 7726994FB9 for ; Mon, 18 May 2015 07:52:46 +0000 (UTC) Received: from sa76r4 (y081184.ppp.asahi-net.or.jp [118.243.81.184]) by mail2.asahi-net.or.jp (Postfix) with ESMTP id EF1CFCE3C; Mon, 18 May 2015 16:32:18 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by sa76r4 (Postfix) with ESMTP id B0E81E622; Mon, 18 May 2015 16:32:18 +0900 (JST) X-Virus-Scanned: Debian amavisd-new at sa76r4.localdomain Received: from sa76r4 ([127.0.0.1]) by localhost (sa76r4.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OwmS9DDYhk5r; Mon, 18 May 2015 16:32:18 +0900 (JST) Received: by sa76r4 (Postfix, from userid 1000) id 9193F12B4; Mon, 18 May 2015 16:32:18 +0900 (JST) From: Yoshinori Sato To: uclibc@uclibc.org Subject: [PATCH 5/6] h8300: Add new feature Date: Mon, 18 May 2015 16:32:06 +0900 Message-Id: <1431934327-1278-6-git-send-email-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431934327-1278-1-git-send-email-ysato@users.sourceforge.jp> References: <1431934327-1278-1-git-send-email-ysato@users.sourceforge.jp> X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: uclibc-bounces@uclibc.org Sender: "uClibc" Signed-off-by: Yoshinori Sato --- ldso/ldso/h8300/dl-sysdep.h | 1 + libc/sysdeps/linux/h8300/posix_fadvise64.c | 60 ++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 ldso/ldso/h8300/dl-sysdep.h create mode 100644 libc/sysdeps/linux/h8300/posix_fadvise64.c diff --git a/ldso/ldso/h8300/dl-sysdep.h b/ldso/ldso/h8300/dl-sysdep.h new file mode 100644 index 0000000..880d048 --- /dev/null +++ b/ldso/ldso/h8300/dl-sysdep.h @@ -0,0 +1 @@ +/* dl not supported */ diff --git a/libc/sysdeps/linux/h8300/posix_fadvise64.c b/libc/sysdeps/linux/h8300/posix_fadvise64.c new file mode 100644 index 0000000..20ecca8 --- /dev/null +++ b/libc/sysdeps/linux/h8300/posix_fadvise64.c @@ -0,0 +1,60 @@ +/* vi: set sw=4 ts=4: */ +/* + * posix_fadvise64() for uClibc + * http://www.opengroup.org/onlinepubs/009695399/functions/posix_fadvise.html + * + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __UCLIBC_HAS_LFS__ +#ifdef __NR_fadvise64_64 + +int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) +{ + unsigned long offset_h, offset_l; + unsigned long len_h, len_l; + register unsigned int __asm__("er0") er0; + offset_h = ofsfet >> 32; + offset_l = offset & 0xffffffffUL; + len_h = len >> 32; + len_l = len & 0xffffffffUL; + __asm__ __volatile__ ( + "mov.l %6, er5\n\t" + "mov.l %5, er4\n\t" + "mov.l %4, er3\n\t" + "mov.l %3, er2\n\t" + "mov.l %2, er1\n\t" + "mov.l %1, er0\n\t" + "mov.l %7, er6\n\t" + "trapa #0" + : "=r" (er0) + : "0" (__NR_posix_fadvice64) , "g" (fd), "g" (offset_h), "g" (offset_l), + "g" (len_h), "g" (len_l), "g" (advice) + : "memory" ); + + if (er0 >= 0) + return 0; + else + return -er0; +} +#elif !defined __NR_fadvise64 && defined __UCLIBC_HAS_STUBS__ +/* This is declared as a strong alias in posix_fadvise.c if __NR_fadvise64 + * is defined. + */ +int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) +{ + return ENOSYS; +} +#endif /* __NR_fadvise64_64 */ +#endif /* __UCLIBC_HAS_LFS__ */