From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0PFJ-0005o2-VV for qemu-devel@nongnu.org; Fri, 09 Apr 2010 21:12:26 -0400 Received: from [140.186.70.92] (port=38835 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0PFI-0005nR-EY for qemu-devel@nongnu.org; Fri, 09 Apr 2010 21:12:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0PFA-0005Dq-Ce for qemu-devel@nongnu.org; Fri, 09 Apr 2010 21:12:19 -0400 Received: from hall.aurel32.net ([88.191.82.174]:50480) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0PFA-0005Dm-5X for qemu-devel@nongnu.org; Fri, 09 Apr 2010 21:12:16 -0400 Date: Sat, 10 Apr 2010 03:09:09 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 13/13] target-alpha: Implement RPCC. Message-ID: <20100410010909.GA21042@volta.aurel32.net> References: <71f0403498e3107af0d749484b2710d1cefd1ace.1270680209.git.rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <71f0403498e3107af0d749484b2710d1cefd1ace.1270680209.git.rth@twiddle.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org On Wed, Apr 07, 2010 at 03:42:54PM -0700, Richard Henderson wrote: > A minimal implementation that more or less corresponds to the > user-level version used by target-i386. More hoops will want > to be jumped through when alpha gets system-level emulation. This patch looks ok, but it mixed host and target changes. Can you please split it? > Signed-off-by: Richard Henderson > --- > qemu-timer.h | 13 +++++++++++++ > target-alpha/cpu.h | 1 - > target-alpha/op_helper.c | 5 +++-- > 3 files changed, 16 insertions(+), 3 deletions(-) > > diff --git a/qemu-timer.h b/qemu-timer.h > index d2e15f4..6e2d2e1 100644 > --- a/qemu-timer.h > +++ b/qemu-timer.h > @@ -209,6 +209,19 @@ static inline int64_t cpu_get_real_ticks(void) > return (int64_t)(count * cyc_per_count); > } > > +#elif defined(__alpha__) > + > +static inline int64_t cpu_get_real_ticks(void) > +{ > + uint64_t cc; > + uint32_t cur, ofs; > + > + asm volatile("rpcc %0" : "=r"(cc)); > + cur = cc; > + ofs = cc >> 32; > + return cur - ofs; > +} > + > #else > /* The host CPU doesn't have an easily accessible cycle counter. > Just return a monotonically increasing value. This will be > diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h > index dae23e2..c2f6a50 100644 > --- a/target-alpha/cpu.h > +++ b/target-alpha/cpu.h > @@ -355,7 +355,6 @@ struct CPUAlphaState { > uint64_t ir[31]; > float64 fir[31]; > uint64_t pc; > - uint32_t pcc[2]; > uint64_t ipr[IPR_LAST]; > uint64_t ps; > uint64_t unique; > diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c > index bfc095c..ff5ae26 100644 > --- a/target-alpha/op_helper.c > +++ b/target-alpha/op_helper.c > @@ -21,6 +21,7 @@ > #include "host-utils.h" > #include "softfloat.h" > #include "helper.h" > +#include "qemu-timer.h" > > /*****************************************************************************/ > /* Exceptions processing helpers */ > @@ -33,8 +34,8 @@ void QEMU_NORETURN helper_excp (int excp, int error) > > uint64_t helper_load_pcc (void) > { > - /* XXX: TODO */ > - return 0; > + /* ??? This isn't a timer for which we have any rate info. */ > + return (uint32_t)cpu_get_real_ticks(); > } > > uint64_t helper_load_fpcr (void) > -- > 1.6.6.1 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net