All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parisc: Add compile-time check when adding new syscalls
@ 2015-03-14 20:34 Helge Deller
  2015-03-15 20:32 ` [PATCH, v2] " Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: Helge Deller @ 2015-03-14 20:34 UTC (permalink / raw)
  To: linux-parisc, James Bottomley, John David Anglin

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 5a8997d..802f807 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -41,20 +41,25 @@
 #define ENTRY_UHOH(_name_) .dword sys32_##unimplemented
 #define ENTRY_OURS(_name_) .dword parisc_##_name_
 #define ENTRY_COMP(_name_) .dword compat_sys_##_name_
+#define SYSCALLTABLE_NAME  syscall_table_compat
 #elif defined(CONFIG_64BIT) && defined(SYSCALL_TABLE_64BIT)
 #define ENTRY_SAME(_name_) .dword sys_##_name_
 #define ENTRY_DIFF(_name_) .dword sys_##_name_
 #define ENTRY_UHOH(_name_) .dword sys_##_name_
 #define ENTRY_OURS(_name_) .dword sys_##_name_
 #define ENTRY_COMP(_name_) .dword sys_##_name_
+#define SYSCALLTABLE_NAME  syscall_table_64bit
 #else
 #define ENTRY_SAME(_name_) .word sys_##_name_
 #define ENTRY_DIFF(_name_) .word sys_##_name_
 #define ENTRY_UHOH(_name_) .word sys_##_name_
 #define ENTRY_OURS(_name_) .word parisc_##_name_
 #define ENTRY_COMP(_name_) .word sys_##_name_
+#define SYSCALLTABLE_NAME  syscall_table_32bit
 #endif
 
+        .local SYSCALLTABLE_NAME
+SYSCALLTABLE_NAME:
 	ENTRY_SAME(restart_syscall)	/* 0 */
 	ENTRY_SAME(exit)
 	ENTRY_SAME(fork_wrapper)
@@ -439,8 +444,21 @@
 	ENTRY_SAME(bpf)
 	ENTRY_COMP(execveat)
 
+
+        .size SYSCALLTABLE_NAME, . - SYSCALLTABLE_NAME
+        .type SYSCALLTABLE_NAME, @object
+
+#if defined(CONFIG_64BIT)
+.ifne (. - SYSCALLTABLE_NAME) - (__NR_Linux_syscalls * 8)
+#else /* !defined(CONFIG_64BIT) */
+.ifne (. - SYSCALLTABLE_NAME) - (__NR_Linux_syscalls * 4)
+#endif
+.error "syscall table not in sync with value of __NR_Linux_syscalls"
+.endif
+
 	/* Nothing yet */
 
+#undef SYSCALLTABLE_NAME
 #undef ENTRY_SAME
 #undef ENTRY_DIFF
 #undef ENTRY_UHOH

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

* Re: [PATCH, v2] parisc: Add compile-time check when adding new syscalls
  2015-03-14 20:34 [PATCH] parisc: Add compile-time check when adding new syscalls Helge Deller
@ 2015-03-15 20:32 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2015-03-15 20:32 UTC (permalink / raw)
  To: linux-parisc, James Bottomley, John David Anglin

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 5a8997d..0959fcc 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -55,6 +55,7 @@
 #define ENTRY_COMP(_name_) .word sys_##_name_
 #endif
 
+99:
 	ENTRY_SAME(restart_syscall)	/* 0 */
 	ENTRY_SAME(exit)
 	ENTRY_SAME(fork_wrapper)
@@ -439,6 +440,15 @@
 	ENTRY_SAME(bpf)
 	ENTRY_COMP(execveat)
 
+
+#if defined(CONFIG_64BIT)
+.ifne (. - 99b) - (__NR_Linux_syscalls * 8)
+#else /* !defined(CONFIG_64BIT) */
+.ifne (. - 99b) - (__NR_Linux_syscalls * 4)
+#endif
+.error "size of syscall table does not fit value of __NR_Linux_syscalls"
+.endif
+
 	/* Nothing yet */
 
 #undef ENTRY_SAME

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

end of thread, other threads:[~2015-03-15 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-14 20:34 [PATCH] parisc: Add compile-time check when adding new syscalls Helge Deller
2015-03-15 20:32 ` [PATCH, v2] " Helge Deller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.