mirror of https://github.com/xqemu/xqemu.git
pci: helper functions to access PCIDevice::config
add helper functions to get/set PCIDevice::config Those will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
182f9c8a64
commit
fb5ce7d289
12
hw/pci.h
12
hw/pci.h
|
@ -311,6 +311,18 @@ pci_get_long(uint8_t *config)
|
||||||
return le32_to_cpupu((uint32_t *)config);
|
return le32_to_cpupu((uint32_t *)config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
pci_set_quad(uint8_t *config, uint64_t val)
|
||||||
|
{
|
||||||
|
cpu_to_le64w((uint64_t *)config, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline uint64_t
|
||||||
|
pci_get_quad(uint8_t *config)
|
||||||
|
{
|
||||||
|
return le64_to_cpup((uint64_t *)config);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
pci_config_set_vendor_id(uint8_t *pci_config, uint16_t val)
|
pci_config_set_vendor_id(uint8_t *pci_config, uint16_t val)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue