From patchwork Mon Jun 15 16:42:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 49891 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B04BF2159B for ; Mon, 15 Jun 2015 16:43:06 +0000 (UTC) Received: by wgbhy7 with SMTP id hy7sf13614494wgb.3 for ; Mon, 15 Jun 2015 09:43:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=pQV+2+/HPnlstOQd5SWvo8Qjk24ryTJ3gN9phlrVSVk=; b=R1HfAsS8+dLBeUZ7iVYdTuon0JHWBC8gUiTqyfx0BdvCky8wKBMsW7G0/U6Obh2Fx3 eU10wzcuMdtRETcoYD3teFvvzPGIdZtdoPIJqzCVo8dWyZgsEJpbAuZ6JJGoAgucx6ZT Lwyj7d2QZ2hfS9yOyjHpIUGPAaSlaNVUTff8Re/aTrunGv/7VyY6H3AScVX1+QvO+9SG WmwhvI4Ud2fVwvvuUNaX46Gx9Un8Sc7dcLp05v8FLUKfRf10Hn6a3HPjQzIhymGt1CKH 3A13RMxsgZq5puxkWugl02fwHCQt8QoTiD2NFYc6GzHfhO30AIkpS9lhZT/hqagBFKIW TBkA== X-Gm-Message-State: ALoCoQnfrayQJjoKhAyNwRnwu2sTjkxEpfV8TUVLvCIvZ2VLxsOeWBY/fHptcHUuKhe03VNVm25B X-Received: by 10.112.53.102 with SMTP id a6mr952872lbp.16.1434386585995; Mon, 15 Jun 2015 09:43:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.174 with SMTP id p14ls83083lal.68.gmail; Mon, 15 Jun 2015 09:43:05 -0700 (PDT) X-Received: by 10.112.13.97 with SMTP id g1mr1128289lbc.52.1434386585717; Mon, 15 Jun 2015 09:43:05 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id o7si10920659lbw.36.2015.06.15.09.43.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 09:43:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbwc1 with SMTP id wc1so5318339lbb.2 for ; Mon, 15 Jun 2015 09:43:05 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr1070834lbc.41.1434386585619; Mon, 15 Jun 2015 09:43:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1538706lbb; Mon, 15 Jun 2015 09:43:04 -0700 (PDT) X-Received: by 10.140.105.69 with SMTP id b63mr8735219qgf.66.1434386584788; Mon, 15 Jun 2015 09:43:04 -0700 (PDT) Received: from mail-qk0-f170.google.com (mail-qk0-f170.google.com. [209.85.220.170]) by mx.google.com with ESMTPS id s4si2165145qct.29.2015.06.15.09.43.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 09:43:04 -0700 (PDT) Received-SPF: pass (google.com: domain of dave.long@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by qkfe185 with SMTP id e185so16190923qkf.3 for ; Mon, 15 Jun 2015 09:43:04 -0700 (PDT) X-Received: by 10.140.88.5 with SMTP id s5mr26263300qgd.59.1434386584084; Mon, 15 Jun 2015 09:43:04 -0700 (PDT) Received: from localhost.localdomain (pool-72-71-243-249.cncdnh.fast00.myfairpoint.net. [72.71.243.249]) by mx.google.com with ESMTPSA id 67sm6544026qkx.38.2015.06.15.09.43.02 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Jun 2015 09:43:03 -0700 (PDT) From: David Long To: "H. Peter Anvin" , Andy Lutomirski , Anton Blanchard , Behan Webster , Benjamin Herrenschmidt , Eric Paris , Heiko Carstens , Ingo Molnar , Jan Willeke , Kees Cook , Martin Schwidefsky , Michael Ellerman , Nikolay Borisov , Oleg Nesterov , Paul Mackerras , Richard Kuo , Robert Richter , Roland McGrath , Russell King , Tejun Heo , Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux390@de.ibm.com, linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: [PATCH 1/2] Move the pt_regs_offset struct definition from arch to common include file Date: Mon, 15 Jun 2015 12:42:58 -0400 Message-Id: <1434386579-6045-2-git-send-email-dave.long@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1434386579-6045-1-git-send-email-dave.long@linaro.org> References: <1434386579-6045-1-git-send-email-dave.long@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dave.long@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: "David A. Long" The pt_regs_offset structure is used for HAVE_REGS_AND_STACK_ACCESS_API feature and has identical definitions in four different arch ptrace.h include files. It seems unlikely that definition would ever need to be changed regardless of architecture so lets move it into include/linux/ptrace.h. Signed-off-by: David A. Long --- arch/arm/kernel/ptrace.c | 5 ----- arch/powerpc/kernel/ptrace.c | 5 ----- arch/sh/include/asm/ptrace.h | 5 ----- arch/x86/kernel/ptrace.c | 5 ----- include/linux/ptrace.h | 9 +++++++++ 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index ef9119f..fb45cf1 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -59,11 +59,6 @@ #define BREAKINST_THUMB 0xde01 #endif -struct pt_regs_offset { - const char *name; - int offset; -}; - #define REG_OFFSET_NAME(r) \ {.name = #r, .offset = offsetof(struct pt_regs, ARM_##r)} #define REG_OFFSET_END {.name = NULL, .offset = 0} diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index f21897b..ab81733 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c @@ -52,11 +52,6 @@ #define PARAMETER_SAVE_AREA_OFFSET 48 /* bytes */ #endif -struct pt_regs_offset { - const char *name; - int offset; -}; - #define STR(s) #s /* convert to string */ #define REG_OFFSET_NAME(r) {.name = #r, .offset = offsetof(struct pt_regs, r)} #define GPR_OFFSET_NAME(num) \ diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h index 2506c7d..677c72b 100644 --- a/arch/sh/include/asm/ptrace.h +++ b/arch/sh/include/asm/ptrace.h @@ -23,11 +23,6 @@ /* * kprobe-based event tracer support */ -struct pt_regs_offset { - const char *name; - int offset; -}; - #define REG_OFFSET_NAME(r) {.name = #r, .offset = offsetof(struct pt_regs, r)} #define REGS_OFFSET_NAME(num) \ {.name = __stringify(r##num), .offset = offsetof(struct pt_regs, regs[num])} diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index a7bc794..f135d35 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c @@ -53,11 +53,6 @@ enum x86_regset { REGSET_IOPERM32, }; -struct pt_regs_offset { - const char *name; - int offset; -}; - #define REG_OFFSET_NAME(r) {.name = #r, .offset = offsetof(struct pt_regs, r)} #define REG_OFFSET_END {.name = NULL, .offset = 0} diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 987a73a..b0b1ee6 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -383,4 +383,13 @@ extern int task_current_syscall(struct task_struct *target, long *callno, unsigned long args[6], unsigned int maxargs, unsigned long *sp, unsigned long *pc); +#ifdef CONFIG_HAVE_REGS_AND_STACK_ACCESS_API + +struct pt_regs_offset { + const char *name; + int offset; +}; + +#endif /* CONFIG_HAVE_REGS_AND_STACK_ACCESS_API */ + #endif