Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751416AbaDSUMo (ORCPT ); Sat, 19 Apr 2014 16:12:44 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:54010 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbaDSUMa (ORCPT ); Sat, 19 Apr 2014 16:12:30 -0400 MIME-Version: 1.0 In-Reply-To: <1397824031-4892-13-git-send-email-lftan@altera.com> References: <1397824031-4892-1-git-send-email-lftan@altera.com> <1397824031-4892-13-git-send-email-lftan@altera.com> Date: Sat, 19 Apr 2014 22:12:28 +0200 X-Google-Sender-Auth: f42ntuaflxlv_5p5feum75DgDrs Message-ID: Subject: Re: [PATCH 16/28] nios2: System calls handling From: Geert Uytterhoeven To: Ley Foon Tan Cc: Linux-Arch , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , lftan.linux@gmail.com, cltang@codesourcery.com, Pavel Machek Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 18, 2014 at 2:26 PM, Ley Foon Tan wrote: > +/* sys_cacheflush -- flush the processor cache. */ > +asmlinkage int sys_cacheflush(unsigned long addr, unsigned long len, > + unsigned int op) > +{ > + struct vm_area_struct *vma; > + > + if (len == 0) > + return 0; > + > + /* Check for overflow */ > + if (addr + len < addr) > + return -EFAULT; > + > + /* > + * Verify that the specified address region actually belongs > + * to this process. > + */ > + vma = find_vma(current->mm, addr); > + if (vma == NULL || addr < vma->vm_start || addr + len > vma->vm_end) > + return -EFAULT; > + > + /* Ignore the scope and cache arguments. */ This function doesn't have scope and cache arguments (sys_cacheflush() on m68k does have them ;-) On Sat, Apr 19, 2014 at 6:09 PM, Pavel Machek wrote: > Also... explanation why you need this syscall while other > architectures live happily without it would be nice. 12 our of 28 architectures provide such a syscall... Is flushing the cache a privileged operation on nios2? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/