diff --git a/devices/common/pci/pcibase.cpp b/devices/common/pci/pcibase.cpp index 08f24b7..71d1110 100644 --- a/devices/common/pci/pcibase.cpp +++ b/devices/common/pci/pcibase.cpp @@ -48,7 +48,7 @@ PCIBase::PCIBase(std::string name, PCIHeaderType hdr_type, int num_bars) FIXME: should register or unregister BAR mmio regions if (cmd & 2) changes. Or the mmio regions should be enabled/disabled. */ - this->command = cmd; + this->command = cmd & this->command_cfg; }; this->pci_wr_bist = [](uint8_t val) {}; this->pci_wr_lat_timer = [this](uint8_t val) { this->lat_timer = val; }; diff --git a/devices/common/pci/pcibase.h b/devices/common/pci/pcibase.h index 420671a..d26f292 100644 --- a/devices/common/pci/pcibase.h +++ b/devices/common/pci/pcibase.h @@ -171,6 +171,9 @@ protected: uint32_t exp_rom_size = 0; // expansion ROM size in bytes std::unique_ptr exp_rom_data; + + // 0 = not writable; 1 = bit is enabled in command register + uint16_t command_cfg = 0xffff - (1<<3) - (1<<7); // disable: special cycles and stepping }; inline uint32_t pci_cfg_log(uint32_t value, AccessDetails &details) {