From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ull4R-0000ea-1w for qemu-devel@nongnu.org; Sun, 09 Jun 2013 15:14:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ull4P-0000lH-Pq for qemu-devel@nongnu.org; Sun, 09 Jun 2013 15:14:30 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44443 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ull4P-0000l5-In for qemu-devel@nongnu.org; Sun, 09 Jun 2013 15:14:29 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 9 Jun 2013 21:13:03 +0200 Message-Id: <1370805206-26574-37-git-send-email-afaerber@suse.de> In-Reply-To: <1370805206-26574-1-git-send-email-afaerber@suse.de> References: <1370805206-26574-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-cpu 36/59] linux-user/elfload: Abstract fill_note_info() with qemu_for_each_cpu() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Riku Voipio , =?UTF-8?q?Andreas=20F=C3=A4rber?= Eliminates a confusing CPUArchState *cpu variable. Signed-off-by: Andreas F=C3=A4rber --- linux-user/elfload.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ddef23e..cb21487 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2624,11 +2624,21 @@ static void fill_thread_info(struct elf_note_info= *info, const CPUArchState *env info->notes_size +=3D note_size(&ets->notes[0]); } =20 +static void fill_note_info_for_thread(CPUState *cpu, void *data) +{ + struct elf_note_info *info =3D data; + CPUArchState *env =3D cpu->env_ptr; + + if (env =3D=3D thread_env) { + return; + } + fill_thread_info(info, env); +} + static int fill_note_info(struct elf_note_info *info, long signr, const CPUArchState *env) { #define NUMNOTES 3 - CPUArchState *cpu =3D NULL; TaskState *ts =3D (TaskState *)env->opaque; int i; =20 @@ -2666,11 +2676,7 @@ static int fill_note_info(struct elf_note_info *in= fo, =20 /* read and fill status of all threads */ cpu_list_lock(); - for (cpu =3D first_cpu; cpu !=3D NULL; cpu =3D cpu->next_cpu) { - if (cpu =3D=3D thread_env) - continue; - fill_thread_info(info, cpu); - } + qemu_for_each_cpu(fill_note_info_for_thread, info); cpu_list_unlock(); =20 return (0); --=20 1.8.1.4