libhd 5.0
Data Structures | Defines | Typedefs | Functions | Variables
pci.h File Reference
#include "v86bios.h"

Go to the source code of this file.

Data Structures

union  PciSlot
struct  pciBusRec
struct  pciStructRec

Defines

#define PCI_MODE2_ENABLE_REG   0xCF8
#define PCI_MODE2_FORWARD_REG   0xCFA
#define PCI_MODE1_ADDRESS_REG   0xCF8
#define PCI_MODE1_DATA_REG   0xCFC
#define PCI_EN   0x80000000
#define MAX_DEV_PER_VENDOR_CFG1   32
#define BRIDGE_CLASS(x)   (x == 0x06)
#define BRIDGE_PCI_CLASS(x)   (x == 0x04)
#define BRIDGE_HOST_CLASS(x)   (x == 0x00)
#define PCI_CLASS_PREHISTORIC   0x00
#define PCI_SUBCLASS_PREHISTORIC_VGA   0x01
#define PCI_CLASS_DISPLAY   0x03
#define PCI_SUBCLASS_DISPLAY_VGA   0x00
#define PCI_SUBCLASS_DISPLAY_XGA   0x01
#define PCI_SUBCLASS_DISPLAY_MISC   0x80
#define VIDEO_CLASS(b, s)
#define PCI_MULTIFUNC_DEV   0x80
#define MAX_PCI_DEVICES   64
#define PCI_MAXBUS   16
#define PCI_IS_MEM   0x00000001
#define MAX_PCI_ROM_SIZE   (1024 * 1024 * 16)
#define IS_MEM32(x)   ((x & 0x7) == 0 && x != 0)
#define IS_MEM64(x)   ((x & 0x7) == 0x4)

Typedefs

typedef struct pciBusRec PciBusRec
typedef struct pciBusRecPciBusPtr
typedef struct pciStructRec PciStructRec
typedef struct pciStructRecPciStructPtr

Functions

CARD32 findPci (CARD16 slotBX)
CARD16 pciSlotBX (PciStructPtr)
PciStructPtr findPciDevice (CARD16 vendorID, CARD16 deviceID, char n)
PciStructPtr findPciClass (CARD8 intf, CARD8 subClass, CARD16 class, char n)
CARD8 PciRead8 (int offset, CARD32 slot)
CARD16 PciRead16 (int offset, CARD32 slot)
CARD32 PciRead32 (int offset, CARD32 slot)
void PciWrite8 (int offset, CARD8 byte, CARD32 slot)
void PciWrite16 (int offset, CARD16 word, CARD32 slot)
void PciWrite32 (int offset, CARD32 lg, CARD32 slot)
void scan_pci (int)
void pciVideoDisable (void)
void pciVideoRestore (void)
void EnableCurrent (void)
int mapPciRom (PciStructPtr pciP)
int cfg1out (CARD16 addr, CARD32 val)
int cfg1in (CARD16 addr, CARD32 *val)
void list_pci (void)
PciStructPtr findPciByIDs (int bus, int dev, int func)

Variables

PciStructPtr CurrentPci
PciStructPtr PciList
PciStructPtr BootBios
int pciMaxBus

Define Documentation

#define BRIDGE_CLASS (   x)    (x == 0x06)

Referenced by interpretConfigSpace().

#define BRIDGE_HOST_CLASS (   x)    (x == 0x00)

Referenced by interpretConfigSpace().

#define BRIDGE_PCI_CLASS (   x)    (x == 0x04)

Referenced by interpretConfigSpace().

#define IS_MEM32 (   x)    ((x & 0x7) == 0 && x != 0)

Referenced by interpretConfigSpace().

#define IS_MEM64 (   x)    ((x & 0x7) == 0x4)

Referenced by interpretConfigSpace().

#define MAX_DEV_PER_VENDOR_CFG1   32

Referenced by scan_pci().

#define MAX_PCI_DEVICES   64

Referenced by scan_pci().

#define MAX_PCI_ROM_SIZE   (1024 * 1024 * 16)
#define PCI_CLASS_DISPLAY   0x03
#define PCI_CLASS_PREHISTORIC   0x00
#define PCI_EN   0x80000000
#define PCI_IS_MEM   0x00000001
#define PCI_MAXBUS   16

Referenced by scan_pci().

#define PCI_MODE1_ADDRESS_REG   0xCF8
#define PCI_MODE1_DATA_REG   0xCFC
#define PCI_MODE2_ENABLE_REG   0xCF8
#define PCI_MODE2_FORWARD_REG   0xCFA
#define PCI_MULTIFUNC_DEV   0x80

Referenced by interpretConfigSpace().

#define PCI_SUBCLASS_DISPLAY_MISC   0x80
#define PCI_SUBCLASS_DISPLAY_VGA   0x00
#define PCI_SUBCLASS_DISPLAY_XGA   0x01
#define PCI_SUBCLASS_PREHISTORIC_VGA   0x01
#define VIDEO_CLASS (   b,
 
)

Typedef Documentation

typedef struct pciBusRec * PciBusPtr
typedef struct pciBusRec PciBusRec
typedef struct pciStructRec * PciStructPtr
typedef struct pciStructRec PciStructRec

Function Documentation

int cfg1in ( CARD16  addr,
CARD32 val 
)

References PciCfg1Addr, and readPci.

int cfg1out ( CARD16  addr,
CARD32  val 
)

References PciCfg1Addr, val, and writePci.

void EnableCurrent ( void  )
CARD32 findPci ( CARD16  slotBX)
PciStructPtr findPciByIDs ( int  bus,
int  dev,
int  func 
)
PciStructPtr findPciClass ( CARD8  intf,
CARD8  subClass,
CARD16  class,
char  n 
)
PciStructPtr findPciDevice ( CARD16  vendorID,
CARD16  deviceID,
char  n 
)
void list_pci ( void  )
int mapPciRom ( PciStructPtr  pciP)
CARD16 PciRead16 ( int  offset,
CARD32  slot 
)

References readPci.

Referenced by int1A_handler().

CARD32 PciRead32 ( int  offset,
CARD32  slot 
)

References readPci.

Referenced by findBIOSMap(), int1A_handler(), mapPciRom(), and remapMem().

CARD8 PciRead8 ( int  offset,
CARD32  slot 
)

References readPci.

Referenced by int1A_handler().

CARD16 pciSlotBX ( PciStructPtr  )

References PciSlot::l, and pciStructRec::Slot.

Referenced by int1A_handler().

void pciVideoDisable ( void  )
void pciVideoRestore ( void  )
void PciWrite16 ( int  offset,
CARD16  word,
CARD32  slot 
)

References readPci, val, and writePci.

Referenced by int1A_handler().

void PciWrite32 ( int  offset,
CARD32  lg,
CARD32  slot 
)
void PciWrite8 ( int  offset,
CARD8  byte,
CARD32  slot 
)

References readPci, val, and writePci.

Referenced by int1A_handler().

void scan_pci ( int  )

Variable Documentation

Referenced by findPciByIDs().

int pciMaxBus

Referenced by int1A_handler(), and scan_pci().