Firoz Khan d7c5e82c08 ia64: add __NR_syscalls along with NR_syscalls
NR_syscalls macro holds the number of system call exist
in ia64 architecture. We have to change the value of NR-
_syscalls, if we add or delete a system call.

One of the patch in this patch series has a script which
will generate a uapi header based on syscall.tbl file.
The syscall.tbl file contains the total number of system
calls information. So we have two option to update NR_sy-
scalls value.

1. Update NR_syscalls in asm/unistd.h manually by count-
   ing the no.of system calls. No need to update NR_sys-
   calls until we either add a new system call or delete
   existing system call.

2. We can keep this feature it above mentioned script,
   that will count the number of syscalls and keep it in
   a generated file. In this case we don't need to expli-
   citly update NR_syscalls in asm/unistd.h file.

The 2nd option will be the recommended one. For that, I
added the __NR_syscalls macro in uapi/asm/unistd.h along
with NR_syscalls asm/unistd.h. The macro __NR_syscalls
also added for making the name convention same across all
architecture. While __NR_syscalls isn't strictly part of
the uapi, having it as part of the generated header to
simplifies the implementation. We also need to enclose
this macro with #ifdef __KERNEL__ to avoid side effects.

Signed-off-by: Firoz Khan <firoz.khan@linaro.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2018-11-13 08:56:06 -08:00

53 lines
1.5 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* IA-64 Linux syscall numbers and inline-functions.
*
* Copyright (C) 1998-2005 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
#ifndef _ASM_IA64_UNISTD_H
#define _ASM_IA64_UNISTD_H
#include <uapi/asm/unistd.h>
#define NR_syscalls __NR_syscalls /* length of syscall table */
/*
* The following defines stop scripts/checksyscalls.sh from complaining about
* unimplemented system calls. Glibc provides for each of these by using
* more modern equivalent system calls.
*/
#define __IGNORE_fork /* clone() */
#define __IGNORE_time /* gettimeofday() */
#define __IGNORE_alarm /* setitimer(ITIMER_REAL, ... */
#define __IGNORE_pause /* rt_sigprocmask(), rt_sigsuspend() */
#define __IGNORE_utime /* utimes() */
#define __IGNORE_getpgrp /* getpgid() */
#define __IGNORE_vfork /* clone() */
#define __IGNORE_umount2 /* umount() */
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_SYS_UTIME
#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
#include <linux/types.h>
#include <linux/linkage.h>
#include <linux/compiler.h>
extern long __ia64_syscall (long a0, long a1, long a2, long a3, long a4, long nr);
asmlinkage unsigned long sys_mmap(
unsigned long addr, unsigned long len,
int prot, int flags,
int fd, long off);
asmlinkage unsigned long sys_mmap2(
unsigned long addr, unsigned long len,
int prot, int flags,
int fd, long pgoff);
struct pt_regs;
asmlinkage long sys_ia64_pipe(void);
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_IA64_UNISTD_H */