All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Erik de Castro Lopo <mle+tools@mega-nerd.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Riku Voipio <riku.voipio@iki.fi>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Posix timer syscalls ; dealing with the timer_t type
Date: Thu, 30 Aug 2012 18:00:16 +0200	[thread overview]
Message-ID: <503F8E10.6040307@suse.de> (raw)
In-Reply-To: <20120830223030.6d2582053b16583b8093a041@mega-nerd.com>

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	other threads:[~2012-08-30 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-30 12:30 [Qemu-devel] Posix timer syscalls ; dealing with the timer_t type Erik de Castro Lopo
2012-08-30 16:00 ` Andreas Färber [this message]
2012-08-30 19:15   ` Erik de Castro Lopo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=503F8E10.6040307@suse.de \
    --to=afaerber@suse.de \
    --cc=mle+tools@mega-nerd.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.