Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: gdb-patches@sourceware.org
Cc: Chris Packham <judge.packham@gmail.com>,
	Luis <luis.machado.foss@gmail.com>, Tom Tromey <tom@tromey.com>,
	Simon Marchi <simark@simark.ca>
Subject: [PATCH v3 2/4] GDB: Add gdb/arch/aarch64-fpmr-linux.h
Date: Tue, 17 Feb 2026 03:01:00 -0300	[thread overview]
Message-ID: <20260217060106.1906312-3-thiago.bauermann@linaro.org> (raw)
In-Reply-To: <20260217060106.1906312-1-thiago.bauermann@linaro.org>

GDB conditionally defines HWCAP2_FPMR in gdb/arch/aarch64.h, but that's
not the best place for it since it's a Linux-specific definition.

Add a new Linux- and feature-specific header to contain it.

Suggested-by: Luis <luis.machado.foss@gmail.com>
---
 gdb/Makefile.in                |  1 +
 gdb/aarch64-linux-nat.c        |  1 +
 gdb/aarch64-linux-tdep.c       |  1 +
 gdb/arch/aarch64-fpmr-linux.h  | 28 ++++++++++++++++++++++++++++
 gdb/arch/aarch64.h             |  5 -----
 gdbserver/linux-aarch64-low.cc |  1 +
 6 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 gdb/arch/aarch64-fpmr-linux.h

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 8f8a95beccc3..f0f10e3946bf 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1301,6 +1301,7 @@ HFILES_NO_SRCDIR = \
 	amdgpu-tdep.h \
 	annotate.h \
 	arch/aarch32.h \
+	arch/aarch64-fpmr-linux.h \
 	arch/aarch64-gcs-linux.h \
 	arch/aarch64.h \
 	arch/aarch64-insn.h \
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index d310d3e814b2..9f85d96b59ef 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -51,6 +51,7 @@
 #include "gdb_proc_service.h"
 #include "arch-utils.h"
 
+#include "arch/aarch64-fpmr-linux.h"
 #include "arch/aarch64-gcs-linux.h"
 #include "arch/aarch64-mte-linux.h"
 #include "arch/aarch64-pauth-linux.h"
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index b5af281d8a40..c17ccbc66220 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -51,6 +51,7 @@
 #include "record-full.h"
 #include "linux-record.h"
 
+#include "arch/aarch64-fpmr-linux.h"
 #include "arch/aarch64-gcs-linux.h"
 #include "arch/aarch64-mte.h"
 #include "arch/aarch64-mte-linux.h"
diff --git a/gdb/arch/aarch64-fpmr-linux.h b/gdb/arch/aarch64-fpmr-linux.h
new file mode 100644
index 000000000000..d3040fa263e4
--- /dev/null
+++ b/gdb/arch/aarch64-fpmr-linux.h
@@ -0,0 +1,28 @@
+/* Common Linux target-dependent definitions for AArch64 FPMR.
+
+   Copyright (C) 2025-2026 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef GDB_ARCH_AARCH64_FPMR_LINUX_H
+#define GDB_ARCH_AARCH64_FPMR_LINUX_H
+
+/* Feature check for Floating Point Mode Register.  */
+#ifndef HWCAP2_FPMR
+#define HWCAP2_FPMR (1ULL << 48)
+#endif /* HWCAP2_FPMR */
+
+#endif /* GDB_ARCH_AARCH64_FPMR_LINUX_H */
diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h
index 7856d95a93b1..c9a89ac40986 100644
--- a/gdb/arch/aarch64.h
+++ b/gdb/arch/aarch64.h
@@ -243,9 +243,4 @@ enum aarch64_regnum
 /* Size of the SME2 ZT0 register in bytes.  */
 #define AARCH64_SME2_ZT0_SIZE 64
 
-/* Feature check for Floating Point Mode Register.  */
-#ifndef HWCAP2_FPMR
-#define HWCAP2_FPMR (1ULL << 48)
-#endif /* HWCAP2_FPMR */
-
 #endif /* GDB_ARCH_AARCH64_H */
diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc
index 69aaabc1a8f9..6b61f6d5a815 100644
--- a/gdbserver/linux-aarch64-low.cc
+++ b/gdbserver/linux-aarch64-low.cc
@@ -39,6 +39,7 @@
 
 #include "gdb_proc_service.h"
 #include "arch/aarch64.h"
+#include "arch/aarch64-fpmr-linux.h"
 #include "arch/aarch64-gcs-linux.h"
 #include "arch/aarch64-mte-linux.h"
 #include "arch/aarch64-scalable-linux.h"

  parent reply	other threads:[~2026-02-17  6:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17  6:00 [PATCH v3 0/4] GDB: aarch64-linux: Some header fixes Thiago Jung Bauermann
2026-02-17  6:00 ` [PATCH v3 1/4] GDB: Add gdb/arch/aarch64-pauth-linux.h Thiago Jung Bauermann
2026-02-21 12:14   ` Luis
2026-02-21 15:57     ` Simon Marchi
2026-02-22 10:06       ` Luis
2026-02-22 14:22         ` Simon Marchi
2026-02-22 15:15           ` Luis
2026-02-22 15:25             ` Simon Marchi
2026-03-03  5:00               ` Thiago Jung Bauermann
2026-02-17  6:01 ` Thiago Jung Bauermann [this message]
2026-02-21 12:15   ` [PATCH v3 2/4] GDB: Add gdb/arch/aarch64-fpmr-linux.h Luis
2026-02-17  6:01 ` [PATCH v3 3/4] GDB: aarch64-linux: Move definition of struct user_gcs Thiago Jung Bauermann
2026-02-21 12:20   ` Luis
2026-02-17  6:01 ` [PATCH v3 4/4] GDB: aarch64-linux: Fix build failure on musl systems Thiago Jung Bauermann
2026-02-21 12:23   ` Luis

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=20260217060106.1906312-3-thiago.bauermann@linaro.org \
    --to=thiago.bauermann@linaro.org \
    --cc=gdb-patches@sourceware.org \
    --cc=judge.packham@gmail.com \
    --cc=luis.machado.foss@gmail.com \
    --cc=simark@simark.ca \
    --cc=tom@tromey.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