提交 1497eea6 编写于 作者: M Michael Ellerman

powerpc/syscalls: Use the number when building SPU syscall table

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: NMichael Ellerman <mpe@ellerman.id.au>
Acked-by: NArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200616135617.2937252-1-mpe@ellerman.id.au
上级 687993cc
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
*/ */
static void *spu_syscall_table[] = { static void *spu_syscall_table[] = {
#define __SYSCALL(nr, entry) entry, #define __SYSCALL(nr, entry) [nr] = entry,
#include <asm/syscall_table_spu.h> #include <asm/syscall_table_spu.h>
#undef __SYSCALL #undef __SYSCALL
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册