diff -r 0ee888c485d5 -r 5e9a8595296c Hardware/WinRing0.cs --- a/Hardware/WinRing0.cs Tue Sep 21 20:32:36 2010 +0000 +++ b/Hardware/WinRing0.cs Wed Sep 22 19:12:12 2010 +0000 @@ -87,8 +87,6 @@ UIntPtr threadAffinityMask); public delegate byte ReadIoPortByteDelegate(ushort port); public delegate void WriteIoPortByteDelegate(ushort port, byte value); - public delegate uint FindPciDeviceByIdDelegate(ushort vendorId, - ushort deviceId, byte index); public delegate bool ReadPciConfigDwordExDelegate(uint pciAddress, uint regAddress, out uint value); public delegate bool WritePciConfigDwordExDelegate(uint pciAddress, @@ -114,8 +112,6 @@ CreateDelegate("ReadIoPortByte"); public static readonly WriteIoPortByteDelegate WriteIoPortByte = CreateDelegate("WriteIoPortByte"); - public static readonly FindPciDeviceByIdDelegate FindPciDeviceById = - CreateDelegate("FindPciDeviceById"); public static readonly ReadPciConfigDwordExDelegate ReadPciConfigDwordEx = CreateDelegate("ReadPciConfigDwordEx"); public static readonly WritePciConfigDwordExDelegate WritePciConfigDwordEx = @@ -164,6 +160,13 @@ public static void ReleaseIsaBusMutex() { isaBusMutex.ReleaseMutex(); - } + } + + public const uint InvalidPciAddress = 0xFFFFFFFF; + + public static uint GetPciAddress(byte bus, byte device, byte function) { + return + (uint)(((bus & 0xFF) << 8) | ((device & 0x1F) << 3) | (function & 7)); + } } }