From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56655 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTbjr-0004j0-I1 for qemu-devel@nongnu.org; Tue, 29 Jun 2010 10:24:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTbjm-0005T8-Rc for qemu-devel@nongnu.org; Tue, 29 Jun 2010 10:24:39 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:48166) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTbjm-0005Sr-PN for qemu-devel@nongnu.org; Tue, 29 Jun 2010 10:24:34 -0400 Received: by gwj20 with SMTP id 20so409656gwj.4 for ; Tue, 29 Jun 2010 07:24:33 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4C2A021B.4010802@redhat.com> Date: Tue, 29 Jun 2010 16:24:27 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1277745445-30560-1-git-send-email-pbonzini@redhat.com> <201006282129.34080.paul@codesourcery.com> <4C29A478.1080805@redhat.com> <201006291230.18759.paul@codesourcery.com> <4C29FA67.3070605@redhat.com> In-Reply-To: <4C29FA67.3070605@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: blauwirbel@gmail.com, Paul Brook , qemu-devel@nongnu.org On 06/29/2010 03:51 PM, Paolo Bonzini wrote: > On 06/29/2010 01:30 PM, Paul Brook wrote: >> I don't understand what this is supposed to achieve. The inclusion >> of exec.h is what defines whether this global variable is >> available. Just as importantly, it also prevents code clobbering >> this value. Having one without the other makes no sense. >> >> Making "env" available without including exec.h would be a >> different problem, but we never do that and would probably indicate >> we're doing something else wrong. > > Paul, I agree but I was told to do something different. BTW, this may be useful for one thing: being able to include exec.h without bringing in the global variable. I didn't really see a use right now for that, but cpu_get_tb_cpu_state could be something that may belong in target-*/exec.h more than in target-*/cpu.h (no, I'm not going to move it); yet it cannot be moved right now because it is called in exec.c. That said, I think everybody at least agrees on the first 3 patches, is it possible to get at least (v2 of) thos applied? Paolo