From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: Brian Cain <brian.cain@oss.qualcomm.com>, qemu-devel@nongnu.org
Cc: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Subject: Re: [PATCH 2/2] target/hexagon: gdbstub - Add sys reg support
Date: Fri, 2 Oct 2026 06:45:21 +0200 [thread overview]
Message-ID: <623a0707-e074-42e2-a40a-bbbb01c618a2@oss.qualcomm.com> (raw)
In-Reply-To: <20260930175108.3592113-3-brian.cain@oss.qualcomm.com>
On 30/9/26 19:51, Brian Cain wrote:
> Add support for the system and guest registers to the gdbstub.
>
> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> ---
> target/hexagon/cpu.h | 1 +
> target/hexagon/internal.h | 4 +++
> target/hexagon/cpu.c | 14 ++++++++
> target/hexagon/gdbstub.c | 68 +++++++++++++++++++++++++++++++++++++++
> 4 files changed, 87 insertions(+)
> +void hexagon_greg_write(CPUHexagonState *env, uint32_t reg, uint32_t val)
> +{
> + if (reg <= HEX_GREG_G3) {
> + env->greg[reg] = val;
> + return;
> + }
> + qemu_log_mask(LOG_UNIMP, "writing greg %" PRIu32
> + " not yet supported.\n", reg);
Not sure void/LOG_UNIMP is safe, LOG_UNIMP is only enabled with
'-d unimp' and goes on stderr, ...
(nit misaligned style)
> +}
> +int hexagon_sys_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
> +{
> + CPUHexagonState *env = cpu_env(cs);
> + HexagonCPU *cpu = env_archcpu(env);
> + BQL_LOCK_GUARD();
> +
> + if (n < NUM_SREGS) {
> + uint32_t val = ldl_le_p(mem_buf);
> + if (n == HEX_SREG_SSR) {
> + uint32_t old = env->t_sreg[HEX_SREG_SSR];
> + env->t_sreg[HEX_SREG_SSR] = val;
> + hexagon_modify_ssr(env, val, old);
> + } else if (n < HEX_SREG_GLB_START) {
> + env->t_sreg[n] = val;
> + } else if (cpu->globalregs) {
> + hexagon_globalreg_write(cpu->globalregs, n, val, env->threadId);
> + }
> + return sizeof(uint32_t);
> + }
> + n -= NUM_SREGS;
> +
> + if (n < NUM_GREGS) {
> + hexagon_greg_write(env, n, ldl_le_p(mem_buf));
> + return sizeof(uint32_t);
... and here we tell the user the register was correctly written.
> + }
> + n -= NUM_GREGS;
> +
> + g_assert_not_reached();
> +}
next prev parent reply other threads:[~2026-10-02 4:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 17:51 [PATCH 0/2] hexagon: sys+guest regs in gdbstub Brian Cain
2026-09-30 17:51 ` [PATCH 1/2] gdbstub/gdb-xml: Add hexagon sys regs Brian Cain
2026-10-01 20:58 ` Pierrick Bouvier
2026-10-02 1:56 ` Brian Cain
2026-09-30 17:51 ` [PATCH 2/2] target/hexagon: gdbstub - Add sys reg support Brian Cain
2026-10-01 20:59 ` Pierrick Bouvier
2026-10-02 4:45 ` Philippe Mathieu-Daudé [this message]
2026-10-05 16:12 ` Brian Cain
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=623a0707-e074-42e2-a40a-bbbb01c618a2@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=brian.cain@oss.qualcomm.com \
--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.