qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] i386-linux-user NPTL support


From: Nathan Froyd
Subject: Re: [Qemu-devel] [PATCH] i386-linux-user NPTL support
Date: Thu, 20 Aug 2009 09:43:04 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

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 via email to

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