All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Turner <mattst88@gmail.com>
To: qemu-devel@nongnu.org
Cc: Matt Turner <mattst88@gmail.com>,
	Laurent Vivier <laurent@vivier.eu>, Helge Deller <deller@gmx.de>,
	Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Subject: [PATCH 3/5] linux-user/hppa: write the floating-point registers to a core dump
Date: Wed,  5 Aug 2026 13:15:05 -0400	[thread overview]
Message-ID: <20260805171507.3119442-3-mattst88@gmail.com> (raw)
In-Reply-To: <20260805171507.3119442-1-mattst88@gmail.com>

Write an NT_FPREGSET note for HPPA, matching the kernel's
elf_fpregset_t layout (ELF_NFPREG = 32): fr0-fr31 as 64-bit values.

Signed-off-by: Matt Turner <mattst88@gmail.com>
---
 linux-user/hppa/elfload.c    | 7 +++++++
 linux-user/hppa/target_elf.h | 9 +++++++++
 2 files changed, 16 insertions(+)

diff --git ./linux-user/hppa/elfload.c ./linux-user/hppa/elfload.c
index ff4301b2ed..dd5b0b380e 100644
--- ./linux-user/hppa/elfload.c
+++ ./linux-user/hppa/elfload.c
@@ -17,6 +17,13 @@ const char *get_elf_platform(CPUState *cs)
     return "PARISC";
 }
 
+void elf_core_copy_fpregs(target_elf_fpregset_t *r, const CPUArchState *env)
+{
+    for (int i = 0; i < 32; i++) {
+        r->fpr[i] = tswap64(env->fr[i]);
+    }
+}
+
 void elf_core_copy_regs(target_elf_gregset_t *r, const CPUArchState *env)
 {
     int i;
diff --git ./linux-user/hppa/target_elf.h ./linux-user/hppa/target_elf.h
index 22547b1437..4357873aff 100644
--- ./linux-user/hppa/target_elf.h
+++ ./linux-user/hppa/target_elf.h
@@ -39,4 +39,13 @@ typedef struct target_elf_gregset_t {
 #define STACK_ALIGNMENT         64
 #define VDSO_HEADER             "vdso.c.inc"
 
+#define HAVE_ELF_CORE_FPREGS    1
+
+/*
+ * Matches the kernel's elf_fpregset_t (ELF_NFPREG = 32): fr0-fr31.
+ */
+typedef struct target_elf_fpregset_t {
+    uint64_t fpr[32];
+} target_elf_fpregset_t;
+
 #endif
-- 
2.54.0



  parent reply	other threads:[~2026-08-05 17:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05 17:15 [PATCH 1/5] linux-user/alpha: write the floating-point registers to a core dump Matt Turner
2026-08-05 17:15 ` [PATCH 2/5] linux-user/mips: " Matt Turner
2026-08-05 17:15 ` Matt Turner [this message]
2026-08-05 17:15 ` [PATCH 4/5] linux-user/riscv: " Matt Turner
2026-08-05 17:15 ` [PATCH 5/5] linux-user/sh4: " Matt Turner
2026-08-07 16:12 ` [PATCH 1/5] linux-user/alpha: " Helge Deller

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=20260805171507.3119442-3-mattst88@gmail.com \
    --to=mattst88@gmail.com \
    --cc=deller@gmx.de \
    --cc=laurent@vivier.eu \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.