powerpc: Standardise on NR_syscalls rather than __NR_syscalls.
Subsystems (3)
PATCH 1/1 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.
--- arch/powerpc/include/asm/unistd.h | 3 +-- arch/powerpc/include/asm/vdso_datapage.h | 2 +- arch/powerpc/kernel/systbl_chk.c | 2 +- arch/powerpc/kernel/systbl_chk.sh | 2 +- arch/powerpc/kernel/vdso.c | 2 +- arch/powerpc/kernel/vdso32/datapage.S | 2 +- arch/powerpc/kernel/vdso64/datapage.S | 2 +- arch/powerpc/platforms/cell/spufs/run.c | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-)
arch/powerpc/include/asm/unistd.h +1 -2
@@ -12,10 +12,9 @@#include <uapi/asm/unistd.h> -#define __NR_syscalls 378 +#define NR_syscalls 378#define __NR__exit __NR_exit -#define NR_syscalls __NR_syscalls#ifndef __ASSEMBLY__
arch/powerpc/include/asm/vdso_datapage.h +1 -1
@@ -41,7 +41,7 @@#include <linux/unistd.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
arch/powerpc/kernel/systbl_chk.c +1 -1
@@ -57,4 +57,4 @@ START_TABLE#include <asm/systbl.h> -END_TABLE __NR_syscalls +END_TABLE NR_syscalls
arch/powerpc/kernel/systbl_chk.sh +1 -1
@@ -16,7 +16,7 @@ awk 'BEGIN { num = -1; } # Ignore the beginning of the file /^START_TABLE/ { num = 0; next; } /^END_TABLE/ { 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; exit(1); }
arch/powerpc/kernel/vdso.c +1 -1
@@ -671,7 +671,7 @@ static void __init vdso_setup_syscall_map(void)extern unsigned long sys_ni_syscall; -for (i =0 ; i < __NR_syscalls; i++) { +for (i =0 ; i < NR_syscalls; i++) {#ifdef CONFIG_PPC64 if (sys_call_table[i*2 ] != sys_ni_syscall) vdso_data->syscall_map_64[i >> 5] |=
arch/powerpc/kernel/vdso32/datapage.S +1 -1
@@ -61,7 +61,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) addi r3,r3,CFG_SYSCALL_MAP32 cmpli cr0,r4,0 beqlr - li r0,__NR_syscalls + li r0,NR_syscalls stw r0,0(r4) crclr cr0*4+so blr
arch/powerpc/kernel/vdso64/datapage.S +1 -1
@@ -62,7 +62,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) cmpli cr0,r4,0 crclr cr0*4+so beqlr - li r0,__NR_syscalls + li r0,NR_syscalls stw r0,0(r4) blr .cfi_endproc
arch/powerpc/platforms/cell/spufs/run.c +1 -1
@@ -326,7 +326,7 @@ static int spu_process_callback(struct spu_context *ctx) spu_ret = -ENOSYS ; npc +=4 ; -if (s.nr_ret < __NR_syscalls) { +if (s.nr_ret < NR_syscalls) {spu_release (ctx);/* do actual system call from here */ spu_ret =spu_sys_callback (&s);
Signature · 1 line
2.5.0
Quoted 9 lines · Rashmica Gupta
Most architectures use
NR_syscallsas the #define for the number of syscalls.We use
__NR_syscalls, and then defineNR_syscallsas__NR_syscalls.
__NR_syscallsis not used outside arch code, whereasNR_syscallsis. So asNR_syscallsmust be defined and__NR_syscallsdoes not, replace__NR_syscalls
withNR_syscalls.
Hi,
But what's wrong with the current code? Why do we need such change?
Thank you.
Quoted 133 lines
Signed-off-by Rashmica Gupta <[email protected]>--- arch/powerpc/include/asm/unistd.h | 3 +-- arch/powerpc/include/asm/vdso_datapage.h | 2 +- arch/powerpc/kernel/systbl_chk.c | 2 +- arch/powerpc/kernel/systbl_chk.sh | 2 +- arch/powerpc/kernel/vdso.c | 2 +- arch/powerpc/kernel/vdso32/datapage.S | 2 +- arch/powerpc/kernel/vdso64/datapage.S | 2 +- arch/powerpc/platforms/cell/spufs/run.c | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-)arch/powerpc/include/asm/unistd.h +1
-2@@ -12,10 +12,9 @@#include <uapi/asm/unistd.h> -#define __NR_syscalls 378 +#define NR_syscalls 378#define __NR__exit __NR_exit -#define NR_syscalls __NR_syscalls#ifndef __ASSEMBLY__arch/powerpc/include/asm/vdso_datapage.h +1
-1@@ -41,7 +41,7 @@#include <linux/unistd.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 arch/powerpc/kernel/systbl_chk.c +1
-1@@ -57,4 +57,4 @@ START_TABLE#include <asm/systbl.h> -END_TABLE __NR_syscalls +END_TABLE NR_syscallsarch/powerpc/kernel/systbl_chk.sh +0
-0@@ -16,7 +16,7 @@ awk 'BEGIN { num = -1; } # Ignore the beginning of thefile
arch/powerpc/kernel/systbl_chk.sh +0
-1/^START_TABLE/ { num = 0; next; } /^END_TABLE/ { if (num != $2) { - printf "__NR_syscalls (%s) is not one more than the last syscall(%s)\n",
arch/powerpc/kernel/systbl_chk.sh +1
-0+ printf "NR_syscalls (%s) is not one more than the last syscall (%s)\n", $2, num - 1; exit(1); }arch/powerpc/kernel/vdso.c +1
-1@@ -671,7 +671,7 @@ static void __init vdso_setup_syscall_map(void)extern unsigned long sys_ni_syscall; -for (i =0 ; i < __NR_syscalls; i++) { +for (i =0 ; i < NR_syscalls; i++) {#ifdef CONFIG_PPC64 if (sys_call_table[i*2 ] != sys_ni_syscall) vdso_data->syscall_map_64[i >> 5] |=arch/powerpc/kernel/vdso32/datapage.S +1
-1@@ -61,7 +61,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) addi r3,r3,CFG_SYSCALL_MAP32 cmpli cr0,r4,0 beqlr - li r0,__NR_syscalls + li r0,NR_syscalls stw r0,0(r4) crclr cr0*4+so blrarch/powerpc/kernel/vdso64/datapage.S +1
-1@@ -62,7 +62,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) cmpli cr0,r4,0 crclr cr0*4+so beqlr - li r0,__NR_syscalls + li r0,NR_syscalls stw r0,0(r4) blr .cfi_endprocarch/powerpc/platforms/cell/spufs/run.c +1
-2@@ -326,7 +326,7 @@ static int spu_process_callback(struct spu_context *ctx) spu_ret = -ENOSYS ; npc +=4 ; -if (s.nr_ret < __NR_syscalls) { +if (s.nr_ret < NR_syscalls) {spu_release (ctx);/* do actual system call from here */ spu_ret =spu_sys_callback (&s); --2.5.0
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev
Quoted 6 lines · Denis Kirjanov
Quoted 5 lines · Rashmica Gupta
Quoted 5 lines
Most architectures use
NR_syscallsas the #define for the number of syscalls.We use
__NR_syscalls, and then defineNR_syscallsas__NR_syscalls.
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
__NR_syscallsis not used outside arch code, whereasNR_syscallsis. So asNR_syscallsmust be defined and__NR_syscallsdoes not, replace__NR_syscalls
withNR_syscalls.Hi,
But what's wrong with the current code? Why do we need such change?
Yeah, just out of curiosity. Why we had both __NR_syscalls and NR_syscalls to begin with ?
Quoted 14 lines · Anshuman Khandual
Quoted 13 lines · Denis Kirjanov
Quoted 12 lines · Rashmica Gupta
Quoted 12 lines
Most architectures use
NR_syscallsas the #define for the number of
syscalls.We use
__NR_syscalls, and then defineNR_syscallsas__NR_syscalls.
__NR_syscallsis not used outside arch code, whereasNR_syscallsis. So asNR_syscallsmust be defined and__NR_syscallsdoes not, replace__NR_syscalls
withNR_syscalls.
Quoted 6 lines
Quoted 3 lines
Hi,
But what's wrong with the current code? Why do we need such change?
Yeah, just out of curiosity. Why we had both
__NR_syscallsandNR_syscallsto begin with ?
Evolutionary remains. This is a whorthwhile and fairly simple cleanup.
Cheers,
Ben.
Michael Ellerman
reviewerQuoted 7 lines · Denis Kirjanov
Quoted 5 lines · Rashmica Gupta
Most architectures use
NR_syscallsas the #define for the number of syscalls.We use
__NR_syscalls, and then defineNR_syscallsas__NR_syscalls.
Quoted 7 lines
Quoted 3 lines
__NR_syscallsis not used outside arch code, whereasNR_syscallsis. So asNR_syscallsmust be defined and__NR_syscallsdoes not, replace__NR_syscallswithNR_syscalls.Hi,
But what's wrong with the current code? Why do we need such change?
The change log explains it fairly well I think. Which part is not clear?
cheers
Quoted 14 lines · Michael Ellerman
Quoted 12 lines · Denis Kirjanov
Quoted 9 lines · Rashmica Gupta
Most architectures use
NR_syscallsas the #define for the number of syscalls.We use
__NR_syscalls, and then defineNR_syscallsas__NR_syscalls.
__NR_syscallsis not used outside arch code, whereasNR_syscallsis. So asNR_syscallsmust be defined and__NR_syscallsdoes not, replace__NR_syscallswithNR_syscalls.
Quoted 5 lines
Quoted 3 lines
Hi,
But what's wrong with the current code? Why do we need such change?
The change log explains it fairly well I think. Which part is not clear?
Ok, first I wasn't aware that NR_syscalls has external users such as tracing. Agreed, it's better to have only one definition in this case.
Quoted 4 lines
cheers
Michael Ellerman
reviewerQuoted 13 lines · Denis Kirjanov
Quoted 12 lines · Michael Ellerman
Quoted 11 lines · Denis Kirjanov
Quoted 9 lines · Rashmica Gupta
Most architectures use
NR_syscallsas the #define for the number of syscalls.We use
__NR_syscalls, and then defineNR_syscallsas__NR_syscalls.
__NR_syscallsis not used outside arch code, whereasNR_syscallsis. So asNR_syscallsmust be defined and__NR_syscallsdoes not, replace__NR_syscallswithNR_syscalls.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Hi,
But what's wrong with the current code? Why do we need such change?
The change log explains it fairly well I think. Which part is not clear?
Ok, first I wasn't aware that
NR_syscallshas external users such as tracing. Agreed, it's better to have only one definition in this case.
Right, apart from tracing it would just be an arch internal detail. But since we must #define NR_syscalls for tracing it's cleaner to just have that.
cheers
Quoted 25 lines · Rashmica Gupta
Most architectures use
NR_syscallsas the #define for the number of syscalls.We use
__NR_syscalls, and then defineNR_syscallsas__NR_syscalls.
__NR_syscallsis not used outside arch code, whereasNR_syscallsis. So asNR_syscallsmust be defined and__NR_syscallsdoes not, replace__NR_syscallswithNR_syscalls.Signed-off-by Rashmica Gupta <[email protected]>--- arch/powerpc/include/asm/unistd.h | 3 +-- arch/powerpc/include/asm/vdso_datapage.h | 2 +- arch/powerpc/kernel/systbl_chk.c | 2 +- arch/powerpc/kernel/systbl_chk.sh | 2 +- arch/powerpc/kernel/vdso.c | 2 +- arch/powerpc/kernel/vdso32/datapage.S | 2 +- arch/powerpc/kernel/vdso64/datapage.S | 2 +- arch/powerpc/platforms/cell/spufs/run.c | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-)arch/powerpc/include/asm/unistd.h +0
-0
arch/powerpc/include/asm/unistd.h line 15
Quoted 5 lines
arch/powerpc/include/asm/unistd.h +1
-1@@ -12,10 +12,9 @@#include <uapi/asm/unistd.h> -#define __NR_syscalls 378 +#define NR_syscalls 378
This does not apply any more because of Michael's recent mlock2() system call enablement commit. Please do rebase and resend.
- Anshuman
Michael Ellerman
reviewerQuoted 20 lines · Anshuman Khandual
Quoted 18 lines · Rashmica Gupta
Most architectures use
NR_syscallsas the #define for the number of syscalls.We use
__NR_syscalls, and then defineNR_syscallsas__NR_syscalls.
__NR_syscallsis not used outside arch code, whereasNR_syscallsis. So asNR_syscallsmust be defined and__NR_syscallsdoes not, replace__NR_syscallswithNR_syscalls.Signed-off-by Rashmica Gupta <[email protected]>arch/powerpc/include/asm/unistd.h +0
-0@@ -12,10 +12,9 @@#include <uapi/asm/unistd.h>
Quoted 5 lines
arch/powerpc/include/asm/unistd.h line 15
Quoted 2 lines
arch/powerpc/include/asm/unistd.h +1
-1-#define __NR_syscalls 378 +#define NR_syscalls 378This does not apply any more because of Michael's recent
mlock2()system call enablement commit. Please do rebase and resend.
That's fine, I can fix up trivial conflicts like that myself.
cheers
Quoted 9 lines · Rashmica Gupta
Most architectures use
NR_syscallsas the #define for the number of syscalls.We use
__NR_syscalls, and then defineNR_syscallsas__NR_syscalls.
__NR_syscallsis not used outside arch code, whereasNR_syscallsis. So asNR_syscallsmust be defined and__NR_syscallsdoes not, replace__NR_syscallswithNR_syscalls.Signed-off-by Rashmica Gupta <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/f43194e45852b0455d2a3e37
cheers