libhd
5.0
|
#include <fcntl.h>
#include <unistd.h>
#include <malloc.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include "AsmMacros.h"
#include "pci.h"
#define FIX_ROM 0 |
Referenced by mapPciRom().
#define PCI_EN 0x80000000 |
Referenced by checkSlotCfg1(), findPci(), interpretConfigSpace(), readConfigSpaceCfg1(), and scan_pci().
#define RESORT 1 |
Referenced by scan_pci().
References PciCfg1Addr, and readPci.
static int checkSlotCfg1 | ( | CARD32 | bus, |
CARD32 | dev, | ||
CARD32 | func | ||
) | [static] |
References PCI_EN, PCI_MODE1_ADDRESS_REG, and PCI_MODE1_DATA_REG.
Referenced by scan_pci().
static int checkSlotCfg2 | ( | CARD32 | bus, |
int | dev | ||
) | [static] |
References PCI_MODE2_ENABLE_REG, PCI_MODE2_FORWARD_REG, and val.
Referenced by scan_pci().
void EnableCurrent | ( | void | ) |
static CARD32 findBIOSMap | ( | PciStructPtr | pciP, |
CARD32 * | biosSize | ||
) | [static] |
References pciStructRec::bus, PciSlot::l, pciStructRec::next, PciRead32(), PciStruct, PciWrite32(), remapMem(), pciStructRec::RomBase, pciStructRec::Slot, and val.
Referenced by mapPciRom().
References PciSlot::l, pciBusRec::next, pciStructRec::next, pciStructRec::pBus, PCI_EN, PciStruct, pciBusRec::Slot, and pciStructRec::Slot.
Referenced by int1A_handler().
PciStructPtr findPciByIDs | ( | int | bus, |
int | dev, | ||
int | func | ||
) |
References pciStructRec::bus, pciStructRec::dev, pciStructRec::func, pciStructRec::next, and PciList.
PciStructPtr findPciClass | ( | CARD8 | intf, |
CARD8 | subClass, | ||
CARD16 | class, | ||
char | n | ||
) |
References pciStructRec::BaseClass, CurrentPci, pciStructRec::Interface, pciStructRec::next, and pciStructRec::SubClass.
PciStructPtr findPciDevice | ( | CARD16 | vendorID, |
CARD16 | deviceID, | ||
char | n | ||
) |
References CurrentPci, pciStructRec::DeviceID, pciStructRec::next, and pciStructRec::VendorID.
static CARD8 interpretConfigSpace | ( | CARD32 * | reg, |
int | busidx, | ||
CARD8 | dev, | ||
CARD8 | func | ||
) | [static] |
References pciStructRec::active, pciStructRec::BaseClass, pciBusRec::bctl, BRIDGE_CLASS, BRIDGE_HOST_CLASS, BRIDGE_PCI_CLASS, pciStructRec::bus, pciStructRec::cmd_st, pciStructRec::dev, device, pciStructRec::DeviceID, pciStructRec::func, interface, pciStructRec::Interface, IS_MEM32, IS_MEM64, PciSlot::l, pciBusRec::next, pciStructRec::next, PCI_EN, PCI_MULTIFUNC_DEV, PciBuses, pciMinMemReg, PciStruct, pciBusRec::primary, pciStructRec::RomBase, pciBusRec::secondary, pciBusRec::Slot, pciStructRec::Slot, pciStructRec::SubClass, vendor, pciStructRec::VendorID, and VIDEO_CLASS.
Referenced by scan_pci().
int mapPciRom | ( | PciStructPtr | pciP | ) |
References CurrentPci, findBIOSMap(), FIX_ROM, PciSlot::l, MEM_FILE, PciRead32(), PciWrite32(), restoreMem(), pciStructRec::RomBase, pciStructRec::Slot, and writePci.
References readPci.
Referenced by int1A_handler().
References readPci.
Referenced by findBIOSMap(), int1A_handler(), mapPciRom(), and remapMem().
References readPci.
Referenced by int1A_handler().
CARD16 pciSlotBX | ( | PciStructPtr | pPci | ) |
References PciSlot::l, and pciStructRec::Slot.
Referenced by int1A_handler().
void pciVideoDisable | ( | void | ) |
References pciBusRec::bctl, pciStructRec::cmd_st, PciSlot::l, pciBusRec::next, pciStructRec::next, PciBuses, PciStruct, pciStructRec::RomBase, pciBusRec::Slot, pciStructRec::Slot, and writePci.
Referenced by EnableCurrent().
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 | ||
) |
References writePci.
Referenced by findBIOSMap(), int1A_handler(), mapPciRom(), remapMem(), and restoreMem().
References readPci, val, and writePci.
Referenced by int1A_handler().
References PCI_EN, PCI_MODE1_ADDRESS_REG, and PCI_MODE1_DATA_REG.
Referenced by scan_pci().
static void readConfigSpaceCfg2 | ( | CARD32 | bus, |
int | dev, | ||
CARD32 * | reg | ||
) | [static] |
References PCI_MODE2_ENABLE_REG, and PCI_MODE2_FORWARD_REG.
Referenced by scan_pci().
static CARD32 readPciCfg1 | ( | CARD32 | reg | ) | [static] |
References PCI_MODE1_ADDRESS_REG, PCI_MODE1_DATA_REG, and val.
static CARD32 readPciCfg2 | ( | CARD32 | reg | ) | [static] |
References PCI_MODE2_ENABLE_REG, PCI_MODE2_FORWARD_REG, and val.
Referenced by scan_pci().
static int remapMem | ( | PciStructPtr | pciP, |
int | num, | ||
CARD32 | size | ||
) | [static] |
References PciSlot::l, pciStructRec::next, PciRead32(), PciStruct, PciWrite32(), pciStructRec::Slot, and val.
Referenced by findBIOSMap().
static void restoreMem | ( | PciStructPtr | pciP | ) | [static] |
References PciSlot::l, PciWrite32(), and pciStructRec::Slot.
Referenced by mapPciRom().
References pciStructRec::bus, checkSlotCfg1(), checkSlotCfg2(), interpretConfigSpace(), MAX_DEV_PER_VENDOR_CFG1, MAX_PCI_DEVICES, pciBusRec::next, pciStructRec::next, pciBusRec::pBus, pciStructRec::pBus, PCI_EN, PCI_MAXBUS, PCI_MODE1_ADDRESS_REG, PCI_MODE2_ENABLE_REG, PCI_MODE2_FORWARD_REG, PciBuses, pciMaxBus, PciStruct, pciBusRec::primary, readConfigSpaceCfg1(), readConfigSpaceCfg2(), readPci, readPciCfg2(), RESORT, pciBusRec::secondary, writePci, and writePciCfg2().
Referenced by InitInt10().
static void writePciCfg1 | ( | CARD32 | reg, |
CARD32 | val | ||
) | [static] |
References PCI_MODE1_ADDRESS_REG, and PCI_MODE1_DATA_REG.
static void writePciCfg2 | ( | CARD32 | reg, |
CARD32 | val | ||
) | [static] |
References PCI_MODE2_ENABLE_REG, and PCI_MODE2_FORWARD_REG.
Referenced by scan_pci().
PciStructPtr CurrentPci = NULL |
Referenced by EnableCurrent(), findPciClass(), findPciDevice(), InitInt10(), int1A_handler(), and mapPciRom().
int hostbridges = 1 [static] |
int numbus [static] |
Referenced by interpretConfigSpace(), pciVideoDisable(), pciVideoRestore(), and scan_pci().
CARD32 PciCfg1Addr [static] |
PciStructPtr PciList = NULL |
Referenced by findPciByIDs().
int pciMaxBus = 0 |
Referenced by int1A_handler(), and scan_pci().
unsigned long pciMinMemReg = ~0 [static] |
Referenced by interpretConfigSpace().
PciStructPtr PciStruct = NULL |
Referenced by findBIOSMap(), findPci(), interpretConfigSpace(), pciVideoDisable(), pciVideoRestore(), remapMem(), and scan_pci().
CARD32(* readPci)(CARD32 reg) = readPciCfg1 [static] |
Referenced by cfg1in(), PciRead16(), PciRead32(), PciRead8(), PciWrite16(), PciWrite8(), and scan_pci().
int remapMEM_num [static] |
CARD32 remapMEM_val [static] |
Referenced by cfg1out(), EnableCurrent(), mapPciRom(), pciVideoDisable(), pciVideoRestore(), PciWrite16(), PciWrite32(), PciWrite8(), and scan_pci().