From ca2be7e094c900542e36f70f3abc3c8ff7c3055d Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 13 Nov 2022 20:42:09 +0000 Subject: [pci] Allow PCI config space backup to be limited by maximum offset Signed-off-by: Michael Brown --- src/include/ipxe/pcibackup.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/include/ipxe') diff --git a/src/include/ipxe/pcibackup.h b/src/include/ipxe/pcibackup.h index 159d25392..e5249df99 100644 --- a/src/include/ipxe/pcibackup.h +++ b/src/include/ipxe/pcibackup.h @@ -11,9 +11,15 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include +/** Limit of PCI configuration space */ +#define PCI_CONFIG_BACKUP_ALL 0x100 + +/** Limit of standard PCI configuration space */ +#define PCI_CONFIG_BACKUP_STANDARD 0x40 + /** A PCI configuration space backup */ struct pci_config_backup { - uint32_t dwords[64]; + uint32_t dwords[ PCI_CONFIG_BACKUP_ALL / sizeof ( uint32_t ) ]; }; /** PCI configuration space backup exclusion list end marker */ @@ -25,9 +31,9 @@ struct pci_config_backup { extern void pci_backup ( struct pci_device *pci, struct pci_config_backup *backup, - const uint8_t *exclude ); + unsigned int limit, const uint8_t *exclude ); extern void pci_restore ( struct pci_device *pci, struct pci_config_backup *backup, - const uint8_t *exclude ); + unsigned int limit, const uint8_t *exclude ); #endif /* _IPXE_PCIBACKUP_H */ -- cgit