From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSc1u-0000Te-IM for qemu-devel@nongnu.org; Thu, 10 May 2012 18:40:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSc1s-0008Gh-J8 for qemu-devel@nongnu.org; Thu, 10 May 2012 18:40:14 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46816 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSc1s-0008Gc-9W for qemu-devel@nongnu.org; Thu, 10 May 2012 18:40:12 -0400 Message-ID: <4FAC43C4.3040908@suse.de> Date: Fri, 11 May 2012 00:40:04 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1336608892-30501-1-git-send-email-afaerber@suse.de> <1336608892-30501-38-git-send-email-afaerber@suse.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH next v2 37/74] arm_boot: Pass ARMCPU to do_cpu_reset() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org Am 10.05.2012 23:41, schrieb Peter Maydell: > On 10 May 2012 01:14, Andreas F=C3=A4rber wrote: >> Allows us to use cpu_reset() in place of cpu_state_reset(). >> >> Signed-off-by: Andreas F=C3=A4rber >> --- >> hw/arm_boot.c | 9 ++++++--- >> 1 files changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/hw/arm_boot.c b/hw/arm_boot.c >> index 7447f5c..eb2d176 100644 >> --- a/hw/arm_boot.c >> +++ b/hw/arm_boot.c [...] >> @@ -302,6 +303,7 @@ static void do_cpu_reset(void *opaque) >> >> void arm_load_kernel(CPUARMState *env, struct arm_boot_info *info) >> { >> + ARMCPU *cpu; >> int kernel_size; >> int initrd_size; >> int n; >=20 > This variable could be kept in the more limited scope inside > the for loop below, right? It could. The function currently has a CPUARMState *env argument. That is supposed to change to ARMCPU *cpu in one of the followup series, in which case the for loop can reuse that parameter. I generally try to keep cpu and env close together so that it's visible in diff/grep context, as explained for your cpu_reset_model_id() series. Would you like it better if I unneededly assigned ARMCPU *cpu =3D arm_env_get_cpu(env); to show its relation to env? The next step would be to pass cpu through to the write_secondary_boot callback. I have not included the signature changes for arm_load_kernel() or the callback in this series because it requires comparable changes to more actively maintained machines such as exynos and highbank and would've made it even longer. I'd be happy to reprioritize such a series though if you're willing to review it and handle any arising conflicts. :) /-F >> @@ -406,7 +408,8 @@ void arm_load_kernel(CPUARMState *env, struct arm_= boot_info *info) >> info->is_linux =3D is_linux; >> >> for (; env; env =3D env->next_cpu) { >> + cpu =3D arm_env_get_cpu(env); >> env->boot_info =3D info; >> - qemu_register_reset(do_cpu_reset, env); >> + qemu_register_reset(do_cpu_reset, cpu); >> } >> } >> -- >> 1.7.7 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg