From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21807 invoked by alias); 19 Feb 2015 17:48:01 -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 21730 invoked by uid 89); 19 Feb 2015 17:48:01 -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; Thu, 19 Feb 2015 17:48:00 +0000 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id 76F4C3407BC; Thu, 19 Feb 2015 17:47:57 +0000 (UTC) Date: Thu, 19 Feb 2015 17:48:00 -0000 From: Mike Frysinger To: Jiri Gaisler Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 03/23] sim/erc32: Perform pseudo-init of system if binary starts from non-zero address. Message-ID: <20150219174757.GP544@vapier> Mail-Followup-To: Jiri Gaisler , gdb-patches@sourceware.org References: <1424159099-5148-1-git-send-email-jiri@gaisler.se> <1424159099-5148-4-git-send-email-jiri@gaisler.se> <20150217085931.GI20008@vapier> <54E4A45E.9050606@gaisler.se> <20150218165325.GT544@vapier> <54E60B2D.5020905@gaisler.se> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aNVUg3Xo9UgCa1D+" Content-Disposition: inline In-Reply-To: <54E60B2D.5020905@gaisler.se> X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00550.txt.bz2 --aNVUg3Xo9UgCa1D+ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1850 On 19 Feb 2015 17:11, Jiri Gaisler wrote: > On 02/18/2015 05:53 PM, Mike Frysinger wrote: > > On 18 Feb 2015 15:40, Jiri Gaisler wrote: > >> On 02/17/2015 09:59 AM, Mike Frysinger wrote: > >>> On 17 Feb 2015 08:44, Jiri Gaisler wrote: > >>>> +{ > >>>> + mec_write(MEC_WCR, 0); /* zero waitstates */ > >>>> + mec_write(MEC_TRAPD, 0); /* turn off watch-dog */ > >>>> + mec_write(MEC_RTC_SCALER, sregs.freq-1); /* generate 1 MHz RTC = tick */ > >>>> + mec_write(MEC_MEMCFG, (3 << 18) | (4 << 10)); /* 1 MB ROM, 4 MB= RAM */ > >>>> + sregs.wim =3D 2; > >>>> + sregs.psr =3D 0x110010e0; > >>>> + sregs.r[30] =3D RAM_END; > >>>> + sregs.r[14] =3D sregs.r[30] - 96*4; > >>>> + mec_mcr |=3D 1; /* power-down enabled */ > >>>> +} > >>> > >>> why isn't sregs passed in as an arg ? looks like both callers have a= pointer to=20 > >>> it already. > >> > >> I am saving this for next major update - SMP support. All globals will= then > >> be removed and the full cpu state will be in a struct that is passed t= o the > >> simulation engine. In this way I can simulate multiple cpu's. > >=20 > > can't this particular bit be done already ? or is the global pointer d= iff from > > the local one ? >=20 > The global pointer is not different from the local, but since the global = is > used in so many places it does not seem logical to switch to a local copy= just > here. That is why I would like to keep this as is and remove all globals = in > a later patch. there's already funcs that accept it as a pointer and operate on it in this= =20 code base. since you're creating this function for the first time, it seem= s=20 natural to include the right change from the start to reduce code shuffling= =20 later on. if you're really set on this route though, i won't belabor the point (even = if i=20 think i'm right ;]). -mike --aNVUg3Xo9UgCa1D+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJU5iHNAAoJEEFjO5/oN/WBo8kQANA2o23qR4W/2Mv/dYZmc/Xg 4wIcgDeVu1F/FjTZmjVH7jUKc7vrErl2jIGbOIabl+mY+vuTADMCnK276gnWGLJ6 BRzEJQCRfsr/cM8PRx0E3QxbB6U4FKGZTM6xj/Jh+1Nok0gLr2h43LL/3+P3uXxo HleFI/iK3B6sYppK1sUhZa36sX/VI9Gw5qosfXwUEHnap0wy7Ja4PvDNfcYNh9ur wNaaWN3OPK6U8WISFNg68KrNMI7Euwe9WSVQm5BxsGyBwJnit2ZW//Qc5OeWg9pC hNNYLoTr1hmhtIoB56jWgcDo8j95tWmPPd3Z/I22eEvQfKlPRlQf25k5hlcZxhT+ fpQR6HF0qd4Lq/vCkpxwzmsgkSzDwi4FZrfQ0qo9Z+8lFDHuKQeBDzYAeHU1Bx1m k0X2lVkPE8Msh3717BRrT1CD7VKZn3RG3myqNWU0oZoUHoQPVGoQgs2ayGdEL50G dEQV2DQQ/3DvzsTF6g2HbMNOFz8sjHhTHJ03XxOB6fmrM9wi+TF7sg5waa9IH4Jh DKeF0gcKMEYeJ28BSt+W8Aoq/ryQrIEzTXD7VVTh4fCvNIJBVLmqCbAdimBHRx1Y wfpEmK8N5sAri7H+QxyT5bLZem1lIiiSDD1ocsZMN7I2/S8bAMN3XB5zzPbk9E1T RDkjfkeF293/x5gnzKee =PfzC -----END PGP SIGNATURE----- --aNVUg3Xo9UgCa1D+--