From: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] implement CLONE_CHILD_CLEARTID
Date: Wed, 15 Oct 2008 19:18:32 -0300 [thread overview]
Message-ID: <1224109112.7266.25.camel@laurov-desktop> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 135 bytes --]
The attached patch implements the clone flag CLONE_CHILD_CLEARTID.
--
Lauro Ramos Venancio
INdT - Instituto Nokia de Tecnologia
[-- Attachment #1.2: clone_child_cleartid.patch --]
[-- Type: text/x-patch, Size: 2095 bytes --]
Index: qemu-arm-eabi/linux-user/syscall.c
===================================================================
--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-13 19:10:54.000000000 -0300
+++ qemu-arm-eabi/linux-user/syscall.c 2008-10-13 19:31:01.000000000 -0300
@@ -3177,6 +3177,7 @@
pthread_cond_t cond;
pthread_t thread;
uint32_t tid;
+ unsigned int flags;
abi_ulong child_tidptr;
abi_ulong parent_tidptr;
sigset_t sigmask;
@@ -3190,9 +3191,11 @@
env = info->env;
thread_env = env;
info->tid = gettid();
- if (info->child_tidptr)
+ if (info->flags & CLONE_CHILD_SETTID)
put_user_u32(info->tid, info->child_tidptr);
- if (info->parent_tidptr)
+ if (info->flags & CLONE_CHILD_CLEARTID)
+ set_tid_address(g2h(info->child_tidptr));
+ if (info->flags & CLONE_PARENT_SETTID)
put_user_u32(info->tid, info->parent_tidptr);
/* Enable signals. */
sigprocmask(SIG_SETMASK, &info->sigmask, NULL);
@@ -3257,7 +3260,6 @@
nptl_flags = flags;
flags &= ~CLONE_NPTL_FLAGS2;
- /* TODO: Implement CLONE_CHILD_CLEARTID. */
if (nptl_flags & CLONE_SETTLS)
cpu_set_tls (new_env, newtls);
@@ -3269,7 +3271,9 @@
pthread_mutex_lock(&info.mutex);
pthread_cond_init(&info.cond, NULL);
info.env = new_env;
- if (nptl_flags & CLONE_CHILD_SETTID)
+ info.flags = nptl_flags;
+ if (nptl_flags & CLONE_CHILD_SETTID ||
+ nptl_flags & CLONE_CHILD_CLEARTID)
info.child_tidptr = child_tidptr;
if (nptl_flags & CLONE_PARENT_SETTID)
info.parent_tidptr = parent_tidptr;
@@ -3332,7 +3336,8 @@
ts = (TaskState *)env->opaque;
if (flags & CLONE_SETTLS)
cpu_set_tls (env, newtls);
- /* TODO: Implement CLONE_CHILD_CLEARTID. */
+ if (flags & CLONE_CHILD_CLEARTID)
+ set_tid_address(g2h(child_tidptr));
} else {
fork_end(0);
}
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2008-10-15 22:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-15 22:18 Lauro Ramos Venancio [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-10-15 22:57 [Qemu-devel] [PATCH] implement CLONE_CHILD_CLEARTID Lauro Ramos Venancio
2008-10-16 13:19 ` Paul Brook
2008-10-16 14:28 ` Lauro Ramos Venancio
2009-02-02 9:19 Riku Voipio
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=1224109112.7266.25.camel@laurov-desktop \
--to=lauro.venancio@openbossa.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).