[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 37/61] pci: add helper function for pci config write
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 37/61] pci: add helper function for pci config write function to check address. |
Date: |
Wed, 30 Sep 2009 19:18:13 +0900 |
add helper function for pci config write function to check address.
Those function will be used later.
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/pci.h | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/hw/pci.h b/hw/pci.h
index 5cd882c..26c15c5 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -406,6 +406,20 @@ pci_config_get_quad(PCIDevice *d, uint32_t addr)
return pci_get_quad(&d->config[addr]);
}
+static inline int pci_config_changed(uint32_t addr, uint32_t len,
+ uint32_t base, uint32_t end)
+{
+ /* check if [addr, addr + len] intersects [base, end] */
+ return base <= addr + len && addr <= end;
+}
+
+static inline int pci_config_changed_with_size(uint32_t addr, uint32_t len,
+ uint32_t base, uint32_t size)
+{
+ /* check if [addr, addr + len] intersects [base, base + size] */
+ return base <= addr + len && addr <= base + size;
+}
+
typedef int (*pci_qdev_initfn)(PCIDevice *dev);
typedef struct {
DeviceInfo qdev;
--
1.6.0.2
- [Qemu-devel] [PATCH 14/61] pc: split out memory allocation from pc_init1() into pc_memory_init(), (continued)
- [Qemu-devel] [PATCH 14/61] pc: split out memory allocation from pc_init1() into pc_memory_init(), Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 56/61] ioapic: clean up of #ifdef DEBUG_IOAPIC., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 03/61] acpi: add acpi constants from linux header files and use them., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 49/61] pci hot add: pass opaque argument to callback., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 01/61] acpi: split out pc smbus routines from acpi.c into pc_smbus.c, Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 61/61] pc_q35: apic mode for pci interrupt routing., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 11/61] pc: introduce a function to allocate cpu irq., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 51/61] vmstate: add a macro for pointer to struct, VMSTATE_STRUCT_POINTER., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 54/61] pci: add opaque argument to pci_map_irq_fn()., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 30/61] pci_host.h: split non-inline static function in pci_host.h into pci_host_c.h, Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 37/61] pci: add helper function for pci config write function to check address.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH 36/61] pci: use QLIST_ macro instead of direct list manipulation., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 22/61] pci: use appropriate PRIs in PCI_DPRINTF()., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 43/61] pci: add helper function to initialize wmask., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 39/61] pci: factor out config update logic., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 55/61] ioapic: make ioapic_set_irq() static., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 53/61] pc q35 based chipset emulator, Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 38/61] pci: fix pci_default_write_config(), Isaku Yamahata, 2009/09/30