linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: linux-parisc@vger.kernel.org,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	John David Anglin <dave.anglin@bell.net>
Subject: [PATCH] parisc: Add compile-time check when adding new syscalls
Date: Sat, 14 Mar 2015 21:34:16 +0100	[thread overview]
Message-ID: <20150314203416.GA10789@ls3530.box> (raw)

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

             reply	other threads:[~2015-03-14 20:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-14 20:34 Helge Deller [this message]
2015-03-15 20:32 ` [PATCH, v2] parisc: Add compile-time check when adding new syscalls Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150314203416.GA10789@ls3530.box \
    --to=deller@gmx.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dave.anglin@bell.net \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).