linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 1/5] powerpc/syscalls: Use the number when building SPU syscall table
@ 2019-01-16 13:27 Michael Ellerman
  2019-01-16 13:27 ` [RFC PATCH v2 2/5] powerpc/syscalls: Remove unused offset parameter Michael Ellerman
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Michael Ellerman @ 2019-01-16 13:27 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: firoz.khan, arnd

Currently the macro that inserts entries into the SPU syscall table
doesn't actually use the "nr" (syscall number) parameter.

This does work, but it relies on the exact right number of syscall
entries being emitted in order for the syscal numbers to line up with
the array entries. If for example we had two entries with the same
syscall number we wouldn't get an error, it would just cause all
subsequent syscalls to be off by one in the spu_syscall_table.

So instead change the macro to assign to the specific entry of the
array, meaning any numbering overlap will be caught by the compiler.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/powerpc/platforms/cell/spu_callbacks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

v2: Add Arnd's ack.

diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index 2f03671ac8db..8f94acdd6d6d 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -34,7 +34,7 @@
  */
 
 void *spu_syscall_table[] = {
-#define __SYSCALL(nr, entry, nargs) entry,
+#define __SYSCALL(nr, entry, nargs) [nr] = entry,
 #include <asm/syscall_table_spu.h>
 #undef __SYSCALL
 };
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-01-18  6:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 13:27 [RFC PATCH v2 1/5] powerpc/syscalls: Use the number when building SPU syscall table Michael Ellerman
2019-01-16 13:27 ` [RFC PATCH v2 2/5] powerpc/syscalls: Remove unused offset parameter Michael Ellerman
2019-01-18  6:33   ` Firoz Khan
2019-01-16 13:27 ` [RFC PATCH v2 3/5] powerpc/syscalls: Remove unused prefix parameter Michael Ellerman
2019-01-16 13:27 ` [RFC PATCH v2 4/5] powerpc/syscalls: Split SPU-ness out of ABI Michael Ellerman
2019-01-16 13:27 ` [RFC PATCH v2 5/5] powerpc/syscalls: Allow none instead of sys_ni_syscall Michael Ellerman
2019-01-16 13:53   ` Arnd Bergmann
2019-01-17 10:35     ` Michael Ellerman
2019-01-17 12:21       ` Arnd Bergmann
2019-01-18  6:40     ` Firoz Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).