Skip to content
  • Michael S. Tsirkin's avatar
    qemu/pci: make default_write_config use mask table · b7ee1603
    Michael S. Tsirkin authored
    
    
    Change much of hw/pci to use symbolic constants and a table-driven
    design: add a mask table with writable bits set and readonly bits unset.
    Detect change by comparing original and new registers.
    
    This makes it easy to support capabilities where read-only/writeable
    bit layout differs between devices, depending on capabilities present.
    
    As a result, writing a single byte in BAR registers now works as
    it should. Writing to upper limit registers in the bridge
    also works as it should. Code is also shorter.
    
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    b7ee1603