RTEMS 6.1-rc5
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
cfg.h File Reference

PCI Configuration Library. More...

#include <pci.h>
#include <pci/cfg_auto.h>
#include <pci/cfg_static.h>
#include <pci/cfg_read.h>
#include <pci/cfg_peripheral.h>

Go to the source code of this file.

Data Structures

struct  pci_res
 
struct  pci_dev
 
struct  pci_bus
 

Macros

#define SEARCH_CHILDREN   0 /* direct children of bus only */
 
#define SEARCH_DEPTH   1 /* all children of bus */
 
#define PCI_RES_IO   1
 
#define PCI_RES_MEMIO   2
 
#define PCI_RES_MEM_PREFETCH   1
 
#define PCI_RES_MEM   (PCI_RES_MEMIO | PCI_RES_MEM_PREFETCH)
 
#define PCI_RES_TYPE_MASK   0x3
 
#define PCI_RES_IO32   0x08
 
#define PCI_RES_FAIL   0x10 /* Alloc Failed */
 
#define RES2DEV(res)
 
#define PCI_DEV_BRIDGE   0x01 /* Device is a Bridge (struct pci_bus) */
 
#define PCI_DEV_RES_FAIL   0x02 /* Resource alloction for device BARs failed */
 
#define PCI_BUS_IO   0x01 /* 16-bit I/O address decoding */
 
#define PCI_BUS_MEMIO   0x02 /* Bus support non-prefetchable mem (always) */
 
#define PCI_BUS_MEM   0x04 /* Bus support prefetchable memory space */
 
#define PCI_BUS_IO32   0x08 /* 32-bit I/O address decoding */
 
#define BRIDGE_RES_COUNT   2 /* Number of BAR resources a bridge can have */
 
#define BUS_RES_START   BRIDGE_RES_COUNT
 
#define DEV_RES_CNT   (DEV_RES_ROM + 1)
 

Enumerations

enum  {
  PCI_CONFIG_LIB_NONE = 0 , PCI_CONFIG_LIB_AUTO = 1 , PCI_CONFIG_LIB_STATIC = 2 , PCI_CONFIG_LIB_READ = 3 ,
  PCI_CONFIG_LIB_PERIPHERAL = 4
}
 
enum  { BUS_RES_IO = 0 , BUS_RES_MEMIO = 1 , BUS_RES_MEM = 2 }
 
enum  {
  DEV_RES_BAR1 = 0 , DEV_RES_BAR2 = 1 , DEV_RES_BAR3 = 2 , DEV_RES_BAR4 = 3 ,
  DEV_RES_BAR5 = 4 , DEV_RES_BAR6 = 5 , DEV_RES_ROM = 6 , BRIDGE_RES_BAR1 = 0 ,
  BRIDGE_RES_BAR2 = 1 , BRIDGE_RES_IO = 2 , BRIDGE_RES_MEMIO = 3 , BRIDGE_RES_MEM = 4 ,
  BRIDGE_RES_UNUSED1 = 5 , BRIDGE_RES_ROM = 6
}
 

Functions

int pci_bus_count (void)
 
int pci_config_init (void)
 
void pci_config_register (void *config)
 
void pci_cfg_print (void)
 
int pci_for_each_child (struct pci_bus *bus, int(*func)(struct pci_dev *, void *arg), void *arg, int search)
 
int pci_for_each_dev (int(*func)(struct pci_dev *, void *arg), void *arg)
 
int pci_find_dev (uint16_t ven, uint16_t dev, int index, struct pci_dev **ppdev)
 
int pci_get_dev (pci_dev_t pcidev, struct pci_dev **ppdev)
 

Variables

uint32_t pci_invalid_address
 
const int pci_config_lib_type
 
int(* pci_config_lib_init )(void)
 
void(* pci_config_lib_register )(void *config)
 
struct pci_bus pci_hb
 

Detailed Description

PCI Configuration Library.

Macro Definition Documentation

◆ RES2DEV

#define RES2DEV (   res)
Value:
((struct pci_dev *) \
((uintptr_t)res - (uintptr_t)(res->bar * (sizeof(struct pci_res)))))
Definition: pci.h:41
Definition: cfg.h:168