qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Posix timer syscalls ; dealing with the timer_t type


From: Andreas Färber
Subject: Re: [Qemu-devel] Posix timer syscalls ; dealing with the timer_t type
Date: Thu, 30 Aug 2012 18:00:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0

Hi,

Am 30.08.2012 14:30, schrieb Erik de Castro Lopo:
> I'm working on implementing Posix timers in linux-user.
> 
> 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:
> 
>     timer_t timerid;
> 
>     err = timer_create(clockid, &sev, &timerid);
>     err = timer_gettime(timerid, &curr);
> 
> 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.
> 
> 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

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]