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 FILE_SECBOOT ( PERMITTED );
12 
13 #include <stdint.h>
14 
15 /** Limit of PCI configuration space */
16 #define PCI_CONFIG_BACKUP_ALL 0x100
17 
18 /** Limit of standard PCI configuration space */
19 #define PCI_CONFIG_BACKUP_STANDARD 0x40
20 
21 /** A PCI configuration space backup */
24 };
25 
26 /** PCI configuration space backup exclusion list end marker */
27 #define PCI_CONFIG_BACKUP_EXCLUDE_END 0xff
28 
29 /** Define a PCI configuration space backup exclusion list */
30 #define PCI_CONFIG_BACKUP_EXCLUDE(...) \
31  { __VA_ARGS__, PCI_CONFIG_BACKUP_EXCLUDE_END }
32 
33 extern void pci_backup ( struct pci_device *pci,
34  struct pci_config_backup *backup,
35  unsigned int limit, const uint8_t *exclude );
36 extern void pci_restore ( struct pci_device *pci,
37  struct pci_config_backup *backup,
38  unsigned int limit, const uint8_t *exclude );
39 
40 #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:68
uint32_t dwords[PCI_CONFIG_BACKUP_ALL/sizeof(uint32_t)]
Definition: pcibackup.h:23
#define PCI_CONFIG_BACKUP_ALL
Limit of PCI configuration space.
Definition: pcibackup.h:16
FILE_SECBOOT(PERMITTED)
uint16_t limit
Limit.
Definition: librm.h:136
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:88
A PCI device.
Definition: pci.h:211
A PCI configuration space backup.
Definition: pcibackup.h:22
unsigned char uint8_t
Definition: stdint.h:10
unsigned int uint32_t
Definition: stdint.h:12
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)