diff options
Diffstat (limited to 'src/drivers/bus/pcibackup.c')
-rw-r--r-- | src/drivers/bus/pcibackup.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/drivers/bus/pcibackup.c b/src/drivers/bus/pcibackup.c index fecad8192..4cf126f83 100644 --- a/src/drivers/bus/pcibackup.c +++ b/src/drivers/bus/pcibackup.c @@ -61,14 +61,15 @@ pci_backup_excluded ( struct pci_device *pci, unsigned int offset, * * @v pci PCI device * @v backup PCI configuration space backup + * @v limit Maximum offset in PCI configuration space * @v exclude PCI configuration space backup exclusion list, or NULL */ void pci_backup ( struct pci_device *pci, struct pci_config_backup *backup, - const uint8_t *exclude ) { + unsigned int limit, const uint8_t *exclude ) { unsigned int offset; uint32_t *dword; - for ( offset = 0, dword = backup->dwords ; offset < 0x100 ; + for ( offset = 0, dword = backup->dwords ; offset < limit ; offset += sizeof ( *dword ) , dword++ ) { if ( ! pci_backup_excluded ( pci, offset, exclude ) ) pci_read_config_dword ( pci, offset, dword ); @@ -80,14 +81,15 @@ void pci_backup ( struct pci_device *pci, struct pci_config_backup *backup, * * @v pci PCI device * @v backup PCI configuration space backup + * @v limit Maximum offset in PCI configuration space * @v exclude PCI configuration space backup exclusion list, or NULL */ void pci_restore ( struct pci_device *pci, struct pci_config_backup *backup, - const uint8_t *exclude ) { + unsigned int limit, const uint8_t *exclude ) { unsigned int offset; uint32_t *dword; - for ( offset = 0, dword = backup->dwords ; offset < 0x100 ; + for ( offset = 0, dword = backup->dwords ; offset < limit ; offset += sizeof ( *dword ) , dword++ ) { if ( ! pci_backup_excluded ( pci, offset, exclude ) ) pci_write_config_dword ( pci, offset, *dword ); |