[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] i386-linux-user NPTL
From: |
Ulrich Hecht |
Subject: |
[Qemu-devel] [PATCH] i386-linux-user NPTL |
Date: |
Tue, 3 Feb 2009 17:50:33 +0100 |
User-agent: |
KMail/1.9.10 |
Hi!
This enables NPTL for the i386 target. If someone could comment on why the
cpu_x86_load_seg() call is necessary, I would appreciate it. It looks like
an elaborate nop to me.
Signed-off-by: Ulrich Hecht <address@hidden>
Index: linux-user/syscall.c
===================================================================
--- linux-user/syscall.c (revision 6501)
+++ linux-user/syscall.c (working copy)
@@ -2937,8 +2937,14 @@
flags &= ~CLONE_NPTL_FLAGS2;
/* TODO: Implement CLONE_CHILD_CLEARTID. */
- 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
+ }
/* Grab a mutex so that thread setup appears atomic. */
pthread_mutex_lock(&clone_lock);
@@ -3009,8 +3015,14 @@
if (flags & CLONE_PARENT_SETTID)
put_user_u32(gettid(), parent_tidptr);
ts = (TaskState *)env->opaque;
- if (flags & CLONE_SETTLS)
+ if (flags & CLONE_SETTLS) {
+#if defined(TARGET_I386) && defined(TARGET_ABI32)
+ do_set_thread_area(env, newtls);
+ cpu_x86_load_seg(env, R_GS, env->segs[R_GS].selector);
+#else
cpu_set_tls (env, newtls);
+#endif
+ }
/* TODO: Implement CLONE_CHILD_CLEARTID. */
#endif
} else {
Index: configure
===================================================================
--- configure (revision 6501)
+++ configure (working copy)
@@ -1583,6 +1591,7 @@
echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
echo "#define CONFIG_KVM 1" >> $config_h
fi
+ target_nptl="yes"
;;
x86_64)
echo "TARGET_ARCH=x86_64" >> $config_mak
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH] i386-linux-user NPTL,
Ulrich Hecht <=