From: Glauber Costa Subject: [PATCH 9/15] initialize hot add system. Date: Fri, 22 Feb 2008 18:34:33 -0300 Message-ID: <1203716079-4872-10-git-send-email-gcosta@redhat.com> References: <1203716079-4872-1-git-send-email-gcosta@redhat.com> <1203716079-4872-2-git-send-email-gcosta@redhat.com> <1203716079-4872-3-git-send-email-gcosta@redhat.com> <1203716079-4872-4-git-send-email-gcosta@redhat.com> <1203716079-4872-5-git-send-email-gcosta@redhat.com> <1203716079-4872-6-git-send-email-gcosta@redhat.com> <1203716079-4872-7-git-send-email-gcosta@redhat.com> <1203716079-4872-8-git-send-email-gcosta@redhat.com> <1203716079-4872-9-git-send-email-gcosta@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: marcelo@kvack.org, avi@qumranet.com, Glauber Costa , chrisw@sous-sol.org To: kvm-devel@lists.sourceforge.net Return-path: In-Reply-To: <1203716079-4872-9-git-send-email-gcosta@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Register the pios, and grab cpu_model for future usage. Signed-off-by: Glauber Costa --- qemu/hw/acpi.c | 35 +++++++++++++++++++++++++++++++++++ qemu/hw/pc.c | 1 + 2 files changed, 36 insertions(+), 0 deletions(-) diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index 18561e0..02f6bab 100644 --- a/qemu/hw/acpi.c +++ b/qemu/hw/acpi.c @@ -533,6 +533,41 @@ void qemu_system_powerdown(void) } } #endif +unsigned long gpe_base = 0xafe0; + +struct gpe_regs { + uint16_t sts; /* status */ + uint16_t en; /* enabled */ +}; + +static struct gpe_regs gpe; + +static uint32_t gpe_readb(void *opaque, uint32_t addr) +{ + uint32_t val = 0; +#if defined(DEBUG) + printf("gpe read %lx == %lx\n", addr, val); +#endif + return val; +} + +static void gpe_writeb(void *opaque, uint32_t addr, uint32_t val) +{ +#if defined(DEBUG) + printf("gpe write %lx <== %d\n", addr, val); +#endif +} + +static char *model; + +void qemu_system_hot_add_init(char *cpu_model) +{ + register_ioport_write(gpe_base, 4, 1, gpe_writeb, &gpe); + register_ioport_read(gpe_base, 4, 1, gpe_readb, &gpe); + + model = cpu_model; +} + void qemu_system_cpu_hot_add(int cpu, int state) { } diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c index 982377d..ab69e5c 100644 --- a/qemu/hw/pc.c +++ b/qemu/hw/pc.c @@ -1020,6 +1020,7 @@ #endif } } + qemu_system_hot_add_init(cpu_model); #define USE_HYPERCALL #ifdef USE_HYPERCALL pci_hypercall_init(pci_bus); -- 1.4.2 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/