mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-26 19:42:33 -06:00
ahci: add test_pci_enable to ahci-test.
This adds a test wherein we engage the PCI AHCI device and ensure that the memory region for the HBA functionality is now accessible. Under Q35 environments, additional PCI configuration is performed to ensure that the HBA functionality will become usable. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-5-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
8840a843dc
commit
96d6d3bad9
2 changed files with 59 additions and 0 deletions
|
@ -71,6 +71,12 @@ void qpci_device_enable(QPCIDevice *dev)
|
|||
cmd = qpci_config_readw(dev, PCI_COMMAND);
|
||||
cmd |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
|
||||
qpci_config_writew(dev, PCI_COMMAND, cmd);
|
||||
|
||||
/* Verify the bits are now set. */
|
||||
cmd = qpci_config_readw(dev, PCI_COMMAND);
|
||||
g_assert_cmphex(cmd & PCI_COMMAND_IO, ==, PCI_COMMAND_IO);
|
||||
g_assert_cmphex(cmd & PCI_COMMAND_MEMORY, ==, PCI_COMMAND_MEMORY);
|
||||
g_assert_cmphex(cmd & PCI_COMMAND_MASTER, ==, PCI_COMMAND_MASTER);
|
||||
}
|
||||
|
||||
uint8_t qpci_find_capability(QPCIDevice *dev, uint8_t id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue