From: Glauber Costa Subject: [PATCH 10/15] handle gpe data for pio Date: Tue, 26 Feb 2008 16:56:40 -0300 Message-ID: <1204055805-32349-11-git-send-email-gcosta@redhat.com> References: <1204055805-32349-1-git-send-email-gcosta@redhat.com> <1204055805-32349-2-git-send-email-gcosta@redhat.com> <1204055805-32349-3-git-send-email-gcosta@redhat.com> <1204055805-32349-4-git-send-email-gcosta@redhat.com> <1204055805-32349-5-git-send-email-gcosta@redhat.com> <1204055805-32349-6-git-send-email-gcosta@redhat.com> <1204055805-32349-7-git-send-email-gcosta@redhat.com> <1204055805-32349-8-git-send-email-gcosta@redhat.com> <1204055805-32349-9-git-send-email-gcosta@redhat.com> <1204055805-32349-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, qemu-devel@nongnu.org, avi@qumranet.com, Glauber Costa , chrisw@sous-sol.org To: kvm-devel@lists.sourceforge.net Return-path: In-Reply-To: <1204055805-32349-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 119b59a..7340f15 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 GPE_BASE: + val = g->sts & 0xFF; + break; + case GPE_BASE + 1: + val = (g->sts >> 8) & 0xFF; + break; + case GPE_BASE + 2: + val = g->en & 0xFF; + break; + case GPE_BASE + 3: + 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 GPE_BASE: + g->sts = (g->sts & ~0xFFFF) | (val & 0xFFFF); + break; + case GPE_BASE + 1: + g->sts = (g->sts & 0xFFFF) | (val << 8); + break; + case GPE_BASE + 2: + g->en = (g->en & ~0xFFFF) | (val & 0xFFFF); + break; + case GPE_BASE + 3: + 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/