From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8123 invoked by alias); 22 Feb 2015 20:54:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 8011 invoked by uid 89); 22 Feb 2015 20:54:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 22 Feb 2015 20:54:56 +0000 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id A57EE340BD2; Sun, 22 Feb 2015 20:54:53 +0000 (UTC) Date: Sun, 22 Feb 2015 20:54:00 -0000 From: Mike Frysinger To: Jiri Gaisler Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 12/22] sim/erc32: Use memory_iread() function for instruction fetching. Message-ID: <20150222205453.GC31422@vapier> Mail-Followup-To: Jiri Gaisler , gdb-patches@sourceware.org References: <1424385100-15397-1-git-send-email-jiri@gaisler.se> <1424385100-15397-13-git-send-email-jiri@gaisler.se> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uh9ZiVrAOUUm9fzH" Content-Disposition: inline In-Reply-To: <1424385100-15397-13-git-send-email-jiri@gaisler.se> X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00634.txt.bz2 --uh9ZiVrAOUUm9fzH Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 979 On 19 Feb 2015 23:31, Jiri Gaisler wrote: > --- a/sim/erc32/erc32.c > +++ b/sim/erc32/erc32.c >=20=20 > int > +memory_iread(addr, data, ws) > + uint32 addr; > + uint32 *data; > + int32 *ws; use the proper new function prototype style > + if ((addr >=3D mem_ramstart) && (addr < (mem_ramstart + mem_ramsz)))= { > + *data =3D *((uint32 *) & (ramb[addr & mem_rammask & ~3])); > + *ws =3D mem_ramr_ws; > + return (0); > + } else if (addr < mem_romsz) { > + *data =3D *((uint32 *) & (romb[addr & ~3])); > + *ws =3D mem_romr_ws; > + return (0); > + } pretty sure you should use memcpy here instead of casts drop the paren around the return value > + printf("Memory exception at %x (illegal address)\n", addr); space before the ( > + if (sregs.psr & 0x080) asi =3D 9; else asi =3D 8; uncuddle this statement > + set_sfsr(UIMP_ACC, addr, asi, 1); space before the ( > + return (1); drop the paren -mike --uh9ZiVrAOUUm9fzH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJU6kIdAAoJEEFjO5/oN/WBOLYQAOH+RFu3JFSMTtL6/FciPZlM +beGI8ATXVxKL1R432PrPKZgMa4a2HuTiUq+6hP+Vo6UCb9OtptekZy/7yoiyhne KBF/8L9oo43k7LpPsXQCH607e/tzkl6ttvyq9bZoJJ+0foR9k5bY+B1a7Uq47dbd hYt4jZ9u7BLk9gNJMdCrSVM7JdueNhMlQn8/UeSxWzH3MYaNBHF/RNAm/JY2seok 3ShwmA7bEvI+29UNDPTy1ZWeOStNMCBFqynFq8U+ONcySrRQPp9kFkM25XOHNIib idWoELMnMr35SsT/NMs1NF99t6k6qIzGBHv7m374UHQZU1WTEpkhvp2IAyHGVnuj j5S7aCo65hplmL/bDigACHDP0plkCdSW/btNi0HVGL0LpA+lCopqJL5qhcMJcrjQ 7xQpOT3IdocFjttReYBORPcvN/Mik1i+e5e7HaLOwDHunbagjsuwp5+LoHUNVGs/ HFLeUOJ0pxd3l0qab8otgeLj5KTh4XGuaX1cMGVDoV0qsygff6ow8yu7niAem+zn khcle+i4soiv4zebwyQAH824vf2GUfih8umTNhAJli6NE2HOeM7JC5eoLuSDCJ3K q63OoduiyxxwMQUJD6H9UmIFY6fl0Ya1w4bjxZSbWLJnCsvM+1+ixkPgCRtUd2It 21GWeiaKx15HYpr/36FT =c11Y -----END PGP SIGNATURE----- --uh9ZiVrAOUUm9fzH--