pci: Add command register mask.

The mask represents the list of bits that are allowed to change in the command register of PCI config space.
This commit is contained in:
joevt 2023-07-14 13:40:01 -07:00 committed by dingusdev
parent eef6d267c3
commit 61b1940397
2 changed files with 4 additions and 1 deletions

View File

@ -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; };

View File

@ -171,6 +171,9 @@ protected:
uint32_t exp_rom_size = 0; // expansion ROM size in bytes
std::unique_ptr<uint8_t[]> 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) {