Skip to content

Commit 47514da

Browse files
committed
parisc: Add compile-time check when adding new syscalls
Signed-off-by: Helge Deller <deller@gmx.de>
1 parent bc465aa commit 47514da

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎arch/parisc/kernel/syscall_table.S‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
#define ENTRY_COMP(_name_) .word sys_##_name_
5656
#endif
5757

58-
ENTRY_SAME(restart_syscall) /* 0 */
59-
ENTRY_SAME(exit)
58+
90: ENTRY_SAME(restart_syscall) /* 0 */
59+
91: ENTRY_SAME(exit)
6060
ENTRY_SAME(fork_wrapper)
6161
ENTRY_SAME(read)
6262
ENTRY_SAME(write)
@@ -439,7 +439,10 @@
439439
ENTRY_SAME(bpf)
440440
ENTRY_COMP(execveat)
441441

442-
/* Nothing yet */
442+
443+
.ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b))
444+
.error "size of syscall table does not fit value of __NR_Linux_syscalls"
445+
.endif
443446

444447
#undef ENTRY_SAME
445448
#undef ENTRY_DIFF

0 commit comments

Comments
 (0)