From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BHofu-0007mI-Jm for qemu-devel@nongnu.org; Sun, 25 Apr 2004 14:48:22 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BHofO-0007is-Sc for qemu-devel@nongnu.org; Sun, 25 Apr 2004 14:48:21 -0400 Received: from [62.210.158.41] (helo=moscou.magic.fr) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHofO-0007il-Ek for qemu-devel@nongnu.org; Sun, 25 Apr 2004 14:47:50 -0400 Received: from [10.0.0.2] (ppp-181.net-555.magic.fr [62.210.255.181]) by moscou.magic.fr (8.11.6/8.10.1) with ESMTP id i3PIliD08868 for ; Sun, 25 Apr 2004 20:47:44 +0200 (CEST) Subject: Re: [Qemu-devel] Re: Re: amd64 compile From: "J. Mayer" In-Reply-To: <5294495.u1jPGWrt4o@schnecke2.gabrielebner.at> References: <1082909230.26155.21.camel@rapid> <2653226.08FyhT9e7U@schnecke2.gabrielebner.at> <1082916542.14634.5.camel@rapid> <5294495.u1jPGWrt4o@schnecke2.gabrielebner.at> Content-Type: multipart/mixed; boundary="=-4398d8Vaw34sGS8/z5hG" Message-Id: <1082919171.14634.20.camel@rapid> Mime-Version: 1.0 Date: Sun, 25 Apr 2004 20:52:52 +0200 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-4398d8Vaw34sGS8/z5hG Content-Type: text/plain Content-Transfer-Encoding: 7bit On Sun, 2004-04-25 at 20:38, Gabriel Ebner wrote: > Hello, > > J. Mayer wrote: > > I added 3 attachements to my message. The one concerning > > cpu_get_real_ticks is named ticks.diff > > That one's empty Oops, you're aboslutely right, I'm sorry... Here it is again. -- J. Mayer Never organized --=-4398d8Vaw34sGS8/z5hG Content-Disposition: attachment; filename=ticks.diff Content-Type: text/x-patch; name=ticks.diff; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Index: vl.c =================================================================== RCS file: /cvsroot/qemu/qemu/vl.c,v retrieving revision 1.59 diff -u -r1.59 vl.c --- vl.c 12 Apr 2004 20:39:28 -0000 1.59 +++ vl.c 19 Apr 2004 13:04:29 -0000 @@ -358,7 +358,20 @@ return val; } +#elif defined(__x86_64__) + +int64_t cpu_get_real_ticks(void) +{ + uint32_t low,high; + int64_t val; + asm volatile("rdtsc" : "=a" (low), "=d" (high)); + val = high; + val <<= 32; + val |= low; + return val; +} + #else #error unsupported CPU #endif --=-4398d8Vaw34sGS8/z5hG--