Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758285AbdLRLTv (ORCPT ); Mon, 18 Dec 2017 06:19:51 -0500 Received: from mail-ot0-f195.google.com ([74.125.82.195]:36893 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757985AbdLRLTr (ORCPT ); Mon, 18 Dec 2017 06:19:47 -0500 X-Google-Smtp-Source: ACJfBot2c/bNBnoSL0cYF7ZbK0x5KsteRZWqYNjF+/LOETN94Jmhw+4Ftnmbc02fHy06GxYRaVCmZXJlyo+Ib8u+tp4= MIME-Version: 1.0 In-Reply-To: <9663cb7c21011cdb4f278c1fad081d1df296daa8.1513577007.git.green.hu@gmail.com> References: <9663cb7c21011cdb4f278c1fad081d1df296daa8.1513577007.git.green.hu@gmail.com> From: Arnd Bergmann Date: Mon, 18 Dec 2017 12:19:46 +0100 X-Google-Sender-Auth: CK2p-tJtUs0zeLG-weDE_XO15ck Message-ID: Subject: Re: [PATCH v4 16/36] nds32: System calls handling To: Greentime Hu Cc: Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , Daniel Lezcano , linux-serial@vger.kernel.org, Geert Uytterhoeven , Linus Walleij , Mark Rutland , Greg KH , ren_guo@c-sky.com, Philippe Ombredanne , Vincent Chen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1637 Lines: 50 On Mon, Dec 18, 2017 at 7:46 AM, Greentime Hu wrote: > new file mode 100644 > index 0000000..90da745 > --- /dev/null > +++ b/arch/nds32/include/uapi/asm/unistd.h > @@ -0,0 +1,12 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (C) 2005-2017 Andes Technology Corporation > + > +#define __ARCH_WANT_SYNC_FILE_RANGE2 > + > +/* Use the standard ABI for syscalls */ > +#include > + > +/* Additional NDS32 specific syscalls. */ > +#define __NR_cacheflush (__NR_arch_specific_syscall) > +#define __NR__llseek __NR_llseek > +__SYSCALL(__NR_cacheflush, sys_cacheflush) I'm still confused by __NR__llseek here, why do you need that one? > +SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, > + unsigned long, prot, unsigned long, flags, > + unsigned long, fd, unsigned long, pgoff) > +{ > + if (pgoff & (~PAGE_MASK >> 12)) > + return -EINVAL; > + > + return sys_mmap_pgoff(addr, len, prot, flags, fd, > + pgoff >> (PAGE_SHIFT - 12)); > +} > + > +SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, > + unsigned long, prot, unsigned long, flags, > + unsigned long, fd, unsigned long, pgoff) > +{ > + if (unlikely(pgoff & ~PAGE_MASK)) > + return -EINVAL; > + > + return sys_mmap_pgoff(addr, len, prot, flags, fd, > + pgoff >> PAGE_SHIFT); > +} And I don't see why you define sys_mmap() in addition to sys_mmap2(). The rest of the syscall handling looks good now. Arnd