From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0CAW-0007Pd-Ne for qemu-devel@nongnu.org; Wed, 03 Jun 2015 13:09:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0CAV-000082-85 for qemu-devel@nongnu.org; Wed, 03 Jun 2015 13:09:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0CAV-00007k-3i for qemu-devel@nongnu.org; Wed, 03 Jun 2015 13:09:31 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id D75C6B6F22 for ; Wed, 3 Jun 2015 17:09:30 +0000 (UTC) From: Paolo Bonzini Date: Wed, 3 Jun 2015 19:08:41 +0200 Message-Id: <1433351328-23326-17-git-send-email-pbonzini@redhat.com> In-Reply-To: <1433351328-23326-1-git-send-email-pbonzini@redhat.com> References: <1433351328-23326-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v2 16/23] hw/i386: remove smram_update List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: lersek@redhat.com, kraxel@redhat.com, mst@redhat.com It's easier to inline it now that most of its work is done by the CPU (rather than the chipset) through /machine/smram and the memory API. Signed-off-by: Paolo Bonzini --- hw/pci-host/pam.c | 6 ------ hw/pci-host/piix.c | 3 ++- hw/pci-host/q35.c | 3 ++- include/hw/pci-host/pam.h | 1 - 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/pci-host/pam.c b/hw/pci-host/pam.c index 99d7af9..17d826c 100644 --- a/hw/pci-host/pam.c +++ b/hw/pci-host/pam.c @@ -31,12 +31,6 @@ #include "sysemu/sysemu.h" #include "hw/pci-host/pam.h" -void smram_update(MemoryRegion *smram_region, uint8_t smram) -{ - bool smram_enabled = (smram & SMRAM_D_OPEN); - memory_region_set_enabled(smram_region, !smram_enabled); -} - void init_pam(DeviceState *dev, MemoryRegion *ram_memory, MemoryRegion *system_memory, MemoryRegion *pci_address_space, PAMMemoryRegion *mem, uint32_t start, uint32_t size) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index a91ad73..f1712b8 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -138,7 +138,8 @@ static void i440fx_update_memory_mappings(PCII440FXState *d) pam_update(&d->pam_regions[i], i, pd->config[I440FX_PAM + ((i + 1) / 2)]); } - smram_update(&d->smram_region, pd->config[I440FX_SMRAM]); + memory_region_set_enabled(&d->smram_region, + !(pd->config[I440FX_SMRAM] & SMRAM_D_OPEN)); memory_region_set_enabled(&d->smram, pd->config[I440FX_SMRAM] & SMRAM_G_SMRAME); memory_region_transaction_commit(); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 40a3c4d..236d3f5 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -268,7 +268,8 @@ static void mch_update_smram(MCHPCIState *mch) PCIDevice *pd = PCI_DEVICE(mch); memory_region_transaction_begin(); - smram_update(&mch->smram_region, pd->config[MCH_HOST_BRIDGE_SMRAM]); + memory_region_set_enabled(&mch->smram_region, + !(pd->config[MCH_HOST_BRIDGE_SMRAM] & SMRAM_D_OPEN)); memory_region_set_enabled(&mch->smram, pd->config[MCH_HOST_BRIDGE_SMRAM] & SMRAM_G_SMRAME); memory_region_transaction_commit(); diff --git a/include/hw/pci-host/pam.h b/include/hw/pci-host/pam.h index 80dd605..6116c63 100644 --- a/include/hw/pci-host/pam.h +++ b/include/hw/pci-host/pam.h @@ -86,7 +86,6 @@ typedef struct PAMMemoryRegion { unsigned current; } PAMMemoryRegion; -void smram_update(MemoryRegion *smram_region, uint8_t smram); void init_pam(DeviceState *dev, MemoryRegion *ram, MemoryRegion *system, MemoryRegion *pci, PAMMemoryRegion *mem, uint32_t start, uint32_t size); void pam_update(PAMMemoryRegion *mem, int idx, uint8_t val); -- 2.4.1