Adds support for including loongarch control and status registers into core files.

Message ID 2b6df71e.1e1f.17b1a93d5f4.Coremail.liuzhensong@loongson.cn
State New
Headers show
Series
  • Adds support for including loongarch control and status registers into core files.
Related show

Commit Message

刘振松 Aug. 6, 2021, 8:28 a.m.
The following patch adds support for including loongarch control and status registers into core files.

complete codes in github (https://github.com/loongson/binutils-gdb), we'll push it to master after stable.

include/elf/
        common.h  (NT_LARCH_CPUCFG, NT_LARCH_CSR, NT_LARCH_LSX, NT_LARCH_LASX, NT_LARCH_LBT)

Comments

Alan Modra via Binutils Aug. 6, 2021, 1:40 p.m. | #1
Hello,

On Fri, 6 Aug 2021, 刘振松 wrote:

> The following patch adds support for including loongarch control and 

> status registers into core files.

> 

> complete codes in github (https://github.com/loongson/binutils-gdb), 

> we'll push it to master after stable.


One remark:

>                                         /*   note name must be "CORE".  */


This comment ...

> +#define NT_LARCH_CPUCFG 0xa00          /* Loongarch CPU config registers */

> +                    /*   note name must be "LINUX".  */

> +#define NT_LARCH_CSR    0xa01          /* Loongarch control state registers*/

> +                    /*   note name must be "LINUX".  */

> +#define NT_LARCH_LSX    0xa02       /* Loongarch Loongson SIMD Extension registers */

> +                    /*   note name must be "LINUX".  */

> +#define NT_LARCH_LASX   0xa03       /* Loongarch Loongson Advanced SIMD Extension registers */

> +                    /*   note name must be "LINUX".  */

> +#define NT_LARCH_LBT    0xa04       /* Loongarch Loongson Binary Translation registers */

> +                    /*   note name must be "LINUX".  */

>  #define NT_SIGINFO     0x53494749      /* Fields of siginfo_t.  */


... belonged to this #define, your patch separates them by inserting in 
the middle.

>  #define NT_FILE                0x46494c45      /* Description of mapped files.  */



Ciao,
Michael.
刘振松 Aug. 7, 2021, 2 a.m. | #2
Thanks
Michael

I have updated the patch.

 
> Hello,
> 
> On Fri, 6 Aug 2021, 刘振松 wrote:
> 
> > The following patch adds support for including loongarch control and 
> > status registers into core files.
> > 
> > complete codes in github (https://github.com/loongson/binutils-gdb), 
> > we'll push it to master after stable.
> 
> One remark:
> 
> >                                         /*   note name must be "CORE".  */
> 
> This comment ...
> 
> > +#define NT_LARCH_CPUCFG 0xa00          /* Loongarch CPU config registers */
> > +                    /*   note name must be "LINUX".  */
> > +#define NT_LARCH_CSR    0xa01          /* Loongarch control state registers*/
> > +                    /*   note name must be "LINUX".  */
> > +#define NT_LARCH_LSX    0xa02       /* Loongarch Loongson SIMD Extension registers */
> > +                    /*   note name must be "LINUX".  */
> > +#define NT_LARCH_LASX   0xa03       /* Loongarch Loongson Advanced SIMD Extension registers */
> > +                    /*   note name must be "LINUX".  */
> > +#define NT_LARCH_LBT    0xa04       /* Loongarch Loongson Binary Translation registers */
> > +                    /*   note name must be "LINUX".  */
> >  #define NT_SIGINFO     0x53494749      /* Fields of siginfo_t.  */
> 
> ... belonged to this #define, your patch separates them by inserting in 
> the middle.
> 
> >  #define NT_FILE                0x46494c45      /* Description of mapped files.  */
> 
> 
> Ciao,
> Michael.
diff --git a/include/elf/common.h b/include/elf/common.h
index 0d381f0d27b..df3a660c5ac 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -678,6 +678,16 @@
 #define NT_ARC_V2	0x600		/* ARC HS accumulator/extra registers.  */
 					/*   note name must be "LINUX".  */
 #define NT_RISCV_CSR    0x900		/* RISC-V Control and Status Registers */
+                    /*   note name must be "LINUX".  */
+#define NT_LARCH_CPUCFG 0xa00		/* Loongarch CPU config registers */
+                    /*   note name must be "LINUX".  */
+#define NT_LARCH_CSR    0xa01		/* Loongarch control state registers */
+                    /*   note name must be "LINUX".  */
+#define NT_LARCH_LSX    0xa02       /* Loongarch Loongson SIMD Extension registers */
+                    /*   note name must be "LINUX".  */
+#define NT_LARCH_LASX   0xa03       /* Loongarch Loongson Advanced SIMD Extension registers */
+                    /*   note name must be "LINUX".  */
+#define NT_LARCH_LBT    0xa04       /* Loongarch Loongson Binary Translation registers */
 					/*   note name must be "CORE".  */
 #define NT_SIGINFO	0x53494749	/* Fields of siginfo_t.  */
 #define NT_FILE		0x46494c45	/* Description of mapped files.  */
Alan Modra via Binutils Aug. 20, 2021, 3:51 a.m. | #3
On Sat, Aug 07, 2021 at 10:00:12AM +0800, 刘振松 wrote:
> diff --git a/include/elf/common.h b/include/elf/common.h

> index 0d381f0d27b..df3a660c5ac 100644

> --- a/include/elf/common.h

> +++ b/include/elf/common.h

> @@ -678,6 +678,16 @@

>  #define NT_ARC_V2	0x600		/* ARC HS accumulator/extra registers.  */

>  					/*   note name must be "LINUX".  */

>  #define NT_RISCV_CSR    0x900		/* RISC-V Control and Status Registers */

> +                    /*   note name must be "LINUX".  */

> +#define NT_LARCH_CPUCFG 0xa00		/* Loongarch CPU config registers */

> +                    /*   note name must be "LINUX".  */

> +#define NT_LARCH_CSR    0xa01		/* Loongarch control state registers */

> +                    /*   note name must be "LINUX".  */

> +#define NT_LARCH_LSX    0xa02       /* Loongarch Loongson SIMD Extension registers */

> +                    /*   note name must be "LINUX".  */

> +#define NT_LARCH_LASX   0xa03       /* Loongarch Loongson Advanced SIMD Extension registers */

> +                    /*   note name must be "LINUX".  */

> +#define NT_LARCH_LBT    0xa04       /* Loongarch Loongson Binary Translation registers */

>  					/*   note name must be "CORE".  */

>  #define NT_SIGINFO	0x53494749	/* Fields of siginfo_t.  */

>  #define NT_FILE		0x46494c45	/* Description of mapped files.  */


OK.

-- 
Alan Modra
Australia Development Lab, IBM

Patch

From 5015aa1e0153d051a236066fbe6c0e53a9185f82 Mon Sep 17 00:00:00 2001
From: liuzhensong <liuzhensong@loongson.cn>
Date: Fri, 6 Aug 2021 15:35:24 +0800
Subject: [PATCH] binutils: Adds support for loongarch registers in core files.

Adds support for including loongarch control and status registers into
core files.
  include/elf/common.h
---
 include/elf/common.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/elf/common.h b/include/elf/common.h
index 0d381f0d27b..4fa5aa9f314 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -679,6 +679,16 @@ 
 					/*   note name must be "LINUX".  */
 #define NT_RISCV_CSR    0x900		/* RISC-V Control and Status Registers */
 					/*   note name must be "CORE".  */
+#define NT_LARCH_CPUCFG 0xa00		/* Loongarch CPU config registers */
+                    /*   note name must be "LINUX".  */
+#define NT_LARCH_CSR    0xa01		/* Loongarch control state registers */
+                    /*   note name must be "LINUX".  */
+#define NT_LARCH_LSX    0xa02       /* Loongarch Loongson SIMD Extension registers */
+                    /*   note name must be "LINUX".  */
+#define NT_LARCH_LASX   0xa03       /* Loongarch Loongson Advanced SIMD Extension registers */
+                    /*   note name must be "LINUX".  */
+#define NT_LARCH_LBT    0xa04       /* Loongarch Loongson Binary Translation registers */
+                    /*   note name must be "LINUX".  */
 #define NT_SIGINFO	0x53494749	/* Fields of siginfo_t.  */
 #define NT_FILE		0x46494c45	/* Description of mapped files.  */
 
-- 
2.27.0