From bdc44640cb33c90809376a262df871a1144d339a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 24 Jun 2013 23:50:24 +0200 Subject: cpu: Use QTAILQ for CPU list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce CPU_FOREACH(), CPU_FOREACH_SAFE() and CPU_NEXT() shorthand macros. Signed-off-by: Andreas Färber --- linux-user/syscall.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'linux-user/syscall.c') diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f986548..ecead51 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5113,25 +5113,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, Do thread termination if we have more then one thread. */ /* FIXME: This probably breaks if a signal arrives. We should probably be disabling signals. */ - if (first_cpu->next_cpu) { + if (CPU_NEXT(first_cpu)) { TaskState *ts; - CPUState **lastp; - CPUState *p; cpu_list_lock(); - lastp = &first_cpu; - p = first_cpu; - while (p && p != cpu) { - lastp = &p->next_cpu; - p = p->next_cpu; - } - /* If we didn't find the CPU for this thread then something is - horribly wrong. */ - if (!p) { - abort(); - } /* Remove the CPU from the list. */ - *lastp = p->next_cpu; + QTAILQ_REMOVE(&cpus, cpu, node); cpu_list_unlock(); ts = ((CPUArchState *)cpu_env)->opaque; if (ts->child_tidptr) { -- cgit v1.1