From patchwork Wed Nov 14 04:32:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 10681915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E1B15139B for ; Wed, 14 Nov 2018 04:32:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D28A22B2A7 for ; Wed, 14 Nov 2018 04:32:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C34092B2F3; Wed, 14 Nov 2018 04:32:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 581052B2A7 for ; Wed, 14 Nov 2018 04:32:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726610AbeKNOeJ (ORCPT ); Wed, 14 Nov 2018 09:34:09 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40481 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726842AbeKNOeI (ORCPT ); Wed, 14 Nov 2018 09:34:08 -0500 Received: by mail-pl1-f195.google.com with SMTP id b22-v6so1687882pls.7 for ; Tue, 13 Nov 2018 20:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=vdye+BuNHW8Eg+iXkudWiq6lS6xa8P7cm7FkstY9enU=; b=Vh7nmonYCRHQonc2SkIQwGTIEwQvP+l51cew7Rd4TmtHEl4EJkYaaV+oH+we8aH1ch 4jw/vsgjg1FouErwSBTtpY5qOoGS0EmhRDAf0e79nXyZZjN+nC1cG7T5Ickitv+eONbT p2t88YQGlKsz78BG2Edm2Bf1dmccvNI7v9CKk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vdye+BuNHW8Eg+iXkudWiq6lS6xa8P7cm7FkstY9enU=; b=ftmT2BoVK3FcwvOyoE4+ayYrm01TeWI/aVR2R6Y8Aorw8PLA92cNSmyXpowxMHpPuU 3pmGl/PM2JKcO4lYSM+YR6ZRXiiPMkrd61kDwS3kJqy3/JAe9Y0nv4M2Fgdazq+wr92H VT8i+94J6OsB0qDw4LUihFL5rCfJdyVdBzPx18RL01R0scc7hIVxSya6WDt1gmC5qEPH wpRRQJUIqbPbLoTCtObS0iEVDMFfoKr1W0BUJe65TO0QOcU54ZkXF2SfOZOcQm7/R/RE CRDeK/Juk0H7MO5QHCLGZxs6wsdVlNcr6VHMp0zKzVtZz/uPKOwMejkDcUm7SoyX89MJ azKQ== X-Gm-Message-State: AGRZ1gJKKmyqoAZTdoxVjvqM6e9OPSfYcNvMKn2pnEYhaG80wABEsbN4 cNkZc8mvlb83ia+0k8wavaduICxhcLg= X-Google-Smtp-Source: AJdET5dL3IaBjPKIHl6H40uZ/K5ElfANFrmpCnQ2ewWGnefHqVvFZiYQgq/rOXMafk6USBJ7mxA7KA== X-Received: by 2002:a17:902:5ac7:: with SMTP id g7mr405896plm.212.1542169958958; Tue, 13 Nov 2018 20:32:38 -0800 (PST) Received: from qualcomm-HP-ZBook-14-G2.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id a17sm26382842pgm.26.2018.11.13.20.32.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Nov 2018 20:32:38 -0800 (PST) From: Firoz Khan To: linux-sh@vger.kernel.org, Yoshinori Sato , Rich Felker , Greg Kroah-Hartman , Philippe Ombredanne , Thomas Gleixner , Kate Stewart Cc: y2038@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, arnd@arndb.de, deepa.kernel@gmail.com, marcin.juszkiewicz@linaro.org, firoz.khan@linaro.org Subject: [PATCH v3 0/3] sh: system call table generation support Date: Wed, 14 Nov 2018 10:02:07 +0530 Message-Id: <1542169930-24118-1-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The purpose of this patch series is, we can easily add/modify/delete system call table support by cha- nging entry in syscall.tbl file instead of manually changing many files. The other goal is to unify the system call table generation support implementation across all the architectures. The system call tables are in different format in all architecture. It will be difficult to manually add, modify or delete the system calls in the resp- ective files manually. To make it easy by keeping a script and which'll generate uapi header file and syscall table file. syscall.tbl contains the list of available system calls along with system call number and correspond- ing entry point. Add a new system call in this arch- itecture will be possible by adding new entry in the syscall.tbl file. Adding a new table entry consisting of: - System call number. - ABI. - System call name. - Entry point name. Please note, this support is only available for 32-bit kernel, not 64-bit kernel. As I came across the 64-bit kernel is not active for long time. ARM, s390 and x86 architecuture does exist the sim- ilar support. I leverage their implementation to come up with a generic solution. I have done the same support for work for alpha, ia64, m68k, microblaze, mips, parisc, powerpc, sparc, and xtensa. Below mentioned git repository contains more details about the workflow. https://github.com/frzkhn/system_call_table_generator/ Finally, this is the ground work to solve the Y2038 issue. We need to add two dozen of system calls to solve Y2038 issue. So this patch series will help to add new system calls easily by adding new entry in the syscall- .tbl. Changes since v2: - changed from generic-y to generated-y in Kbuild. Changes since v1: - optimized/updated the syscall table generation scripts. - fixed all mixed indentation issues in syscall.tbl. - added "comments" in syscall.tbl. Firoz Khan (3): sh: add __NR_syscalls along with NR_syscalls sh: add system call table generation support sh: generate uapi header and syscall table header files arch/sh/Makefile | 3 + arch/sh/include/asm/Kbuild | 1 + arch/sh/include/asm/unistd.h | 2 + arch/sh/include/uapi/asm/Kbuild | 1 + arch/sh/include/uapi/asm/unistd_32.h | 4 +- arch/sh/include/uapi/asm/unistd_64.h | 4 +- arch/sh/kernel/syscalls/Makefile | 38 ++++ arch/sh/kernel/syscalls/syscall.tbl | 392 ++++++++++++++++++++++++++++++++++ arch/sh/kernel/syscalls/syscallhdr.sh | 36 ++++ arch/sh/kernel/syscalls/syscalltbl.sh | 32 +++ arch/sh/kernel/syscalls_32.S | 387 +-------------------------------- 11 files changed, 514 insertions(+), 386 deletions(-) create mode 100644 arch/sh/kernel/syscalls/Makefile create mode 100644 arch/sh/kernel/syscalls/syscall.tbl create mode 100644 arch/sh/kernel/syscalls/syscallhdr.sh create mode 100644 arch/sh/kernel/syscalls/syscalltbl.sh Acked-by: Rich Felker