From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16277 invoked by alias); 18 Dec 2014 17:28:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 16268 invoked by uid 89); 18 Dec 2014 17:28:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 18 Dec 2014 17:28:55 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBIHSqna029814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 18 Dec 2014 12:28:52 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBIHSoPZ018992; Thu, 18 Dec 2014 12:28:51 -0500 Message-ID: <54930ED2.1080806@redhat.com> Date: Thu, 18 Dec 2014 17:28:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] MIPS: Handle the DSP registers for bare metal References: <1418909149-29929-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1418909149-29929-1-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-12/txt/msg00536.txt.bz2 On 12/18/2014 01:25 PM, Yao Qi wrote: > > gdb: > > 2014-12-18 Maciej W. Rozycki > Chris Dearman > > * mips-tdep.c (NUM_MIPS_PROCESSOR_REGS): Set from > MIPS_LAST_EMBED_REGNUM. > (mips_gdbarch_init): Add embedded DSP support. > * mips-tdep.h (MIPS_EMBED_CP2_REGNUM): Offset to CP2 registers. > (MIPS_EMBED_DSPACC_REGNUM): Offset to DSP accumulator registers. > (MIPS_EMBED_DSPCTL_REGNUM): Offset to DSP control registers. > (MIPS_LAST_EMBED_REGNUM): Update accordingly. > (MIPS_EMBED_NUM_REGS): New value to make sure that an even > number of registers is used. > --- > gdb/mips-tdep.c | 15 ++++++++++----- > gdb/mips-tdep.h | 23 ++++++++++++++++++++--- > 2 files changed, 30 insertions(+), 8 deletions(-) > > diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c > index 60f43ac..1fdb216 100644 > --- a/gdb/mips-tdep.c > +++ b/gdb/mips-tdep.c > @@ -546,7 +546,7 @@ static struct cmd_list_element *showmipscmdlist = NULL; > are listed in the following tables. */ > > enum > -{ NUM_MIPS_PROCESSOR_REGS = (90 - 32) }; > +{ NUM_MIPS_PROCESSOR_REGS = (MIPS_LAST_EMBED_REGNUM + 1 - 32) }; > > /* Generic MIPS. */ > > @@ -8191,7 +8191,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > struct gdbarch_tdep *tdep; > int elf_flags; > enum mips_abi mips_abi, found_abi, wanted_abi; > - int i, num_regs; > + int i, num_regs, dsp_space; > enum mips_fpu_type fpu_type; > struct tdesc_arch_data *tdesc_data = NULL; > int elf_fpu_type = Val_GNU_MIPS_ABI_FP_ANY; > @@ -8214,6 +8214,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > mips_regnum.fp_implementation_revision = 70; > mips_regnum.dspacc = dspacc = -1; > mips_regnum.dspctl = dspctl = -1; > + dsp_space = 0; > num_regs = 71; > reg_names = mips_irix_reg_names; > } > @@ -8231,6 +8232,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > mips_regnum.dspctl = -1; > dspacc = 72; > dspctl = 78; > + dsp_space = 0; > num_regs = 79; > reg_names = mips_linux_reg_names; > } > @@ -8244,8 +8246,9 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > mips_regnum.fp0 = MIPS_EMBED_FP0_REGNUM; > mips_regnum.fp_control_status = 70; > mips_regnum.fp_implementation_revision = 71; > - mips_regnum.dspacc = dspacc = -1; > - mips_regnum.dspctl = dspctl = -1; > + mips_regnum.dspacc = dspacc = MIPS_EMBED_DSPACC_REGNUM; > + mips_regnum.dspctl = dspctl = MIPS_EMBED_DSPCTL_REGNUM; > + dsp_space = 1; > num_regs = MIPS_LAST_EMBED_REGNUM + 1; > if (info.bfd_arch_info != NULL > && info.bfd_arch_info->mach == bfd_mach_mips3900) > @@ -8357,16 +8360,18 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > /* The DSP registers are optional; it's OK if they are absent. */ > if (feature != NULL) > { > - i = 0; > + i = dsp_space; > valid_p = 1; > valid_p &= tdesc_numbered_register (feature, tdesc_data, > dspacc + i++, "hi1"); > valid_p &= tdesc_numbered_register (feature, tdesc_data, > dspacc + i++, "lo1"); > + i += dsp_space; > valid_p &= tdesc_numbered_register (feature, tdesc_data, > dspacc + i++, "hi2"); > valid_p &= tdesc_numbered_register (feature, tdesc_data, > dspacc + i++, "lo2"); > + i += dsp_space; > valid_p &= tdesc_numbered_register (feature, tdesc_data, > dspacc + i++, "hi3"); > valid_p &= tdesc_numbered_register (feature, tdesc_data, Took me a bit to grok this, but this is adding slack for ACXn, right? But it seems like nothing in GDB knows about those ACX registers. I guess I'm being dense, but why is this patch needed then? They should still be accessible to the user even without this change, right? Assuming the description is including them. Thanks, Pedro Alves