Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. pcienum.h
  5. Abstract:
  6. This module contains support routines for the Pci bus enumeration.
  7. Author:
  8. Bassam Tabbara (bassamt) 05-Aug-2001
  9. Environment:
  10. Real mode
  11. --*/
  12. #define PCI_ITERATOR_TO_BUS(i) ((UCHAR)(((i) >> 8) & 0xFF))
  13. #define PCI_ITERATOR_TO_DEVICE(i) ((UCHAR)(((i) >> 3) & 0x1F))
  14. #define PCI_ITERATOR_TO_FUNCTION(i) ((UCHAR)((i) & 0x07))
  15. #define PCI_TO_ITERATOR(b,d,f) ((ULONG)(0x80000000 | ((b) << 8) | ((d) << 3) | (f)))
  16. #define PCI_ITERATOR_TO_BUSDEVFUNC(i) ((USHORT)(i & 0xFFFF))
  17. //
  18. // methods
  19. //
  20. ULONG PciReadConfig
  21. (
  22. ULONG nDevIt,
  23. ULONG cbOffset,
  24. UCHAR * pbBuffer,
  25. ULONG cbLength
  26. );
  27. ULONG PciWriteConfig
  28. (
  29. ULONG nDevIt,
  30. ULONG cbOffset,
  31. UCHAR * pbBuffer,
  32. ULONG cbLength
  33. );
  34. ULONG PciFindDevice
  35. (
  36. USHORT nVendorId, // 0 = Wildcard
  37. USHORT nDeviceId, // 0 = Wildcard
  38. ULONG nBegDevIt // 0 = begin enumeration
  39. );
  40. BOOLEAN PciInit(PCI_REGISTRY_INFO *pPCIReg);
  41. UCHAR PciBiosReadConfig
  42. (
  43. ULONG nDevIt,
  44. UCHAR cbOffset,
  45. UCHAR * pbBuffer,
  46. ULONG cbLength
  47. );
  48. ULONG PciBiosFindDevice
  49. (
  50. USHORT nVendorId, // 0 = Wildcard
  51. USHORT nDeviceId, // 0 = Wildcard
  52. ULONG nBegDevIt // 0 = begin enumeration
  53. );
  54. #ifdef DBG
  55. extern
  56. VOID
  57. ScanPCIViaBIOS(
  58. PPCI_REGISTRY_INFO pPciEntry
  59. );
  60. #endif