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.

107 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. msi.h
  5. Abstract:
  6. This file defines structures and data types used by the
  7. MSI (Message Signalled Interrupt) support
  8. functionality of the ACPI IRQ arbiter.
  9. Author:
  10. Elliot Shmukler (t-ellios) 7-15-98
  11. Environment:
  12. Kernel mode only.
  13. Revision History:
  14. --*/
  15. #ifndef _ACPI_MSI_H_
  16. #define _ACPI_MSI_H_
  17. //
  18. // APIC Version Register
  19. //
  20. struct _ApicVersion {
  21. UCHAR Version; // either 0.x or 1.x
  22. UCHAR Reserved1:7;
  23. UCHAR MSICapable:1; // is this APIC an MSI receiver?
  24. UCHAR MaxRedirEntries; // Number of INTIs on unit
  25. UCHAR Reserved2;
  26. };
  27. typedef struct _ApicVersion APIC_VERSION, *PAPIC_VERSION;
  28. //
  29. // The Offset from the IO APIC base address of the APIC Assertion Register.
  30. // It is this register that is the target of MSI writes.
  31. //
  32. #define APIC_ASSERTION_REGISTER_OFFSET 0x20
  33. //
  34. // Useful info maintained by the arbiter about an individual IO APIC
  35. //
  36. typedef struct _IOAPIC_MSI_INFO
  37. {
  38. BOOLEAN MSICapable; // Is this IO APIC an MSI receiver?
  39. ULONG VectorBase; // The Global System Interrupt Vector base for this APIC
  40. ULONG MaxVectors; // The number of vectors supported by this APIC
  41. ULONG BaseAddress; // The IO APIC Unit base address
  42. } IOAPIC_MSI_INFO, *PIOAPIC_MSI_INFO;
  43. //
  44. // MSI information structure
  45. // (basically the APIC information needed for MSI vector allocation
  46. // & routing)
  47. //
  48. typedef struct _MSI_INFORMATION
  49. {
  50. BOOLEAN PRTMappingsScanned; // Have we determined the _PRT mapped vectors?
  51. PRTL_BITMAP PRTMappedVectors; // A BitMap of the vectors mapped by the _PRT
  52. USHORT NumIOApics; // The number of IO APICs in this system
  53. IOAPIC_MSI_INFO ApicInfo[ANYSIZE_ARRAY]; // Information about each IO APIC in the system
  54. } MSI_INFORMATION, *PMSI_INFORMATION;
  55. //
  56. // Global variable to hold MSI information
  57. // (this is non-NULL only if this system supports MSI)
  58. //
  59. extern PMSI_INFORMATION MsiInformation;
  60. //
  61. // Prototype of a callback used by AcpiArbFindAndProcessEachPRT to initiate the processing
  62. // of each PRT it finds
  63. //
  64. typedef
  65. VOID
  66. (*PACPI_ARB_PROCESS_PRT)(IN PSNOBJ);
  67. // Prototypes from msi.c (used by arbiter)
  68. VOID AcpiMSIInitializeInfo(VOID);
  69. BOOLEAN AcpiMSIFindAvailableVector(OUT PULONG Vector);
  70. BOOLEAN AcpiMSICreateRoutingToken(IN ULONG Vector, IN OUT PROUTING_TOKEN Token);
  71. VOID AcpiArbFindAndProcessEachPRT(IN PDEVICE_OBJECT Root,
  72. IN PACPI_ARB_PROCESS_PRT ProcessCallback
  73. );
  74. VOID AcpiMSIExtractMappedVectorsFromPRT(IN PNSOBJ prtObj);
  75. #endif