Re: [PATCH 12/24] C6X: syscalls

Arnd Bergmann
2011-08-22T21:00:39Z

On Monday 22 August 2011 16:09:33 Mark Salter wrote:
> +asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
> + unsigned long prot, unsigned long flags,
> + unsigned long fd, off_t offset)
> +{
> + if (offset & ~PAGE_MASK)
> + return -EINVAL;
> + return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
> +}
> +
> +/* Provide the actual syscall number to call mapping. */
> +#undef __SYSCALL
> +#define __SYSCALL(nr, call) [nr] = (call),
> +
> +/*
> + * Use trampolines
> + */
> +#define sys_pread64 sys_pread_c6x
> +#define sys_pwrite64 sys_pwrite_c6x
> +#define sys_truncate64 sys_truncate64_c6x
> +#define sys_ftruncate64 sys_ftruncate64_c6x
> +#define sys_fadvise64 sys_fadvise64_c6x
> +#define sys_fadvise64_64 sys_fadvise64_64_c6x
> +#define sys_fallocate sys_fallocate_c6x
> +
> +/* Use sys_mmap_pgoff directly */
> +#define sys_mmap2 sys_mmap_pgoff

If you use sys_mmap_pgoff, there should be no need for sys_mmap any more.

Arnd