Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jonathan Larmour <jifl@eCosCentric.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: gdb-patches@sourceware.org, Ilija Kocho <ilijak@siva.com.mk>,
	 Terry Guo <terry.guo@arm.com>, Pedro Alves <palves@redhat.com>
Subject: Re: [patch] Add support for VFP d16 layout  for Cortex-M4
Date: Thu, 26 Apr 2012 15:07:00 -0000	[thread overview]
Message-ID: <4F9963E3.4060107@eCosCentric.com> (raw)
In-Reply-To: <m3d36vpb9i.fsf@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]

On 26/04/12 01:50, Sergio Durigan Junior wrote:
> 
> I have recently (a.k.a. today) modified the code that generates these
> `features' .c files.  Could you please regenerate it when/if you repost
> the patch?

No problem. Here is the updated patch. Pedro, let me know if it's ok to
commit or not, thanks.

Jifl

2012-04-26  Jonathan Larmour  <jifl@eCosCentric.com>

	* arm-tdep.h (VFP_REGISTER_SIZE): Define.
	* features/arm-with-m-vfp-d16.xml: New file. Describes
	Cortex-M with VFPv4-sp-d16 FPU register layout.
	* features/Makefile (WHICH): Add arm-with-m-vfp-d16.
	* features/arm-with-m-vfp-d16.c: New. Generated from above.
	* arm-tdep.c: Include arm-with-m-vfp-d16.c.
	(arm-register_g_packet_guesses): Add vfp-d16 guess.
	(_initialise_arm_tdep): Initialize arm-with-m-vfp-d16 tdesc.


-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine

[-- Attachment #2: vfpd16a.patch --]
[-- Type: text/plain, Size: 7346 bytes --]

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.361
diff -u -5 -p -r1.361 arm-tdep.c
--- arm-tdep.c	20 Apr 2012 23:39:57 -0000	1.361
+++ arm-tdep.c	26 Apr 2012 14:55:38 -0000
@@ -57,10 +57,11 @@
 
 #include "record.h"
 
 #include "features/arm-with-m.c"
 #include "features/arm-with-m-fpa-layout.c"
+#include "features/arm-with-m-vfp-d16.c"
 #include "features/arm-with-iwmmxt.c"
 #include "features/arm-with-vfpv2.c"
 #include "features/arm-with-vfpv3.c"
 #include "features/arm-with-neon.c"
 
@@ -9696,10 +9697,18 @@ arm_register_g_packet_guesses (struct gd
       register_remote_g_packet_guess (gdbarch,
 				      /* r0-r12,sp,lr,pc; xpsr */
 				      (16 * INT_REGISTER_SIZE)
 				      + INT_REGISTER_SIZE,
 				      tdesc_arm_with_m);
+
+      /* M-profile plus M4F VFP.  */
+      register_remote_g_packet_guess (gdbarch,
+				      /* r0-r12,sp,lr,pc; d0-d15; fpscr,xpsr */
+				      (16 * INT_REGISTER_SIZE)
+				      + (16 * VFP_REGISTER_SIZE)
+				      + (2 * INT_REGISTER_SIZE),
+				      tdesc_arm_with_m_vfp_d16);
     }
 
   /* Otherwise we don't have a useful guess.  */
 }
 
@@ -10331,10 +10340,11 @@ _initialize_arm_tdep (void)
 				  arm_elf_osabi_sniffer);
 
   /* Initialize the standard target descriptions.  */
   initialize_tdesc_arm_with_m ();
   initialize_tdesc_arm_with_m_fpa_layout ();
+  initialize_tdesc_arm_with_m_vfp_d16 ();
   initialize_tdesc_arm_with_iwmmxt ();
   initialize_tdesc_arm_with_vfpv2 ();
   initialize_tdesc_arm_with_vfpv3 ();
   initialize_tdesc_arm_with_neon ();
 
Index: arm-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.h,v
retrieving revision 1.56
diff -u -5 -p -r1.56 arm-tdep.h
--- arm-tdep.h	27 Mar 2012 15:46:33 -0000	1.56
+++ arm-tdep.h	26 Apr 2012 14:55:38 -0000
@@ -69,10 +69,14 @@ enum gdb_regnum {
 /* Say how long FP registers are.  Used for documentation purposes and
    code readability in this header.  IEEE extended doubles are 80
    bits.  DWORD aligned they use 96 bits.  */
 #define FP_REGISTER_SIZE	12
 
+/* Say how long VFP double precision registers are.  Used for documentation
+   purposes and code readability.  These are fixed at 64 bits.  */
+#define VFP_REGISTER_SIZE	8
+
 /* Number of machine registers.  The only define actually required 
    is gdbarch_num_regs.  The other definitions are used for documentation
    purposes and code readability.  */
 /* For 26 bit ARM code, a fake copy of the PC is placed in register 25 (PS)
    (and called PS for processor status) so the status bits can be cleared
Index: features/Makefile
===================================================================
RCS file: /cvs/src/src/gdb/features/Makefile,v
retrieving revision 1.27
diff -u -5 -p -r1.27 Makefile
--- features/Makefile	20 Apr 2012 23:39:58 -0000	1.27
+++ features/Makefile	26 Apr 2012 14:55:38 -0000
@@ -29,11 +29,11 @@
 # configured for the correct architecture, so the files are again kept
 # in the GDB repository.  To generate C files:
 #   make GDB=/path/to/gdb XMLTOC="xml files" cfiles
 
 WHICH = arm-with-iwmmxt arm-with-vfpv2 arm-with-vfpv3 arm-with-neon \
-	arm-with-m arm-with-m-fpa-layout \
+	arm-with-m arm-with-m-fpa-layout arm-with-m-vfp-d16 \
 	i386/i386 i386/i386-linux \
 	i386/i386-mmx i386/i386-mmx-linux \
 	i386/amd64 i386/amd64-linux \
 	i386/i386-avx i386/i386-avx-linux \
 	i386/amd64-avx i386/amd64-avx-linux \
Index: features/arm-with-m-vfp-d16.c
===================================================================
RCS file: features/arm-with-m-vfp-d16.c
diff -N features/arm-with-m-vfp-d16.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ features/arm-with-m-vfp-d16.c	26 Apr 2012 14:55:38 -0000
@@ -0,0 +1,53 @@
+/* THIS FILE IS GENERATED.  Original: arm-with-m-vfp-d16.xml */
+
+#include "defs.h"
+#include "osabi.h"
+#include "target-descriptions.h"
+
+struct target_desc *tdesc_arm_with_m_vfp_d16;
+static void
+initialize_tdesc_arm_with_m_vfp_d16 (void)
+{
+  struct target_desc *result = allocate_target_description ();
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
+  tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "sp", 13, 1, NULL, 32, "data_ptr");
+  tdesc_create_reg (feature, "lr", 14, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "pc", 15, 1, NULL, 32, "code_ptr");
+  tdesc_create_reg (feature, "xpsr", 25, 1, NULL, 32, "int");
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.vfp");
+  tdesc_create_reg (feature, "d0", 26, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d1", 27, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d2", 28, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d3", 29, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d4", 30, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d5", 31, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d6", 32, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d7", 33, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d8", 34, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d9", 35, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d10", 36, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d11", 37, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d12", 38, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d13", 39, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d14", 40, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d15", 41, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "fpscr", 42, 1, "float", 32, "int");
+
+  tdesc_arm_with_m_vfp_d16 = result;
+}
Index: features/arm-with-m-vfp-d16.xml
===================================================================
RCS file: features/arm-with-m-vfp-d16.xml
diff -N features/arm-with-m-vfp-d16.xml
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ features/arm-with-m-vfp-d16.xml	26 Apr 2012 14:55:38 -0000
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010-2012 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+  <xi:include href="arm-m-profile.xml"/>
+  <!-- Layout of vfpv4-sp-d16 is identical to vfpv2 -->
+  <xi:include href="arm-vfpv2.xml"/>
+</target>

  reply	other threads:[~2012-04-26 15:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-19 15:13 Jonathan Larmour
2012-04-19 15:58 ` Terry Guo
2012-04-19 16:09   ` Jonathan Larmour
2012-04-19 16:38     ` Terry Guo
2012-04-19 17:30       ` Jonathan Larmour
2012-04-20  7:51     ` Ilija Kocho
2012-04-20  8:31       ` Terry Guo
2012-04-20  8:54         ` Ilija Kocho
2012-04-20 11:44 ` Pedro Alves
2012-04-20 12:43 ` Pedro Alves
2012-04-20 13:20   ` Terry Guo
2012-04-20 13:22     ` Pedro Alves
2012-04-24  2:49   ` Jonathan Larmour
2012-04-26 20:28     ` Tom Tromey
2012-04-26 23:40       ` Jonathan Larmour
2012-04-27 15:55         ` Tom Tromey
2012-04-26  7:35 ` Sergio Durigan Junior
2012-04-26 15:07   ` Jonathan Larmour [this message]
2012-04-26 15:20     ` Pedro Alves
2012-04-26 15:29       ` Jonathan Larmour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F9963E3.4060107@eCosCentric.com \
    --to=jifl@ecoscentric.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ilijak@siva.com.mk \
    --cc=palves@redhat.com \
    --cc=sergiodj@redhat.com \
    --cc=terry.guo@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox