Received: from eggs.gnu.org ([2001:4830:134:3::10]:38206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcZJc-0003x0-4f for qemu-devel@nongnu.org; Mon, 30 Mar 2015 09:01:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcZJY-0001YU-MD for qemu-devel@nongnu.org; Mon, 30 Mar 2015 09:01:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcZJY-0001YN-Gt for qemu-devel@nongnu.org; Mon, 30 Mar 2015 09:01:12 -0400 Date: Mon, 30 Mar 2015 14:01:09 +0100 From: Stefan Hajnoczi Message-ID: <20150330130109.GI25181@stefanha-thinkpad.redhat.com> References: <1427559731-20180-1-git-send-email-emilcondrea@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="e5GLnnZ8mDMEwH4V" Content-Disposition: inline In-Reply-To: <1427559731-20180-1-git-send-email-emilcondrea@gmail.com> Subject: Re: [Qemu-devel] [PATCH] replaced get_ticks_per_sec() with constant List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, Emil Condrea --e5GLnnZ8mDMEwH4V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 28, 2015 at 06:22:11PM +0200, Emil Condrea wrote: > diff --git a/target-arm/helper.c b/target-arm/helper.c > index 10886c5..504530a 100644 > --- a/target-arm/helper.c > +++ b/target-arm/helper.c > @@ -649,7 +649,7 @@ void pmccntr_sync(CPUARMState *env) > uint64_t temp_ticks; > =20 > temp_ticks =3D muldiv64(qemu_clock_get_us(QEMU_CLOCK_VIRTUAL), > - get_ticks_per_sec(), 1000000); > + NSEC_PER_SEC, 1000000); > =20 > if (env->cp15.c9_pmcr & PMCRD) { > /* Increment once every 64 processor clock cycles */ > @@ -688,7 +688,7 @@ static uint64_t pmccntr_read(CPUARMState *env, const = ARMCPRegInfo *ri) > } > =20 > total_ticks =3D muldiv64(qemu_clock_get_us(QEMU_CLOCK_VIRTUAL), > - get_ticks_per_sec(), 1000000); > + NSEC_PER_SEC, 1000000); > =20 > if (env->cp15.c9_pmcr & PMCRD) { > /* Increment once every 64 processor clock cycles */ > @@ -709,7 +709,7 @@ static void pmccntr_write(CPUARMState *env, const ARM= CPRegInfo *ri, > } > =20 > total_ticks =3D muldiv64(qemu_clock_get_us(QEMU_CLOCK_VIRTUAL), > - get_ticks_per_sec(), 1000000); > + NSEC_PER_SEC, 1000000); Peter: I wonder why the muldiv64() expression is necessary. Is it intentionally returning the microsecond clock converted to nanoseconds? Perhaps the expression should be replaced with just qemu_get_clock_ns(QEMU_CLOCK_VIRTUAL)? Or if microsecond precision is required, use qemu_get_clock_us() * 1000. Stefan --e5GLnnZ8mDMEwH4V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVGUkVAAoJEJykq7OBq3PIhjEIAI1GVBegc206yFFq9ziAezHT CxPUDNxndTQ7FW+HSS7SMqLWiYokTI8NizYp7Eo618eGPF2aXfivg+hglp98FYqB B8E7wlO2713qNDhb4JqolEtRnEpEPSt+VRAXupK1ntkiPGcK7BIV+zF5ZL+XAcXw Q7NXPAE6YRyE9NzirWLTHrPP1m01Blq0E4spI88q0auV2mvwVbYnI1RD08CXS6b4 9Sj51rsdhaij+CLBws8M+F9YSbOoy1wSgosgTN+I3tbxsGLvg/aiiEBs5g9SXLtY d5iF7SGJfhM+weICIMhip6uyHOBBTh32NL4eH01b3s3KRyTCfBqZ20Es6q/Xo5Q= =tduw -----END PGP SIGNATURE----- --e5GLnnZ8mDMEwH4V--