From: Glauber Costa Subject: [PATCH 10/15] handle gpe data for pio Date: Fri, 22 Feb 2008 18:34:34 -0300 Message-ID: <1203716079-4872-11-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> <1203716079-4872-10-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-10-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 actually grab and return data, instead of just being two bogus functions. Signed-off-by: Glauber Costa --- qemu/hw/acpi.c | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index 02f6bab..60d3094 100644 --- a/qemu/hw/acpi.c +++ b/qemu/hw/acpi.c @@ -545,6 +545,24 @@ static struct gpe_regs gpe; static uint32_t gpe_readb(void *opaque, uint32_t addr) { uint32_t val = 0; + struct gpe_regs *g = opaque; + switch (addr) { + case 0xafe0: + val = g->sts & 0xFF; + break; + case 0xafe1: + val = (g->sts >> 8) & 0xFF; + break; + case 0xafe2: + val = g->en & 0xFF; + break; + case 0xafe3: + val = (g->en >> 8) & 0xFF; + break; + default: + break; + } + #if defined(DEBUG) printf("gpe read %lx == %lx\n", addr, val); #endif @@ -553,6 +571,24 @@ #endif static void gpe_writeb(void *opaque, uint32_t addr, uint32_t val) { + struct gpe_regs *g = opaque; + switch (addr) { + case 0xafe0: + g->sts = (g->sts & ~0xFFFF) | (val & 0xFFFF); + break; + case 0xafe1: + g->sts = (g->sts & 0xFFFF) | (val << 8); + break; + case 0xafe2: + g->en = (g->en & ~0xFFFF) | (val & 0xFFFF); + break; + case 0xafe3: + g->en = (g->en & 0xFFFF) | (val << 8); + break; + default: + break; + } + #if defined(DEBUG) printf("gpe write %lx <== %d\n", addr, val); #endif -- 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/