IntelSiliconPkg: Fix VS2015 NOOPT IA32 build failure in IntelVTdDxe
[mirror_edk2.git] / IntelSiliconPkg / Include / IndustryStandard / Vtd.h
index 5c6a494eae34fc60fbf57b7c7748dafef099a516..3b7012c5a576c442876d114c5291f1e96d509576 100644 (file)
 \r
 typedef union {\r
   struct {\r
-    UINT64  Present:1;\r
-    UINT64  Reserved_1:11;\r
-    UINT64  ContextTablePointer:52;\r
+    UINT32  Present:1;\r
+    UINT32  Reserved_1:11;\r
+    UINT32  ContextTablePointerLo:20;\r
+    UINT32  ContextTablePointerHi:32;\r
 \r
     UINT64  Reserved_64;\r
   } Bits;\r
@@ -40,13 +41,15 @@ typedef union {
 \r
 typedef union {\r
   struct {\r
-    UINT64  LowerPresent:1;\r
-    UINT64  Reserved_1:11;\r
-    UINT64  LowerContextTablePointer:52;\r
-\r
-    UINT64  UpperPresent:1;\r
-    UINT64  Reserved_65:11;\r
-    UINT64  UpperContextTablePointer:52;\r
+    UINT32  LowerPresent:1;\r
+    UINT32  Reserved_1:11;\r
+    UINT32  LowerContextTablePointerLo:20;\r
+    UINT32  LowerContextTablePointerHi:32;\r
+\r
+    UINT32  UpperPresent:1;\r
+    UINT32  Reserved_65:11;\r
+    UINT32  UpperContextTablePointerLo:20;\r
+    UINT32  UpperContextTablePointerHi:32;\r
   } Bits;\r
   struct {\r
     UINT64  Uint64Lo;\r
@@ -56,17 +59,19 @@ typedef union {
 \r
 typedef union {\r
   struct {\r
-    UINT64  Present:1;\r
-    UINT64  FaultProcessingDisable:1;\r
-    UINT64  TranslationType:2;\r
-    UINT64  Reserved_4:8;\r
-    UINT64  SecondLevelPageTranslationPointer:52;\r
-\r
-    UINT64  AddressWidth:3;\r
-    UINT64  Ignored_67:4;\r
-    UINT64  Reserved_71:1;\r
-    UINT64  DomainIdentifier:16;\r
-    UINT64  Reserved_88:40;\r
+    UINT32  Present:1;\r
+    UINT32  FaultProcessingDisable:1;\r
+    UINT32  TranslationType:2;\r
+    UINT32  Reserved_4:8;\r
+    UINT32  SecondLevelPageTranslationPointerLo:20;\r
+    UINT32  SecondLevelPageTranslationPointerHi:32;\r
+\r
+    UINT32  AddressWidth:3;\r
+    UINT32  Ignored_67:4;\r
+    UINT32  Reserved_71:1;\r
+    UINT32  DomainIdentifier:16;\r
+    UINT32  Reserved_88:8;\r
+    UINT32  Reserved_96:32;\r
   } Bits;\r
   struct {\r
     UINT64  Uint64Lo;\r
@@ -76,51 +81,54 @@ typedef union {
 \r
 typedef union {\r
   struct {\r
-    UINT64  Present:1;\r
-    UINT64  FaultProcessingDisable:1;\r
-    UINT64  TranslationType:3;\r
-    UINT64  ExtendedMemoryType:3;\r
-    UINT64  DeferredInvalidateEnable:1;\r
-    UINT64  PageRequestEnable:1;\r
-    UINT64  NestedTranslationEnable:1;\r
-    UINT64  PASIDEnable:1;\r
-    UINT64  SecondLevelPageTranslationPointer:52;\r
-\r
-    UINT64  AddressWidth:3;\r
-    UINT64  PageGlobalEnable:1;\r
-    UINT64  NoExecuteEnable:1;\r
-    UINT64  WriteProtectEnable:1;\r
-    UINT64  CacheDisable:1;\r
-    UINT64  ExtendedMemoryTypeEnable:1;\r
-    UINT64  DomainIdentifier:16;\r
-    UINT64  SupervisorModeExecuteProtection:1;\r
-    UINT64  ExtendedAccessedFlagEnable:1;\r
-    UINT64  ExecuteRequestsEnable:1;\r
-    UINT64  SecondLevelExecuteEnable:1;\r
-    UINT64  Reserved_92:4;\r
-    UINT64  PageAttributeTable0:3;\r
-    UINT64  Reserved_Pat0:1;\r
-    UINT64  PageAttributeTable1:3;\r
-    UINT64  Reserved_Pat1:1;\r
-    UINT64  PageAttributeTable2:3;\r
-    UINT64  Reserved_Pat2:1;\r
-    UINT64  PageAttributeTable3:3;\r
-    UINT64  Reserved_Pat3:1;\r
-    UINT64  PageAttributeTable4:3;\r
-    UINT64  Reserved_Pat4:1;\r
-    UINT64  PageAttributeTable5:3;\r
-    UINT64  Reserved_Pat5:1;\r
-    UINT64  PageAttributeTable6:3;\r
-    UINT64  Reserved_Pat6:1;\r
-    UINT64  PageAttributeTable7:3;\r
-    UINT64  Reserved_Pat7:1;\r
-\r
-    UINT64  PASIDTableSize:4;\r
-    UINT64  Reserved_132:8;\r
-    UINT64  PASIDTablePointer:52;\r
-\r
-    UINT64  Reserved_192:12;\r
-    UINT64  PASIDStateTablePointer:52;\r
+    UINT32  Present:1;\r
+    UINT32  FaultProcessingDisable:1;\r
+    UINT32  TranslationType:3;\r
+    UINT32  ExtendedMemoryType:3;\r
+    UINT32  DeferredInvalidateEnable:1;\r
+    UINT32  PageRequestEnable:1;\r
+    UINT32  NestedTranslationEnable:1;\r
+    UINT32  PASIDEnable:1;\r
+    UINT32  SecondLevelPageTranslationPointerLo:20;\r
+    UINT32  SecondLevelPageTranslationPointerHi:32;\r
+\r
+    UINT32  AddressWidth:3;\r
+    UINT32  PageGlobalEnable:1;\r
+    UINT32  NoExecuteEnable:1;\r
+    UINT32  WriteProtectEnable:1;\r
+    UINT32  CacheDisable:1;\r
+    UINT32  ExtendedMemoryTypeEnable:1;\r
+    UINT32  DomainIdentifier:16;\r
+    UINT32  SupervisorModeExecuteProtection:1;\r
+    UINT32  ExtendedAccessedFlagEnable:1;\r
+    UINT32  ExecuteRequestsEnable:1;\r
+    UINT32  SecondLevelExecuteEnable:1;\r
+    UINT32  Reserved_92:4;\r
+    UINT32  PageAttributeTable0:3;\r
+    UINT32  Reserved_Pat0:1;\r
+    UINT32  PageAttributeTable1:3;\r
+    UINT32  Reserved_Pat1:1;\r
+    UINT32  PageAttributeTable2:3;\r
+    UINT32  Reserved_Pat2:1;\r
+    UINT32  PageAttributeTable3:3;\r
+    UINT32  Reserved_Pat3:1;\r
+    UINT32  PageAttributeTable4:3;\r
+    UINT32  Reserved_Pat4:1;\r
+    UINT32  PageAttributeTable5:3;\r
+    UINT32  Reserved_Pat5:1;\r
+    UINT32  PageAttributeTable6:3;\r
+    UINT32  Reserved_Pat6:1;\r
+    UINT32  PageAttributeTable7:3;\r
+    UINT32  Reserved_Pat7:1;\r
+\r
+    UINT32  PASIDTableSize:4;\r
+    UINT32  Reserved_132:8;\r
+    UINT32  PASIDTablePointerLo:20;\r
+    UINT32  PASIDTablePointerHi:32;\r
+\r
+    UINT32  Reserved_192:12;\r
+    UINT32  PASIDStateTablePointerLo:20;\r
+    UINT32  PASIDStateTablePointerHi:32;\r
   } Bits;\r
   struct {\r
     UINT64  Uint64_1;\r
@@ -132,63 +140,66 @@ typedef union {
 \r
 typedef union {\r
   struct {\r
-    UINT64  Present:1;\r
-    UINT64  Reserved_1:2;\r
-    UINT64  PageLevelCacheDisable:1;\r
-    UINT64  PageLevelWriteThrough:1;\r
-    UINT64  Reserved_5:6;\r
-    UINT64  SupervisorRequestsEnable:1;\r
-    UINT64  FirstLevelPageTranslationPointer:52;\r
+    UINT32  Present:1;\r
+    UINT32  Reserved_1:2;\r
+    UINT32  PageLevelCacheDisable:1;\r
+    UINT32  PageLevelWriteThrough:1;\r
+    UINT32  Reserved_5:6;\r
+    UINT32  SupervisorRequestsEnable:1;\r
+    UINT32  FirstLevelPageTranslationPointerLo:20;\r
+    UINT32  FirstLevelPageTranslationPointerHi:32;\r
   } Bits;\r
   UINT64    Uint64;\r
 } VTD_PASID_ENTRY;\r
 \r
 typedef union {\r
   struct {\r
-    UINT64  Reserved_0:32;\r
-    UINT64  ActiveReferenceCount:16;\r
-    UINT64  Reserved_48:15;\r
-    UINT64  DeferredInvalidate:1;\r
+    UINT32  Reserved_0:32;\r
+    UINT32  ActiveReferenceCount:16;\r
+    UINT32  Reserved_48:15;\r
+    UINT32  DeferredInvalidate:1;\r
   } Bits;\r
   UINT64    Uint64;\r
 } VTD_PASID_STATE_ENTRY;\r
 \r
 typedef union {\r
   struct {\r
-    UINT64  Present:1;\r
-    UINT64  ReadWrite:1;\r
-    UINT64  UserSupervisor:1;\r
-    UINT64  PageLevelWriteThrough:1;\r
-    UINT64  PageLevelCacheDisable:1;\r
-    UINT64  Accessed:1;\r
-    UINT64  Dirty:1;\r
-    UINT64  PageSize:1; // It is PageAttribute:1 for 4K page entry\r
-    UINT64  Global:1;\r
-    UINT64  Ignored_9:1;\r
-    UINT64  ExtendedAccessed:1;\r
-    UINT64  Ignored_11:1;\r
+    UINT32  Present:1;\r
+    UINT32  ReadWrite:1;\r
+    UINT32  UserSupervisor:1;\r
+    UINT32  PageLevelWriteThrough:1;\r
+    UINT32  PageLevelCacheDisable:1;\r
+    UINT32  Accessed:1;\r
+    UINT32  Dirty:1;\r
+    UINT32  PageSize:1; // It is PageAttribute:1 for 4K page entry\r
+    UINT32  Global:1;\r
+    UINT32  Ignored_9:1;\r
+    UINT32  ExtendedAccessed:1;\r
+    UINT32  Ignored_11:1;\r
     // NOTE: There is PageAttribute:1 as bit12 for 1G page entry and 2M page entry\r
-    UINT64  Address:40;\r
-    UINT64  Ignored_52:11;\r
-    UINT64  ExecuteDisable:1;\r
+    UINT32  AddressLo:20;\r
+    UINT32  AddressHi:20;\r
+    UINT32  Ignored_52:11;\r
+    UINT32  ExecuteDisable:1;\r
   } Bits;\r
   UINT64    Uint64;\r
 } VTD_FIRST_LEVEL_PAGING_ENTRY;\r
 \r
 typedef union {\r
   struct {\r
-    UINT64  Read:1;\r
-    UINT64  Write:1;\r
-    UINT64  Execute:1;\r
-    UINT64  ExtendedMemoryType:3;\r
-    UINT64  IgnorePAT:1;\r
-    UINT64  PageSize:1;\r
-    UINT64  Ignored_8:3;\r
-    UINT64  Snoop:1;\r
-    UINT64  Address:40;\r
-    UINT64  Ignored_52:10;\r
-    UINT64  TransientMapping:1;\r
-    UINT64  Ignored_63:1;\r
+    UINT32  Read:1;\r
+    UINT32  Write:1;\r
+    UINT32  Execute:1;\r
+    UINT32  ExtendedMemoryType:3;\r
+    UINT32  IgnorePAT:1;\r
+    UINT32  PageSize:1;\r
+    UINT32  Ignored_8:3;\r
+    UINT32  Snoop:1;\r
+    UINT32  AddressLo:20;\r
+    UINT32  AddressHi:20;\r
+    UINT32  Ignored_52:10;\r
+    UINT32  TransientMapping:1;\r
+    UINT32  Ignored_63:1;\r
   } Bits;\r
   UINT64    Uint64;\r
 } VTD_SECOND_LEVEL_PAGING_ENTRY;\r
@@ -299,7 +310,6 @@ typedef union {
     UINT32        NWFS:1; // No Write Flag Support\r
     UINT32        EAFS:1; // Extended Accessed Flag Support\r
     UINT32        PSS:5; // PASID Size Supported\r
-\r
     UINT32        Rsvd_40:24;\r
   } Bits;\r
   UINT64     Uint64;\r
@@ -307,8 +317,9 @@ typedef union {
 \r
 typedef union {\r
   struct {\r
-    UINT64   Rsvd_0:12;\r
-    UINT64   FI:52;        // FaultInfo\r
+    UINT32   Rsvd_0:12;\r
+    UINT32   FILo:20;      // FaultInfo\r
+    UINT32   FIHi:32;      // FaultInfo\r
 \r
     UINT32   SID:16;       // Source Identifier\r
     UINT32   Rsvd_80:13;\r