mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 17:27:53 +00:00
hv: pci: update "union pci_bdf"
- add one more filed in "union pci_bdf" - remove following interfaces: * pci_bus * pci_slot * pci_func * pci_devfn Tracked-On: #1842 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
This commit is contained in:
committed by
ACRN System Integration
parent
b16531257e
commit
658fff27b4
@@ -141,6 +141,10 @@ union pci_bdf {
|
||||
uint8_t d : 5; /* BITs 3-7 */
|
||||
uint8_t b; /* BITs 8-15 */
|
||||
} bits;
|
||||
struct {
|
||||
uint8_t devfun; /* BITs 0-7 */
|
||||
uint8_t bus; /* BITs 8-15 */
|
||||
} fields;
|
||||
};
|
||||
|
||||
enum pci_bar_type {
|
||||
@@ -278,26 +282,6 @@ static inline uint64_t git_size_masked_bar_base(uint64_t size, uint64_t val)
|
||||
return (mask & val);
|
||||
}
|
||||
|
||||
static inline uint8_t pci_bus(uint16_t bdf)
|
||||
{
|
||||
return (uint8_t)((bdf >> 8U) & 0xFFU);
|
||||
}
|
||||
|
||||
static inline uint8_t pci_slot(uint16_t bdf)
|
||||
{
|
||||
return (uint8_t)((bdf >> 3U) & 0x1FU);
|
||||
}
|
||||
|
||||
static inline uint8_t pci_func(uint16_t bdf)
|
||||
{
|
||||
return (uint8_t)(bdf & 0x7U);
|
||||
}
|
||||
|
||||
static inline uint8_t pci_devfn(uint16_t bdf)
|
||||
{
|
||||
return (uint8_t)(bdf & 0xFFU);
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre a != NULL
|
||||
* @pre b != NULL
|
||||
|
Reference in New Issue
Block a user