aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRashmica Gupta <rashmicy@gmail.com>2015-11-19 01:04:53 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2015-11-26 06:11:17 -0500
commitf43194e45852b0455d2a3e3730f70daa76958423 (patch)
tree7d226223a0195bc11f13cd42a5a37a5f02b39387
parentcdfc8ed6904d7b0c0ca23d619b387b32070703b1 (diff)
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>
-rw-r--r--arch/powerpc/include/asm/unistd.h3
-rw-r--r--arch/powerpc/include/asm/vdso_datapage.h2
-rw-r--r--arch/powerpc/kernel/systbl_chk.c2
-rw-r--r--arch/powerpc/kernel/systbl_chk.sh2
-rw-r--r--arch/powerpc/kernel/vdso.c2
-rw-r--r--arch/powerpc/kernel/vdso32/datapage.S2
-rw-r--r--arch/powerpc/kernel/vdso64/datapage.S2
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c2
8 files changed, 8 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index 4b6b8ace18e0..6a5ace5fa0c8 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -12,10 +12,9 @@
12#include <uapi/asm/unistd.h> 12#include <uapi/asm/unistd.h>
13 13
14 14
15#define __NR_syscalls 379 15#define NR_syscalls 379
16 16
17#define __NR__exit __NR_exit 17#define __NR__exit __NR_exit
18#define NR_syscalls __NR_syscalls
19 18
20#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
21 20
diff --git a/arch/powerpc/include/asm/vdso_datapage.h b/arch/powerpc/include/asm/vdso_datapage.h
index b73a8199f161..1afe90ade595 100644
--- a/arch/powerpc/include/asm/vdso_datapage.h
+++ b/arch/powerpc/include/asm/vdso_datapage.h
@@ -41,7 +41,7 @@
41#include <linux/unistd.h> 41#include <linux/unistd.h>
42#include <linux/time.h> 42#include <linux/time.h>
43 43
44#define SYSCALL_MAP_SIZE ((__NR_syscalls + 31) / 32) 44#define SYSCALL_MAP_SIZE ((NR_syscalls + 31) / 32)
45 45
46/* 46/*
47 * So here is the ppc64 backward compatible version 47 * So here is the ppc64 backward compatible version
diff --git a/arch/powerpc/kernel/systbl_chk.c b/arch/powerpc/kernel/systbl_chk.c
index 2384129f5893..55323a620cfe 100644
--- a/arch/powerpc/kernel/systbl_chk.c
+++ b/arch/powerpc/kernel/systbl_chk.c
@@ -57,4 +57,4 @@
57 57
58START_TABLE 58START_TABLE
59#include <asm/systbl.h> 59#include <asm/systbl.h>
60END_TABLE __NR_syscalls 60END_TABLE NR_syscalls
diff --git a/arch/powerpc/kernel/systbl_chk.sh b/arch/powerpc/kernel/systbl_chk.sh
index 19415e7674a5..31b6e7c358ca 100644
--- a/arch/powerpc/kernel/systbl_chk.sh
+++ b/arch/powerpc/kernel/systbl_chk.sh
@@ -16,7 +16,7 @@ awk 'BEGIN { num = -1; } # Ignore the beginning of the file
16 /^START_TABLE/ { num = 0; next; } 16 /^START_TABLE/ { num = 0; next; }
17 /^END_TABLE/ { 17 /^END_TABLE/ {
18 if (num != $2) { 18 if (num != $2) {
19 printf "__NR_syscalls (%s) is not one more than the last syscall (%s)\n", 19 printf "NR_syscalls (%s) is not one more than the last syscall (%s)\n",
20 $2, num - 1; 20 $2, num - 1;
21 exit(1); 21 exit(1);
22 } 22 }
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index b457bfa28436..def1b8b5e6c1 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -671,7 +671,7 @@ static void __init vdso_setup_syscall_map(void)
671 extern unsigned long sys_ni_syscall; 671 extern unsigned long sys_ni_syscall;
672 672
673 673
674 for (i = 0; i < __NR_syscalls; i++) { 674 for (i = 0; i < NR_syscalls; i++) {
675#ifdef CONFIG_PPC64 675#ifdef CONFIG_PPC64
676 if (sys_call_table[i*2] != sys_ni_syscall) 676 if (sys_call_table[i*2] != sys_ni_syscall)
677 vdso_data->syscall_map_64[i >> 5] |= 677 vdso_data->syscall_map_64[i >> 5] |=
diff --git a/arch/powerpc/kernel/vdso32/datapage.S b/arch/powerpc/kernel/vdso32/datapage.S
index 59cf5f452879..3745113fcc65 100644
--- a/arch/powerpc/kernel/vdso32/datapage.S
+++ b/arch/powerpc/kernel/vdso32/datapage.S
@@ -61,7 +61,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map)
61 addi r3,r3,CFG_SYSCALL_MAP32 61 addi r3,r3,CFG_SYSCALL_MAP32
62 cmpli cr0,r4,0 62 cmpli cr0,r4,0
63 beqlr 63 beqlr
64 li r0,__NR_syscalls 64 li r0,NR_syscalls
65 stw r0,0(r4) 65 stw r0,0(r4)
66 crclr cr0*4+so 66 crclr cr0*4+so
67 blr 67 blr
diff --git a/arch/powerpc/kernel/vdso64/datapage.S b/arch/powerpc/kernel/vdso64/datapage.S
index 2f01c4a0d8a0..184a6ba7f283 100644
--- a/arch/powerpc/kernel/vdso64/datapage.S
+++ b/arch/powerpc/kernel/vdso64/datapage.S
@@ -62,7 +62,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map)
62 cmpli cr0,r4,0 62 cmpli cr0,r4,0
63 crclr cr0*4+so 63 crclr cr0*4+so
64 beqlr 64 beqlr
65 li r0,__NR_syscalls 65 li r0,NR_syscalls
66 stw r0,0(r4) 66 stw r0,0(r4)
67 blr 67 blr
68 .cfi_endproc 68 .cfi_endproc
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index 4ddf769a64e5..9f79004e6d6f 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -326,7 +326,7 @@ static int spu_process_callback(struct spu_context *ctx)
326 spu_ret = -ENOSYS; 326 spu_ret = -ENOSYS;
327 npc += 4; 327 npc += 4;
328 328
329 if (s.nr_ret < __NR_syscalls) { 329 if (s.nr_ret < NR_syscalls) {
330 spu_release(ctx); 330 spu_release(ctx);
331 /* do actual system call from here */ 331 /* do actual system call from here */
332 spu_ret = spu_sys_callback(&s); 332 spu_ret = spu_sys_callback(&s);