From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56203 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLJp7-0006NM-8E for qemu-devel@nongnu.org; Sun, 06 Jun 2010 13:39:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLJp6-0003DT-9C for qemu-devel@nongnu.org; Sun, 06 Jun 2010 13:39:49 -0400 Received: from fg-out-1718.google.com ([72.14.220.153]:26496) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLJp6-0003DH-4j for qemu-devel@nongnu.org; Sun, 06 Jun 2010 13:39:48 -0400 Received: by fg-out-1718.google.com with SMTP id 16so482459fgg.10 for ; Sun, 06 Jun 2010 10:39:47 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4C0BDD61.9020908@redhat.com> Date: Sun, 06 Jun 2010 19:39:45 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 6/6] apic: avoid using CPUState internals List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel On 06/05/2010 11:31 PM, Blue Swirl wrote: > Use only an opaque CPUState pointer and move the actual CPUState > contents handling to cpu.h and cpuid.c. > > Set env->halted in pc.c and add a function to get the local APIC state > of the current CPU for the MMIO. > > Signed-off-by: Blue Swirl > --- > hw/apic.c | 40 +++++++++++++++------------------------- > hw/apic.h | 9 ++++++++- > hw/pc.c | 12 +++++++++++- > target-i386/cpu.h | 27 ++++++++++++++++----------- > target-i386/cpuid.c | 6 ++++++ > 5 files changed, 56 insertions(+), 38 deletions(-) > > diff --git a/hw/apic.c b/hw/apic.c > index 91c8d93..332c66e 100644 > --- a/hw/apic.c > +++ b/hw/apic.c > @@ -95,7 +95,7 @@ > #define MSI_ADDR_SIZE 0x100000 > > struct APICState { > - CPUState *cpu_env; > + void *cpu_env; I proposed having an opaque CPUState type in hw/ but it was rejected. But I don't think using a void pointer is any better. Paolo