From patchwork Thu May 15 15:49:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 944 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 7274B36006F for ; Thu, 15 May 2014 08:50:41 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14314964) id 2DE63592C2A0; Thu, 15 May 2014 08:50:41 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id DB2085907C04 for ; Thu, 15 May 2014 08:50:40 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=efDQUU5JsoiK/F8YNYKmZTQcKQcaBbn 1v/036jx1TCBoWVgOc3DwlCfRgq/NM0t5TFU45Fs74JGQWc0l5JM5SZtzmJmD6Ci IfOw4e34RxDJ295hklsy4gHtW078UcyyuZJqZr1V8cJbcH7QOhWZUF/X1t6iFJBd zp0UaETotP1A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=rvy5E7jPdqn7iLKX0oJApB6Anls=; b=PNb4P jYbEuLLzRIOp0xcInJ3gPo1BEtZlUwW10ihrAwDp6f4LBrkHr5PXdSIME+sNwGRL 0wmW8BhdG64ZNcOmbnbbFTFvoJXDPWk4pfKvBn8fMxY8NY2oUgkwHs381nnwfKTx ibyQ5optNewWaB+6sHAuZeGsmCA2kOuO2DdIqc= Received: (qmail 31565 invoked by alias); 15 May 2014 15:49:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 31398 invoked by uid 89); 15 May 2014 15:49:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp12.uk.ibm.com Received: from e06smtp12.uk.ibm.com (HELO e06smtp12.uk.ibm.com) (195.75.94.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 15 May 2014 15:49:44 +0000 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 May 2014 16:49:40 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 May 2014 16:49:38 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id B7AC417D8063 for ; Thu, 15 May 2014 16:50:46 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4FFnb3G1245492 for ; Thu, 15 May 2014 15:49:37 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4FFnba6017532 for ; Thu, 15 May 2014 09:49:37 -0600 Received: from br87z6lw.boeblingen.de.ibm.com (dyn-9-152-212-188.boeblingen.de.ibm.com [9.152.212.188]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s4FFnZVX017450 for ; Thu, 15 May 2014 09:49:37 -0600 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH 10/11] SPARC: Replace regset_alloc() invocations by static regset structures. Date: Thu, 15 May 2014 17:49:34 +0200 Message-Id: <1400168975-3145-11-git-send-email-arnez@linux.vnet.ibm.com> In-Reply-To: <1400168975-3145-1-git-send-email-arnez@linux.vnet.ibm.com> References: <1400168975-3145-1-git-send-email-arnez@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14051515-8372-0000-0000-000009B2BE81 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in gdb/ * sparc-linux-tdep.c (sparc32_linux_gregset) (sparc32_linux_fpregset): New static regset structures. (sparc32_linux_init_abi): Drop dynamic regset allocations. * sparc-tdep.h (struct gdbarch_tdep): Constify 'gregset' and 'fpregset' fields. * sparc64-linux-tdep.c: (sparc64_linux_gregset) (sparc64_linux_fpregset): New static regset structures. (sparc64_linux_init_abi): Drop dynamic regset allocations. * sparc64fbsd-tdep.c (sparc64fbsd_gregset, sparc64fbsd_fpregset): New static regset structures. (sparc64fbsd_init_abi): Drop dynamic regset allocations. * sparc64nbsd-tdep.c (sparc64nbsd_gregset, sparc64nbsd_fpregset): New static regset structures. (sparc64nbsd_init_abi): Drop dynamic regset allocations. * sparc64obsd-tdep.c (sparc64obsd_gregset, sparc64obsd_fpregset): New static regset structures. (sparc64obsd_init_abi): Drop dynamic regset allocations. * sparcnbsd-tdep.c (sparc32nbsd_gregset, sparc32nbsd_fpregset): New static regset structures. (sparc32nbsd_init_abi): Drop dynamic regset allocations. --- gdb/sparc-linux-tdep.c | 20 ++++++++++++++++---- gdb/sparc-tdep.h | 4 ++-- gdb/sparc64-linux-tdep.c | 20 ++++++++++++++++---- gdb/sparc64fbsd-tdep.c | 16 ++++++++++++---- gdb/sparc64nbsd-tdep.c | 14 ++++++++++++-- gdb/sparc64obsd-tdep.c | 15 ++++++++++++--- gdb/sparcnbsd-tdep.c | 14 ++++++++++++-- 7 files changed, 82 insertions(+), 21 deletions(-) diff --git a/gdb/sparc-linux-tdep.c b/gdb/sparc-linux-tdep.c index 4a193e2..fd1fc3d 100644 --- a/gdb/sparc-linux-tdep.c +++ b/gdb/sparc-linux-tdep.c @@ -403,6 +403,20 @@ sparc32_linux_gdb_signal_to_target (struct gdbarch *gdbarch, +static const struct regset sparc32_linux_gregset = + { + NULL, + sparc32_linux_supply_core_gregset, + sparc32_linux_collect_core_gregset + }; + +static const struct regset sparc32_linux_fpregset = + { + NULL, + sparc32_linux_supply_core_fpregset, + sparc32_linux_collect_core_fpregset + }; + static void sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -410,12 +424,10 @@ sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) linux_init_abi (info, gdbarch); - tdep->gregset = regset_alloc (gdbarch, sparc32_linux_supply_core_gregset, - sparc32_linux_collect_core_gregset); + tdep->gregset = &sparc32_linux_gregset; tdep->sizeof_gregset = 152; - tdep->fpregset = regset_alloc (gdbarch, sparc32_linux_supply_core_fpregset, - sparc32_linux_collect_core_fpregset); + tdep->fpregset = &sparc32_linux_fpregset; tdep->sizeof_fpregset = 396; tramp_frame_prepend_unwinder (gdbarch, &sparc32_linux_sigframe); diff --git a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h index 12c8ef7..13f0bb2 100644 --- a/gdb/sparc-tdep.h +++ b/gdb/sparc-tdep.h @@ -58,9 +58,9 @@ struct gdbarch_tdep int npc_regnum; /* Register sets. */ - struct regset *gregset; + const struct regset *gregset; size_t sizeof_gregset; - struct regset *fpregset; + const struct regset *fpregset; size_t sizeof_fpregset; /* Offset of saved PC in jmp_buf. */ diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c index 6040526..e843eb3 100644 --- a/gdb/sparc64-linux-tdep.c +++ b/gdb/sparc64-linux-tdep.c @@ -280,6 +280,20 @@ sparc64_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) +static const struct regset sparc64_linux_gregset = + { + NULL, + sparc64_linux_supply_core_gregset, + sparc64_linux_collect_core_gregset + }; + +static const struct regset sparc64_linux_fpregset = + { + NULL, + sparc64_linux_supply_core_fpregset, + sparc64_linux_collect_core_fpregset + }; + static void sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -287,12 +301,10 @@ sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) linux_init_abi (info, gdbarch); - tdep->gregset = regset_alloc (gdbarch, sparc64_linux_supply_core_gregset, - sparc64_linux_collect_core_gregset); + tdep->gregset = &sparc64_linux_gregset; tdep->sizeof_gregset = 288; - tdep->fpregset = regset_alloc (gdbarch, sparc64_linux_supply_core_fpregset, - sparc64_linux_collect_core_fpregset); + tdep->fpregset = &sparc64_linux_fpregset; tdep->sizeof_fpregset = 280; tramp_frame_prepend_unwinder (gdbarch, &sparc64_linux_rt_sigframe); diff --git a/gdb/sparc64fbsd-tdep.c b/gdb/sparc64fbsd-tdep.c index 6ca87dc..fde7815 100644 --- a/gdb/sparc64fbsd-tdep.c +++ b/gdb/sparc64fbsd-tdep.c @@ -209,17 +209,25 @@ static const struct frame_unwind sparc64fbsd_sigtramp_frame_unwind = }; +static const struct regset sparc64fbsd_gregset = + { + NULL, sparc64fbsd_supply_gregset, sparc64fbsd_collect_gregset + }; + +static const struct regset sparc64fbsd_fpregset = + { + NULL, sparc64fbsd_supply_fpregset, sparc64fbsd_collect_fpregset + }; + static void sparc64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - tdep->gregset = regset_alloc (gdbarch, sparc64fbsd_supply_gregset, - sparc64fbsd_collect_gregset); + tdep->gregset = &sparc64fbsd_gregset; tdep->sizeof_gregset = 256; - tdep->fpregset = regset_alloc (gdbarch, sparc64fbsd_supply_fpregset, - sparc64fbsd_collect_fpregset); + tdep->fpregset = &sparc64fbsd_fpregset; tdep->sizeof_fpregset = 272; frame_unwind_append_unwinder (gdbarch, &sparc64fbsd_sigtramp_frame_unwind); diff --git a/gdb/sparc64nbsd-tdep.c b/gdb/sparc64nbsd-tdep.c index fac4c27..b67c762 100644 --- a/gdb/sparc64nbsd-tdep.c +++ b/gdb/sparc64nbsd-tdep.c @@ -237,15 +237,25 @@ static const struct frame_unwind sparc64nbsd_sigcontext_frame_unwind = }; +static const struct regset sparc64nbsd_gregset = + { + NULL, sparc64nbsd_supply_gregset, NULL + }; + +static const struct regset sparc64nbsd_fpregset = + { + NULL, sparc64nbsd_supply_fpregset, NULL + }; + static void sparc64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - tdep->gregset = regset_alloc (gdbarch, sparc64nbsd_supply_gregset, NULL); + tdep->gregset = &sparc64nbsd_gregset; tdep->sizeof_gregset = 160; - tdep->fpregset = regset_alloc (gdbarch, sparc64nbsd_supply_fpregset, NULL); + tdep->fpregset = &sparc64nbsd_fpregset; tdep->sizeof_fpregset = 272; /* Make sure we can single-step "new" syscalls. */ diff --git a/gdb/sparc64obsd-tdep.c b/gdb/sparc64obsd-tdep.c index 8f94574..8cc04f7 100644 --- a/gdb/sparc64obsd-tdep.c +++ b/gdb/sparc64obsd-tdep.c @@ -403,15 +403,24 @@ sparc64obsd_collect_uthread(const struct regcache *regcache, } +static const struct regset sparc64obsd_gregset = + { + NULL, sparc64obsd_supply_gregset, NULL + }; + +static const struct regset sparc64obsd_fpregset = + { + NULL, sparc64obsd_supply_fpregset, NULL + }; + static void sparc64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - tdep->gregset = regset_alloc (gdbarch, sparc64obsd_supply_gregset, NULL); + tdep->gregset = &sparc64obsd_gregset; tdep->sizeof_gregset = 288; - - tdep->fpregset = regset_alloc (gdbarch, sparc64obsd_supply_fpregset, NULL); + tdep->fpregset = &sparc64obsd_fpregset; tdep->sizeof_fpregset = 272; /* Make sure we can single-step "new" syscalls. */ diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c index ac94f10..b267842 100644 --- a/gdb/sparcnbsd-tdep.c +++ b/gdb/sparcnbsd-tdep.c @@ -283,6 +283,16 @@ sparcnbsd_step_trap (struct frame_info *frame, unsigned long insn) } +static const struct regset sparc32nbsd_gregset = + { + NULL, sparc32nbsd_supply_gregset, NULL + }; + +static const struct regset sparc32nbsd_fpregset = + { + NULL, sparc32nbsd_supply_fpregset, NULL + }; + static void sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -292,10 +302,10 @@ sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double); - tdep->gregset = regset_alloc (gdbarch, sparc32nbsd_supply_gregset, NULL); + tdep->gregset = &sparc32nbsd_gregset; tdep->sizeof_gregset = 20 * 4; - tdep->fpregset = regset_alloc (gdbarch, sparc32nbsd_supply_fpregset, NULL); + tdep->fpregset = &sparc32nbsd_fpregset; tdep->sizeof_fpregset = 33 * 4; /* Make sure we can single-step "new" syscalls. */