1. 19 Nov, 2018 3 commits
    • Firoz Khan's avatar
      sparc: add system call table generation support · 6ff645dd
      Firoz Khan authored
      The system call tables are in different format in all
      architecture and it will be difficult to manually add,
      modify or delete the syscall table entries in the res-
      pective files. To make it easy by keeping a script and
      which will generate the uapi header and syscall table
      file. This change will also help to unify the implemen-
      tation across all architectures.
      
      The system call table generation script is added in
      kernel/syscalls directory which contain the scripts to
      generate both uapi header file and system call table
      files. The syscall.tbl will be input for the scripts.
      
      syscall.tbl contains the list of available system calls
      along with system call number and corresponding entry
      point. Add a new system call in this architecture will
      be possible by adding new entry in the syscall.tbl file.
      
      Adding a new table entry consisting of:
        	- System call number.
      	- ABI.
      	- System call name.
      	- Entry point name.
      	- Compat entry name, if required.
      
      syscallhdr.sh and syscalltbl.sh will generate uapi header
      unistd_32/64.h and syscall_table_32/64/c32.h files respect-
      ively. Both .sh files will parse the content syscall.tbl
      to generate the header and table files. unistd_32/64.h will
      be included by uapi/asm/unistd.h and syscall_table_32/64/-
      c32.h is included by kernel/syscall.S - the real system
      call table.
      
      ARM, s390 and x86 architecuture does have similar support.
      I leverage their implementation to come up with a generic
      solution.
      Signed-off-by: default avatarFiroz Khan <firoz.khan@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6ff645dd
    • Firoz Khan's avatar
      sparc: add __NR_syscalls along with NR_syscalls · 61257f56
      Firoz Khan authored
      NR_syscalls macro holds the number of system call exist
      in sparc 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: default avatarFiroz Khan <firoz.khan@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      61257f56
    • Firoz Khan's avatar
      sparc: move __IGNORE* entries to non uapi header · d441f93d
      Firoz Khan authored
      All the __IGNORE* entries are resides in the uapi header
      file move to non uapi header asm/unistd.h as it is not
      used by any user space applications.
      
      It is correct to keep __IGNORE* entry in non uapi header
      asm/unistd.h while uapi/asm/unistd.h must hold information
      only useful for user space applications.
      
      One of the patch in this patch series will generate uapi
      header file. The information which directly used by the
      user space application must be present in uapi file.
      Signed-off-by: default avatarFiroz Khan <firoz.khan@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d441f93d
  2. 18 Nov, 2018 33 commits
  3. 16 Nov, 2018 4 commits