public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vapier at gentoo dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug sim/25211] sim: m68hc11: fails to remap registers when writing INIT
Date: Thu, 10 Nov 2022 15:05:17 +0000	[thread overview]
Message-ID: <bug-25211-4717-tts5OIYzqH@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25211-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=25211

--- Comment #6 from Mike Frysinger <vapier at gentoo dot org> ---
hmm, i poked it more today, and now i wonder if this is a bug in dv-core. 
looking through the codebase, m68hc11 seems to have the only device models that
ever actually call hw_detach_address which might be why no one noticed before.

practically speaking, it does the samething as your proposed patch because the
dv-m68hc11 detach method calls sim_core_detach.  but i think the right fix is
to change dv-core so it has mirror attach/detach logic.

i'll probably send this out after GDB 13 branches.

--- a/sim/common/dv-core.c       
+++ b/sim/common/dv-core.c
@@ -72,6 +72,23 @@ dv_core_attach_address_callback (struct hw *me,
 }


+static void
+dv_core_detach_address_callback (struct hw *me,
+                int level,
+                int space,
+                address_word addr,
+                address_word nr_bytes,
+                struct hw *client)
+{
+  HW_TRACE ((me, "detach - level=%d, space=%d, addr=0x%lx, nr_bytes=%ld,
client=%s",
+        level, space, (unsigned long) addr, (unsigned long) nr_bytes, hw_path
(client)));
+  /* NOTE: At preset the space is assumed to be zero.  Perhaphs the
+     space should be mapped onto something for instance: space0 -
+     unified memory; space1 - IO memory; ... */
+  sim_core_detach (hw_system (me), NULL, /*cpu*/ level, space, addr);
+}                                       
+
+
 static unsigned
 dv_core_dma_read_buffer_callback (struct hw *me,
                  void *dest,    
@@ -109,6 +126,7 @@ static void   
 dv_core_finish (struct hw *me)  
 {                               
   set_hw_attach_address (me, dv_core_attach_address_callback);
+  set_hw_detach_address (me, dv_core_detach_address_callback);
   set_hw_dma_write_buffer (me, dv_core_dma_write_buffer_callback);
   set_hw_dma_read_buffer (me, dv_core_dma_read_buffer_callback);
 }

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-11-10 15:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-25211-4717@http.sourceware.org/bugzilla/>
2021-01-11  6:54 ` [Bug sim/25211] m68hc11 sim " vapier at gentoo dot org
2021-01-12  8:32 ` f4grx+bzsw at f4grx dot net
2021-10-31 17:27 ` [Bug sim/25211] sim: m68hc11: " vapier at gentoo dot org
2022-11-08  8:50 ` vapier at gentoo dot org
2022-11-09 14:50 ` vapier at gentoo dot org
2022-11-09 15:17 ` f4grx+bzsw at f4grx dot net
2022-11-10 15:05 ` vapier at gentoo dot org [this message]
2022-12-20  1:32 ` vapier at gentoo dot org
2023-01-12 15:41 ` f4grx+bzsw at f4grx dot net

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=bug-25211-4717-tts5OIYzqH@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).