Re: [PATCH 16/28] nios2: System calls handling

2014-04-24 Thread Ley Foon Tan
On Tue, Apr 22, 2014 at 8:30 PM, Arnd Bergmann wrote: > On Friday 18 April 2014, Ley Foon Tan wrote: > >> + >> + #define sys_mmap2 sys_mmap_pgoff >> + > > You use sys_mmap_pgoff here, but > >> +asmlinkage long sys_mmap(unsigned long addr, unsigned long len, >> + unsigned long p

Re: [PATCH 16/28] nios2: System calls handling

2014-04-22 Thread Arnd Bergmann
On Friday 18 April 2014, Ley Foon Tan wrote: > + > + #define sys_mmap2 sys_mmap_pgoff > + You use sys_mmap_pgoff here, but > +asmlinkage long sys_mmap(unsigned long addr, unsigned long len, > + unsigned long prot, unsigned long flags, > + unsigned long fd,

Re: [PATCH 16/28] nios2: System calls handling

2014-04-22 Thread Ley Foon Tan
On Tue, Apr 22, 2014 at 4:48 AM, Pavel Machek 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; >> >

Re: [PATCH 16/28] nios2: System calls handling

2014-04-21 Thread Pavel Machek
> >>> +/* 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;

Re: [PATCH 16/28] nios2: System calls handling

2014-04-21 Thread Pavel Machek
Hi! > > Also... explanation why you need this syscall while other > > architectures live happily without it would be nice. > This syscall exist in nios2 port since old days and some users already > used it for sometimes. > Like mentioned by Greet, 12 our of 28 architectures provide such a syscall.

Re: [PATCH 16/28] nios2: System calls handling

2014-04-21 Thread Richard Weinberger
On Mon, Apr 21, 2014 at 7:32 PM, Ley Foon Tan wrote: > On Sun, Apr 20, 2014 at 12:09 AM, Pavel Machek wrote: >>> +/* Additional Nios II specific syscalls. */ >>> +#define __NR_cacheflush (__NR_arch_specific_syscall) >>> +__SYSCALL(__NR_cacheflush, sys_cacheflush) >> >> I guess you should Cc: Mich

Re: [PATCH 16/28] nios2: System calls handling

2014-04-21 Thread Ley Foon Tan
On Sun, Apr 20, 2014 at 12:09 AM, Pavel Machek wrote: >> +/* Additional Nios II specific syscalls. */ >> +#define __NR_cacheflush (__NR_arch_specific_syscall) >> +__SYSCALL(__NR_cacheflush, sys_cacheflush) > > I guess you should Cc: Michael Kerrisk on this one. CC him this email. > > Also... expl

Re: [PATCH 16/28] nios2: System calls handling

2014-04-21 Thread Ley Foon Tan
On Sun, Apr 20, 2014 at 4:12 AM, Geert Uytterhoeven wrote: >> +*/ >> + 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. */ > >

Re: [PATCH 16/28] nios2: System calls handling

2014-04-19 Thread Geert Uytterhoeven
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 ==

Re: [PATCH 16/28] nios2: System calls handling

2014-04-19 Thread Pavel Machek
On Fri 2014-04-18 20:26:59, Ley Foon Tan wrote: > This patch adds support for system calls from userspaces. It uses the > asm-generic/unistd.h definitions with architecture spcific syscall. The > sys_call_table > is just an array defined in a C file and it contains pointers to the syscall > funct

[PATCH 16/28] nios2: System calls handling

2014-04-18 Thread Ley Foon Tan
This patch adds support for system calls from userspaces. It uses the asm-generic/unistd.h definitions with architecture spcific syscall. The sys_call_table is just an array defined in a C file and it contains pointers to the syscall functions. Signed-off-by: Ley Foon Tan --- arch/nios2/includ