pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses); pr_debug("PCI: Scanning behind PCI bridge %s, config %06x, pass %d\n", pci_name(dev), buses & 0xffffff, pass); /* Disable MasterAbortMode during probing to avoid reporting of bus errors (in some architectures) */ pci_read_co...
读取msix中断表的地址,table地址位于第bir个bar的table_offset位置 pci_read_config_dword(dev, dev->msix_cap + PCI_MSIX_TABLE, &table_offset); bir = (u8)(table_offset & PCI_MSIX_TABLE_BIR); //读取bir table_offset &= PCI_MSIX_TABLE_OFFSET; //读取table偏移 phys_addr = pci_resource_start...
intpci_read_config_byte(structpci_dev*pdev,intwhere, u8*val); intpci_read_config_word(structpci_dev*pdev,intwhere, u8*val); intpci_read_config_dword(structpci_dev*pdev,intwhere, u8*val); 通过8位、16位或32位的数据传输访问配置空间。 从由pdev标识的设备空间读入一个、两个或四个字节的数...
pci_read_config_dword(dev, pos, &l); pci_write_config_dword(dev, pos, l | mask); pci_read_config_dword(dev, pos, &sz); pci_write_config_dword(dev, pos, l); 1. 2. 3. 4. (2.2) 通过decode_bar()函数判别PCIBAR空间类型* 判断是否IO空间类型。 //判断是否IO空间 if ((bar & PC...
pci_read_config_dword(dev, dev->rom_base_reg, ®); pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE); } } } } 该函数遍历整个pci设备。如果该设备的相应空间已经启用了(I/O或者内存)。那在以0为参数调用的时候就让它分配好资源。对于没有被启用的资源。要等到...
pci_read_config_dword(dev, addresses[ i],&mask); pci_write_config_dword(dev, addresses[ i],curr); sti(); if (!mask) continue; /* there may be other regions */ /* * apply the I/O or memory mask to current position. * note that I/O is limited to 0xffff, and 64-bit is ...
pci_read_config_dword(dev, dev->rom_base_reg, ); pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE); } } } } 该函数遍历整个pci设备。如果该设备的相应空间已经启用了(I/O或者内存)。那在以0为参数调用的时候就让它分配好资源。对于没有被启用的资源。要等到第二...
intpci_write_config_dword(struct pci_dev *dev,intwhere, u32 val); 上面这组读写接口实际上会调用下面这组接口,当驱动不能访问pci_dev的时候也可以直接调用下面这组接口 1 2 3 4 5 6 intpci_bus_read_config_byte(struct pci_bus *bus,unsignedintdevfn,intwhere, u8 *val); ...
pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o obj-y += $(pci-y) common.o early.o 从这个makefile中可以看出:legacy.c是一定会编译到了.而numa.c只有在编译选择了CONFIG_X86_NUMAQ的时候才起效.所以,我们可以毫不犹豫的将眼光放到了legacy.c中. ...
首先向地址端口CONFIG_ADDRESS写入如上图格式的配置双字,注意使能位必须置1,然后直接读取数据端口CONFIG_DATA的双字数据,即为对应配置空间寄存器中的数据.3.程序实现示例 以下是用汇编语言编写的访问程序:;函数功能:向Config_Address端口写入配置双字,再从Data_Address端口读取双字数据 ;输入参数:EAX=配置双字 ;输出参数:...