All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Froyd <froydnj@codesourcery.com>
To: Ulrich Hecht <uli@suse.de>
Cc: Riku Voipio <riku.voipio@iki.fi>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] i386-linux-user NPTL support
Date: Thu, 20 Aug 2009 09:43:04 -0700	[thread overview]
Message-ID: <20090820164304.GP29075@codesourcery.com> (raw)
In-Reply-To: <1250785143-24969-1-git-send-email-uli@suse.de>

On Thu, Aug 20, 2009 at 06:19:03PM +0200, Ulrich Hecht wrote:
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> -        if (nptl_flags & CLONE_SETTLS)
> +        if (nptl_flags & CLONE_SETTLS) {
> +#if defined(TARGET_I386) && defined(TARGET_ABI32)
> +            do_set_thread_area(new_env, newtls);
> +            cpu_x86_load_seg(new_env, R_GS, new_env->segs[R_GS].selector);
> +#else
>              cpu_set_tls (new_env, newtls);
> +#endif
> +        }

Why not just stick things in cpu_set_tls in target-i386/cpu.h like so:

#if defined(TARGET-I386) && defined(TARGET_ABI32)
static inline void cpu_set_tls(CPUState *env, target_ulong newtls)
{
    do_set_thread_area(env, newtls);
    cpu_x86_load_seg(env, R_GS, env->segs[R_GS].selector);
}
#endif

Less duplicated code and fewer #ifdefs that way and it's still clear
that x86-64 linux-user emulation doesn't support NPTL.

-Nathan

  reply	other threads:[~2009-08-20 16:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20 16:19 [Qemu-devel] [PATCH] i386-linux-user NPTL support Ulrich Hecht
2009-08-20 16:43 ` Nathan Froyd [this message]
2009-08-21 10:10   ` Ulrich Hecht
2009-08-21 13:11     ` Nathan Froyd

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=20090820164304.GP29075@codesourcery.com \
    --to=froydnj@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=uli@suse.de \
    /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.