diff --git a/tlm-modules/pf-config.h b/tlm-modules/pf-config.h index 7586975..f4f58ed 100644 --- a/tlm-modules/pf-config.h +++ b/tlm-modules/pf-config.h @@ -105,7 +105,7 @@ class PCIExpressCapability: public PCICapability // hardwired to '0' as according to PCI Express Base // specification. // - PCIExpressCapSize = PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 + 0x8, + PCIExpressCapSize = PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 + 0xA, }; PCIExpressCapability(): @@ -244,6 +244,7 @@ class PhysFuncConfig { if (m_pciCapTail == 0) { m_pciCapTail = PCI_CONFIG_SIZE - cap_size; + assert((m_pciCapTail & 0x3) == 0); // Dword aligned. SetNextCapPtr(m_pciCapTail); // // Hardwire status 'Capabilities List' to 1 @@ -253,6 +254,7 @@ class PhysFuncConfig uint32_t nextCapPtr = m_pciCapTail + 1; m_pciCapTail -= cap_size; + assert((m_pciCapTail & 0x3) == 0); // Dword aligned. m_config[nextCapPtr] = m_pciCapTail; } memcpy(reinterpret_cast(&m_config[m_pciCapTail]),