diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2012-12-12 13:32:14 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2012-12-17 13:02:17 +0200 |
commit | 315a1350c4a386065a73aad2ded1a11d77bf7771 (patch) | |
tree | aa3fb4aef47d33387386df46eb6cd1c47b35c197 /hw/pci/shpc.h | |
parent | ca818cfbfd77e02ffac338866568ac07f6f5fd7d (diff) |
pci: move pci core code to hw/pci
Move files and modify makefiles to pick them at the
new location.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/shpc.h')
-rw-r--r-- | hw/pci/shpc.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/hw/pci/shpc.h b/hw/pci/shpc.h new file mode 100644 index 0000000000..130b71df30 --- /dev/null +++ b/hw/pci/shpc.h @@ -0,0 +1,48 @@ +#ifndef SHPC_H +#define SHPC_H + +#include "qemu-common.h" +#include "memory.h" +#include "vmstate.h" + +struct SHPCDevice { + /* Capability offset in device's config space */ + int cap; + + /* # of hot-pluggable slots */ + int nslots; + + /* SHPC WRS: working register set */ + uint8_t *config; + + /* Used to enable checks on load. Note that writable bits are + * never checked even if set in cmask. */ + uint8_t *cmask; + + /* Used to implement R/W bytes */ + uint8_t *wmask; + + /* Used to implement RW1C(Write 1 to Clear) bytes */ + uint8_t *w1cmask; + + /* MMIO for the SHPC BAR */ + MemoryRegion mmio; + + /* Bus controlled by this SHPC */ + PCIBus *sec_bus; + + /* MSI already requested for this event */ + int msi_requested; +}; + +void shpc_reset(PCIDevice *d); +int shpc_bar_size(PCIDevice *dev); +int shpc_init(PCIDevice *dev, PCIBus *sec_bus, MemoryRegion *bar, unsigned off); +void shpc_cleanup(PCIDevice *dev, MemoryRegion *bar); +void shpc_cap_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int len); + +extern VMStateInfo shpc_vmstate_info; +#define SHPC_VMSTATE(_field, _type) \ + VMSTATE_BUFFER_UNSAFE_INFO(_field, _type, 0, shpc_vmstate_info, 0) + +#endif |