powerpc: Standardise on NR_syscalls rather than __NR_syscalls.
Most architectures use NR_syscalls as the #define for the number of syscalls. We use __NR_syscalls, and then define NR_syscalls as __NR_syscalls. __NR_syscalls is not used outside arch code, whereas NR_syscalls is. So as NR_syscalls must be defined and __NR_syscalls does not, replace __NR_syscalls with NR_syscalls. Signed-off-by: Rashmica Gupta <rashmicy@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>hifive-unleashed-5.1
parent
cdfc8ed690
commit
f43194e458
|
@ -12,10 +12,9 @@
|
||||||
#include <uapi/asm/unistd.h>
|
#include <uapi/asm/unistd.h>
|
||||||
|
|
||||||
|
|
||||||
#define __NR_syscalls 379
|
#define NR_syscalls 379
|
||||||
|
|
||||||
#define __NR__exit __NR_exit
|
#define __NR__exit __NR_exit
|
||||||
#define NR_syscalls __NR_syscalls
|
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include <linux/unistd.h>
|
#include <linux/unistd.h>
|
||||||
#include <linux/time.h>
|
#include <linux/time.h>
|
||||||
|
|
||||||
#define SYSCALL_MAP_SIZE ((__NR_syscalls + 31) / 32)
|
#define SYSCALL_MAP_SIZE ((NR_syscalls + 31) / 32)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* So here is the ppc64 backward compatible version
|
* So here is the ppc64 backward compatible version
|
||||||
|
|
|
@ -57,4 +57,4 @@
|
||||||
|
|
||||||
START_TABLE
|
START_TABLE
|
||||||
#include <asm/systbl.h>
|
#include <asm/systbl.h>
|
||||||
END_TABLE __NR_syscalls
|
END_TABLE NR_syscalls
|
||||||
|
|
|
@ -16,7 +16,7 @@ awk 'BEGIN { num = -1; } # Ignore the beginning of the file
|
||||||
/^START_TABLE/ { num = 0; next; }
|
/^START_TABLE/ { num = 0; next; }
|
||||||
/^END_TABLE/ {
|
/^END_TABLE/ {
|
||||||
if (num != $2) {
|
if (num != $2) {
|
||||||
printf "__NR_syscalls (%s) is not one more than the last syscall (%s)\n",
|
printf "NR_syscalls (%s) is not one more than the last syscall (%s)\n",
|
||||||
$2, num - 1;
|
$2, num - 1;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -671,7 +671,7 @@ static void __init vdso_setup_syscall_map(void)
|
||||||
extern unsigned long sys_ni_syscall;
|
extern unsigned long sys_ni_syscall;
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < __NR_syscalls; i++) {
|
for (i = 0; i < NR_syscalls; i++) {
|
||||||
#ifdef CONFIG_PPC64
|
#ifdef CONFIG_PPC64
|
||||||
if (sys_call_table[i*2] != sys_ni_syscall)
|
if (sys_call_table[i*2] != sys_ni_syscall)
|
||||||
vdso_data->syscall_map_64[i >> 5] |=
|
vdso_data->syscall_map_64[i >> 5] |=
|
||||||
|
|
|
@ -61,7 +61,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map)
|
||||||
addi r3,r3,CFG_SYSCALL_MAP32
|
addi r3,r3,CFG_SYSCALL_MAP32
|
||||||
cmpli cr0,r4,0
|
cmpli cr0,r4,0
|
||||||
beqlr
|
beqlr
|
||||||
li r0,__NR_syscalls
|
li r0,NR_syscalls
|
||||||
stw r0,0(r4)
|
stw r0,0(r4)
|
||||||
crclr cr0*4+so
|
crclr cr0*4+so
|
||||||
blr
|
blr
|
||||||
|
|
|
@ -62,7 +62,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map)
|
||||||
cmpli cr0,r4,0
|
cmpli cr0,r4,0
|
||||||
crclr cr0*4+so
|
crclr cr0*4+so
|
||||||
beqlr
|
beqlr
|
||||||
li r0,__NR_syscalls
|
li r0,NR_syscalls
|
||||||
stw r0,0(r4)
|
stw r0,0(r4)
|
||||||
blr
|
blr
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
|
|
|
@ -326,7 +326,7 @@ static int spu_process_callback(struct spu_context *ctx)
|
||||||
spu_ret = -ENOSYS;
|
spu_ret = -ENOSYS;
|
||||||
npc += 4;
|
npc += 4;
|
||||||
|
|
||||||
if (s.nr_ret < __NR_syscalls) {
|
if (s.nr_ret < NR_syscalls) {
|
||||||
spu_release(ctx);
|
spu_release(ctx);
|
||||||
/* do actual system call from here */
|
/* do actual system call from here */
|
||||||
spu_ret = spu_sys_callback(&s);
|
spu_ret = spu_sys_callback(&s);
|
||||||
|
|
Loading…
Reference in New Issue