From patchwork Sat Mar 14 20:34:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 6011691 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9A40B9F380 for ; Sat, 14 Mar 2015 20:34:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B851620173 for ; Sat, 14 Mar 2015 20:34:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D6DDD20172 for ; Sat, 14 Mar 2015 20:34:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751169AbbCNUe1 (ORCPT ); Sat, 14 Mar 2015 16:34:27 -0400 Received: from mout.gmx.net ([212.227.15.15]:59028 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750955AbbCNUe0 (ORCPT ); Sat, 14 Mar 2015 16:34:26 -0400 Received: from ls3530.box ([92.203.77.61]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MRWzQ-1YzZhL1QKm-00ScVB; Sat, 14 Mar 2015 21:34:19 +0100 Date: Sat, 14 Mar 2015 21:34:16 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley , John David Anglin Subject: [PATCH] parisc: Add compile-time check when adding new syscalls Message-ID: <20150314203416.GA10789@ls3530.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:XRiUtBM2//XB9Tkg1a+qKW9lt5/JMme7ktEgcBa3pM+DTmoRYgm dxQEu4GkNPJUtWvBuCX9/dcWxFpxepiBm408iwVL+qc5qbg6JPAyFCSetwG9uVqLElkUU9P 31SKpV8VhI8qJBQy7wGve8GD1vQ/DkqrwrfH/fN9tKD7RtYrLK/LwzDF4nXpGOEU0wZZQ4R xCpWdlWwTnGQi4vjVcIXw== X-UI-Out-Filterresults: notjunk:1; Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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