iPXE
pcibackup.h
Go to the documentation of this file.
1 #ifndef _IPXE_PCIBACKUP_H
2 #define _IPXE_PCIBACKUP_H
3 
4 /** @file
5  *
6  * PCI configuration space backup and restoration
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <stdint.h>
13 
14 /** Limit of PCI configuration space */
15 #define PCI_CONFIG_BACKUP_ALL 0x100
16 
17 /** Limit of standard PCI configuration space */
18 #define PCI_CONFIG_BACKUP_STANDARD 0x40
19 
20 /** A PCI configuration space backup */
23 };
24 
25 /** PCI configuration space backup exclusion list end marker */
26 #define PCI_CONFIG_BACKUP_EXCLUDE_END 0xff
27 
28 /** Define a PCI configuration space backup exclusion list */
29 #define PCI_CONFIG_BACKUP_EXCLUDE(...) \
30  { __VA_ARGS__, PCI_CONFIG_BACKUP_EXCLUDE_END }
31 
32 extern void pci_backup ( struct pci_device *pci,
33  struct pci_config_backup *backup,
34  unsigned int limit, const uint8_t *exclude );
35 extern void pci_restore ( struct pci_device *pci,
36  struct pci_config_backup *backup,
37  unsigned int limit, const uint8_t *exclude );
38 
39 #endif /* _IPXE_PCIBACKUP_H */
void pci_backup(struct pci_device *pci, struct pci_config_backup *backup, unsigned int limit, const uint8_t *exclude)
Back up PCI configuration space.
Definition: pcibackup.c:67
uint32_t dwords[PCI_CONFIG_BACKUP_ALL/sizeof(uint32_t)]
Definition: pcibackup.h:22
#define PCI_CONFIG_BACKUP_ALL
Limit of PCI configuration space.
Definition: pcibackup.h:15
uint16_t limit
Limit.
Definition: librm.h:250
void pci_restore(struct pci_device *pci, struct pci_config_backup *backup, unsigned int limit, const uint8_t *exclude)
Restore PCI configuration space.
Definition: pcibackup.c:87
A PCI device.
Definition: pci.h:206
A PCI configuration space backup.
Definition: pcibackup.h:21
unsigned char uint8_t
Definition: stdint.h:10
unsigned int uint32_t
Definition: stdint.h:12
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)