iPXE
Functions
pcidirect.c File Reference

PCI configuration space access via Type 1 accesses. More...

#include <ipxe/io.h>
#include <ipxe/pci.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
void pcidirect_prepare (struct pci_device *pci, int where)
 Prepare for Type 1 PCI configuration space access. More...
 
 PROVIDE_PCIAPI_INLINE (direct, pci_num_bus)
 
 PROVIDE_PCIAPI_INLINE (direct, pci_read_config_byte)
 
 PROVIDE_PCIAPI_INLINE (direct, pci_read_config_word)
 
 PROVIDE_PCIAPI_INLINE (direct, pci_read_config_dword)
 
 PROVIDE_PCIAPI_INLINE (direct, pci_write_config_byte)
 
 PROVIDE_PCIAPI_INLINE (direct, pci_write_config_word)
 
 PROVIDE_PCIAPI_INLINE (direct, pci_write_config_dword)
 

Detailed Description

PCI configuration space access via Type 1 accesses.

Definition in file pcidirect.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ pcidirect_prepare()

void pcidirect_prepare ( struct pci_device pci,
int  where 
)

Prepare for Type 1 PCI configuration space access.

Parameters
pciPCI device
whereLocation within PCI configuration space

Definition at line 41 of file pcidirect.c.

41  {
42  uint16_t busdevfn = ( pci->busdevfn & 0xffff );
43 
44  outl ( ( 0x80000000 | ( busdevfn << 8 ) | ( where & ~3 ) ),
46 }
unsigned short uint16_t
Definition: stdint.h:11
#define outl(data, io_addr)
Definition: io.h:329
static __always_inline int unsigned int where
Definition: efi_pci_api.h:56
#define PCIDIRECT_CONFIG_ADDRESS
Definition: pcidirect.h:21
uint32_t busdevfn
Segment, bus, device, and function (bus:dev.fn) number.
Definition: pci.h:210

References pci_device::busdevfn, outl, PCIDIRECT_CONFIG_ADDRESS, and where.

◆ PROVIDE_PCIAPI_INLINE() [1/7]

PROVIDE_PCIAPI_INLINE ( direct  ,
pci_num_bus   
)

◆ PROVIDE_PCIAPI_INLINE() [2/7]

PROVIDE_PCIAPI_INLINE ( direct  ,
pci_read_config_byte   
)

◆ PROVIDE_PCIAPI_INLINE() [3/7]

PROVIDE_PCIAPI_INLINE ( direct  ,
pci_read_config_word   
)

◆ PROVIDE_PCIAPI_INLINE() [4/7]

PROVIDE_PCIAPI_INLINE ( direct  ,
pci_read_config_dword   
)

◆ PROVIDE_PCIAPI_INLINE() [5/7]

PROVIDE_PCIAPI_INLINE ( direct  ,
pci_write_config_byte   
)

◆ PROVIDE_PCIAPI_INLINE() [6/7]

PROVIDE_PCIAPI_INLINE ( direct  ,
pci_write_config_word   
)

◆ PROVIDE_PCIAPI_INLINE() [7/7]

PROVIDE_PCIAPI_INLINE ( direct  ,
pci_write_config_dword   
)