From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T77Ah-0004qw-W5 for qemu-devel@nongnu.org; Thu, 30 Aug 2012 12:00:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T77AY-00073N-K4 for qemu-devel@nongnu.org; Thu, 30 Aug 2012 12:00:43 -0400 Received: from cantor2.suse.de ([195.135.220.15]:45391 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T77AY-0006zK-Dv for qemu-devel@nongnu.org; Thu, 30 Aug 2012 12:00:34 -0400 Message-ID: <503F8E10.6040307@suse.de> Date: Thu, 30 Aug 2012 18:00:16 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <20120830223030.6d2582053b16583b8093a041@mega-nerd.com> In-Reply-To: <20120830223030.6d2582053b16583b8093a041@mega-nerd.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Posix timer syscalls ; dealing with the timer_t type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Erik de Castro Lopo Cc: Peter Maydell , Riku Voipio , qemu-devel@nongnu.org Hi, Am 30.08.2012 14:30, schrieb Erik de Castro Lopo: > I'm working on implementing Posix timers in linux-user. >=20 > I'm having trouble figuring out how to handle the timer_t type. > Consider the following code with say 32 bit ARM being emulated > on 64 bit x86-64: >=20 > timer_t timerid; >=20 > err =3D timer_create(clockid, &sev, &timerid); > err =3D timer_gettime(timerid, &curr); >=20 > The issue is that memory for the timer_t value in the 32 bit > target is alloacted on the tack (where the timer_t is 4 bytes) > but the value provided by the 64 bit host where the timer_t is > 8 bytes. >=20 > Any suggestions on dealing with this? typedef target_ulong target_timer_t; or abi_ulong, or without the u if signed. Depending on where/how you use this, you may need to convert back and forth between host and target values. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg