You should enjoy powerful mdb & dtrace, which are what I want on Linux :)

bash# mdb -k
> ::log /var/your-outputs
> *pci_bus_res ::print struct pci_bus_resource mem_space | ::list struct memlist next | ::print struct memlist

And then, check the file /var/your-outputs


-minskey


Eitan Eliahu 写道:
I would like to print the PCI resources when the driver attach entry point is 
being code. Could anyone show me where is this information in the dev_info 
structure?
It seems that the PCI bus drivers does not correctly enumerate the device 
object system resources during boot time, when the driver loads it gets 
erroneous system resources in the dev_info:

ttp://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/intel/io/pci/pci_boot.c#2159

2027 base = (uint_t)memlist_find(io_res, len, len);
2028 if (base != 0) {
2029    memlist_insert(io_res_used, base, len);
2030    /* XXX need to worry about 64-bit? */
2031    pci_putl(bus, dev, func, offset,
2032        base | type);
2033    base = pci_getl(bus, dev, func, offset);
2034    base &= PCI_BASE_IO_ADDR_M;
2035 }
2036 if (base == 0) {
2037    cmn_err(CE_WARN, "failed to program"
2038        " IO space [%d/%d/%d] b...@0x%x"
2039        " length 0x%x",
2040        bus, dev, func, offset, len);

Thanks,
Eitan

_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to