iPXE
Macros | Functions
pci_io.h File Reference

PCI I/O API. More...

#include <stdint.h>
#include <ipxe/api.h>
#include <config/ioapi.h>
#include <ipxe/efi/efi_pci_api.h>
#include <ipxe/linux/linux_pci.h>
#include <bits/pci_io.h>

Go to the source code of this file.

Macros

#define PCIAPI_INLINE(_subsys, _api_func)   SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func )
 Calculate static inline PCI I/O API function name. More...
 
#define PROVIDE_PCIAPI(_subsys, _api_func, _func)   PROVIDE_SINGLE_API ( PCIAPI_PREFIX_ ## _subsys, _api_func, _func )
 Provide a PCI I/O API implementation. More...
 
#define PROVIDE_PCIAPI_INLINE(_subsys, _api_func)   PROVIDE_SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func )
 Provide a static inline PCI I/O API implementation. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
int pci_num_bus (void)
 Determine number of PCI buses within system. More...
 
int pci_read_config_byte (struct pci_device *pci, unsigned int where, uint8_t *value)
 Read byte from PCI configuration space. More...
 
int pci_read_config_word (struct pci_device *pci, unsigned int where, uint16_t *value)
 Read 16-bit word from PCI configuration space. More...
 
int pci_read_config_dword (struct pci_device *pci, unsigned int where, uint32_t *value)
 Read 32-bit dword from PCI configuration space. More...
 
int pci_write_config_byte (struct pci_device *pci, unsigned int where, uint8_t value)
 Write byte to PCI configuration space. More...
 
int pci_write_config_word (struct pci_device *pci, unsigned int where, uint16_t value)
 Write 16-bit word to PCI configuration space. More...
 
int pci_write_config_dword (struct pci_device *pci, unsigned int where, uint32_t value)
 Write 32-bit dword to PCI configuration space. More...
 

Detailed Description

PCI I/O API.

Definition in file pci_io.h.

Macro Definition Documentation

◆ PCIAPI_INLINE

#define PCIAPI_INLINE (   _subsys,
  _api_func 
)    SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func )

Calculate static inline PCI I/O API function name.

Parameters
_prefixSubsystem prefix
_api_funcAPI function
Return values
_subsys_funcSubsystem API function

Definition at line 23 of file pci_io.h.

◆ PROVIDE_PCIAPI

#define PROVIDE_PCIAPI (   _subsys,
  _api_func,
  _func 
)    PROVIDE_SINGLE_API ( PCIAPI_PREFIX_ ## _subsys, _api_func, _func )

Provide a PCI I/O API implementation.

Parameters
_prefixSubsystem prefix
_api_funcAPI function
_funcImplementing function

Definition at line 33 of file pci_io.h.

◆ PROVIDE_PCIAPI_INLINE

#define PROVIDE_PCIAPI_INLINE (   _subsys,
  _api_func 
)    PROVIDE_SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func )

Provide a static inline PCI I/O API implementation.

Parameters
_prefixSubsystem prefix
_api_funcAPI function

Definition at line 42 of file pci_io.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ pci_num_bus()

int pci_num_bus ( void  )

Determine number of PCI buses within system.

Return values
num_busNumber of buses

Referenced by pci_find_next().

◆ pci_read_config_byte()

int pci_read_config_byte ( struct pci_device pci,
unsigned int  where,
uint8_t value 
)

◆ pci_read_config_word()

int pci_read_config_word ( struct pci_device pci,
unsigned int  where,
uint16_t value 
)

◆ pci_read_config_dword()

int pci_read_config_dword ( struct pci_device pci,
unsigned int  where,
uint32_t value 
)

◆ pci_write_config_byte()

int pci_write_config_byte ( struct pci_device pci,
unsigned int  where,
uint8_t  value 
)

◆ pci_write_config_word()

int pci_write_config_word ( struct pci_device pci,
unsigned int  where,
uint16_t  value 
)

◆ pci_write_config_dword()

int pci_write_config_dword ( struct pci_device pci,
unsigned int  where,
uint32_t  value 
)