From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7CE323858D3C; Thu, 10 Nov 2022 15:05:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CE323858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668092719; bh=HkNzWQFGjBZeyzKRE/HYVQbQf9kaDk/EISgCoeiIBRQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nLEHumtpy/MG2qOkLBqr9O6JvGKhI9BKu8L/qsx4BNWJeS5y5dte5bELjItFJGe94 odChv3UiJdsYEh2ZhZjrj6D+pv7kQOcCvYNVVPol/PIBw4pULa2/6QI1jUd+UXgKWC 7fVNzBRMIi4mvmlhUjWg/pybFzdWiy75BBiTcLzs= From: "vapier at gentoo dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: sim X-Bugzilla-Version: 8.3.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vapier at gentoo dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D25211 --- Comment #6 from Mike Frysinger --- hmm, i poked it more today, and now i wonder if this is a bug in dv-core.=20 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 befo= re. 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=20=20=20=20=20=20=20 +++ 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=3D%d, space=3D%d, addr=3D0x%lx, nr_bytes= =3D%ld, client=3D%s", + level, space, (unsigned long) addr, (unsigned long) nr_bytes, hw_p= ath (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); +}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + + static unsigned dv_core_dma_read_buffer_callback (struct hw *me, void *dest,=20=20=20=20 @@ -109,6 +126,7 @@ static void=20=20=20 dv_core_finish (struct hw *me)=20=20 {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 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); } --=20 You are receiving this mail because: You are on the CC list for the bug.=