From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR1du-0005Ug-Bj for qemu-devel@nongnu.org; Tue, 01 Oct 2013 11:13:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VR1dl-0005Yh-J2 for qemu-devel@nongnu.org; Tue, 01 Oct 2013 11:13:42 -0400 Received: from mail-ye0-x236.google.com ([2607:f8b0:4002:c04::236]:39452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR1dl-0005YX-EG for qemu-devel@nongnu.org; Tue, 01 Oct 2013 11:13:33 -0400 Received: by mail-ye0-f182.google.com with SMTP id l10so2187909yen.13 for ; Tue, 01 Oct 2013 08:13:33 -0700 (PDT) Sender: Richard Henderson Message-ID: <524AE694.1030708@twiddle.net> Date: Tue, 01 Oct 2013 08:13:24 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1380556655-22282-1-git-send-email-chouteau@adacore.com> <1380556655-22282-4-git-send-email-chouteau@adacore.com> <524A2CA4.40000@twiddle.net> <524ADBF3.9090105@adacore.com> In-Reply-To: <524ADBF3.9090105@adacore.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/4] Refactoring MonitorDef array List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, afaerber@suse.de, lcapitulino@redhat.com On 10/01/2013 07:28 AM, Fabien Chouteau wrote: > On 10/01/2013 04:00 AM, Richard Henderson wrote: >> On 09/30/2013 08:57 AM, Fabien Chouteau wrote: >>> +extern const MonitorDef arch_monitor_defs[]; >> >> This is supplied by target-foo/monitor.c, right? >> Why in the world is it declared in generic code? >> > > Yes, why? > >> Especially if it's only ever accessed via the >> cpu->monitor_defs member? >> > > To begin with, I though I'd put in in each target-*/cpu.c, then having > it at only one place seemed more clean. I'm open to any suggestion. > If you put it in a global header like that, it looks like the array is part of the generic interface. But it isn't -- only the monitor_defs member is. If it's declared in any header at all, as opposed to static and local to cpu.c (why was a new monitor.c file chosen?), it should go into target-foo/cpu.h, where most of the other cpu-specific declarations go. r~