Merge amd64 NDK from amd64 branch:
[reactos.git] / reactos / include / ndk / amd64 / ketypes.h
index 5135a31..733996f 100644 (file)
@@ -30,7 +30,7 @@ Author:
 //
 //#define K0IPCR                  ((ULONG_PTR)(KIP0PCRADDRESS))
 //#define PCR                     ((volatile KPCR * const)K0IPCR)
-#define PCR ((volatile KPCR * const)__readgsqword(KPCR_SELF))
+#define PCR ((volatile KPCR * const)__readgsqword(FIELD_OFFSET(KPCR, Self)))
 //#if defined(CONFIG_SMP) || defined(NT_BUILD)
 //#undef  KeGetPcr
 //#define KeGetPcr()              ((volatile KPCR * const)__readfsdword(0x1C))
@@ -164,30 +164,45 @@ typedef struct _KTRAP_FRAME
     UINT64 R9;
     UINT64 R10;
     UINT64 R11;
-    UINT64 GsBase;
-    UINT64 GsSwap;
+    union
+    {
+        UINT64 GsBase;
+        UINT64 GsSwap;
+    };
     M128A Xmm0;
     M128A Xmm1;
     M128A Xmm2;
     M128A Xmm3;
     M128A Xmm4;
     M128A Xmm5;
-    UINT64 FaultAddress;
-    UINT64 ContextRecord;
-    UINT64 TimeStampCKCL;
+    union
+    {
+        UINT64 FaultAddress;
+        UINT64 ContextRecord;
+        UINT64 TimeStampCKCL;
+    };
     UINT64 Dr0;
     UINT64 Dr1;
     UINT64 Dr2;
     UINT64 Dr3;
     UINT64 Dr6;
     UINT64 Dr7;
-    UINT64 DebugControl;
-    UINT64 LastBranchToRip;
-    UINT64 LastBranchFromRip;
-    UINT64 LastExceptionToRip;
-    UINT64 LastExceptionFromRip;
-    UINT64 LastBranchControl;
-    ULONG LastBranchMSR;
+    union
+    {
+        struct
+        {
+            UINT64 DebugControl;
+            UINT64 LastBranchToRip;
+            UINT64 LastBranchFromRip;
+            UINT64 LastExceptionToRip;
+            UINT64 LastExceptionFromRip;
+        };
+        struct
+        {
+            UINT64 LastBranchControl;
+            ULONG LastBranchMSR;
+        };
+    };
     USHORT SegDs;
     USHORT SegEs;
     USHORT SegFs;
@@ -197,9 +212,12 @@ typedef struct _KTRAP_FRAME
     UINT64 Rdi;
     UINT64 Rsi;
     UINT64 Rbp;
-    UINT64 ErrorCode;
-    UINT64 ExceptionFrame;
-    UINT64 TimeStampKlog;
+    union
+    {
+        UINT64 ErrorCode;
+        UINT64 ExceptionFrame;
+        UINT64 TimeStampKlog;
+    };
     UINT64 Rip;
     USHORT SegCs;
     UCHAR Fill0;
@@ -213,6 +231,10 @@ typedef struct _KTRAP_FRAME
     LONG CodePatchCycle;
 } KTRAP_FRAME, *PKTRAP_FRAME;
 
+//
+// Dummy LDT_ENTRY
+//
+typedef ULONG LDT_ENTRY;
 
 //
 // GDT Entry Definition