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.

155 lines
4.3 KiB

  1. /*++
  2. Copyright (2) 2002 Microsoft Corporation
  3. Module Name:
  4. uagp35.h
  5. Abstract:
  6. This module contains definitions for the MS AGP v3 Filter Driver
  7. Author:
  8. Eric F. Nelson (enelson) June 6, 2002
  9. Revision History:
  10. --*/
  11. #ifndef __UAGP35_H__
  12. #define __UAGP35_H__
  13. #define ON 1
  14. #define OFF 0
  15. #define APERTURE_BASE 0x10
  16. #define APERTURE_BASE64_MASK 0x04
  17. //
  18. // Aperture sizes:
  19. //
  20. // bits 11 10 9 8 7 6 5 4 3 2 1 0
  21. // ----------------------------------------
  22. // 1 1 1 1 0 0 1 1 1 1 1 1 4MB
  23. // 1 1 1 1 0 0 1 1 1 1 1 0 8MB
  24. // 1 1 1 1 0 0 1 1 1 1 0 0 16MB
  25. // 1 1 1 1 0 0 1 1 1 0 0 0 32MB
  26. // 1 1 1 1 0 0 1 1 0 0 0 0 64MB
  27. // 1 1 1 1 0 0 1 0 0 0 0 0 128MB
  28. // 1 1 1 1 0 0 0 0 0 0 0 0 256MB
  29. // 1 1 1 0 0 0 0 0 0 0 0 0 512MB
  30. // 1 1 0 0 0 0 0 0 0 0 0 0 1024MB
  31. // 1 0 0 0 0 0 0 0 0 0 0 0 2048MB
  32. // 0 0 0 0 0 0 0 0 0 0 0 0 4096MB
  33. //
  34. typedef enum _AGP3_AP_SIZE {
  35. // AP_SIZE_4096MB = 0x000, // IO Resource descriptor's size is only 32-bits!
  36. AP_SIZE_2048MB = 0x800,
  37. AP_SIZE_1024MB = 0xC00,
  38. AP_SIZE_512MB = 0xE00,
  39. AP_SIZE_256MB = 0xF00,
  40. AP_SIZE_128MB = 0xF20,
  41. AP_SIZE_64MB = 0xF30,
  42. AP_SIZE_32MB = 0xF38,
  43. AP_SIZE_16MB = 0xF3C,
  44. AP_SIZE_8MB = 0xF3E,
  45. AP_SIZE_4MB = 0xF3F,
  46. } AGP3_AP_SIZE, *PAGP3_AP_SIZE;
  47. #define AP_SIZE_MASK(_x_) ((((_x_) & 0xF00) >> 2) | ((_x_) & 0x3F))
  48. #define AP_BASE_MASK(_z_) (AP_SIZE_MASK((_z_)) << 22)
  49. //
  50. // We'll probably never use 64-bit PTE support,
  51. // but we'll define the corresponding structures,
  52. // and make the code explicit when using 32-bit
  53. // format
  54. //
  55. typedef struct _GART_ENTRY_SW32 {
  56. ULONG State : 5;
  57. ULONG Reserved : 27;
  58. } GART_ENTRY_SW32, *PGART_ENTRY_SW32;
  59. //
  60. // GART Entry states are defined so that all software-only states
  61. // have the Valid bit clear.
  62. //
  63. #define GART_ENTRY_VALID 1 // 001
  64. #define GART_ENTRY_FREE 0 // 000
  65. #define GART_ENTRY_COHERENT 2 // 010
  66. #define GART_ENTRY_WC 4 // 00100
  67. #define GART_ENTRY_UC 8 // 01000
  68. #define GART_ENTRY_CC 16 // 10000
  69. #define GART_ENTRY_RESERVED_WC GART_ENTRY_WC
  70. #define GART_ENTRY_RESERVED_UC GART_ENTRY_UC
  71. #define GART_ENTRY_RESERVED_CC GART_ENTRY_CC
  72. #define GART_ENTRY_VALID_WC (GART_ENTRY_VALID)
  73. #define GART_ENTRY_VALID_UC (GART_ENTRY_VALID)
  74. #define GART_ENTRY_VALID_CC (GART_ENTRY_VALID | GART_ENTRY_COHERENT)
  75. typedef struct _GART_ENTRY_SW64 {
  76. ULONGLONG State : 5;
  77. ULONGLONG Reserved : 59;
  78. } GART_ENTRY_SW64, *PGART_ENTRY_SW64;
  79. typedef struct _GART_ENTRY_HW32 {
  80. ULONG Valid : 1;
  81. ULONG Coherent : 1;
  82. ULONG Reserved : 2;
  83. ULONG PageHigh : 8;
  84. ULONG PageLow : 20;
  85. } GART_ENTRY_HW32, *PGART_ENTRY_HW32;
  86. #define PAGE_HIGH_SHIFT 20
  87. typedef struct _GART_ENTRY_HW64 {
  88. ULONGLONG Valid : 1;
  89. ULONGLONG Coherent : 1;
  90. ULONGLONG Reserved : 2;
  91. ULONGLONG PageHigh : 8;
  92. ULONGLONG PageLow : 20;
  93. ULONGLONG PageHigh2 : 32;
  94. } GART_ENTRY_HW64, *PGART_ENTRY_HW64;
  95. typedef union _GART_PTE32 {
  96. GART_ENTRY_HW32 Hard;
  97. GART_ENTRY_SW32 Soft;
  98. ULONG AsULONG;
  99. } GART_PTE32, *PGART_PTE32;
  100. typedef union _GART_PTE64 {
  101. GART_ENTRY_HW64 Hard;
  102. GART_ENTRY_SW64 Soft;
  103. ULONGLONG AsULONGLONG;
  104. } GART_PTE64, *PGART_PTE64;
  105. //
  106. // Define the MS AGP3-specific extension
  107. //
  108. typedef struct _UAGP35_EXTENSION {
  109. PHYSICAL_ADDRESS ApertureStart;
  110. PHYSICAL_ADDRESS GartPhysical;
  111. ULONGLONG SpecialTarget;
  112. PGART_PTE32 Gart;
  113. ULONG GartLength;
  114. ULONG ApertureLength;
  115. ULONG DeviceId;
  116. ULONG CapabilityId;
  117. BOOLEAN GlobalEnable;
  118. BOOLEAN FourGBEnable;
  119. } UAGP35_EXTENSION, *PUAGP35_EXTENSION;
  120. //
  121. // These flags are passed via the registry in the special reserve section
  122. // of AGP device flags
  123. //
  124. #define AGP_FLAG_SPECIAL_NO_APERTURE_DISABLE 0x0000000000100000L
  125. #define AGP_FLAG_SPECIAL_VIA_AGP2_RATE_PATCH 0x0000000000200000L
  126. #endif // __UAGP35_H__