[NDK]
[reactos.git] / reactos / include / ndk / ketypes.h
index 78f5058..25f13fa 100644 (file)
@@ -158,28 +158,43 @@ Author:
 #define KF_AMDK6MTRR                    0x00008000
 #define KF_XMMI64                       0x00010000
 #define KF_DTS                          0x00020000
+#define KF_BRANCH                       0x00020000 // from ksamd64.inc
+#define KF_SSE3                         0x00080000
+#define KF_CMPXCHG16B                   0x00100000
+#define KF_XSTATE                       0x00800000 // from ks386.inc, ksamd64.inc
 #define KF_NX_BIT                       0x20000000
 #define KF_NX_DISABLED                  0x40000000
 #define KF_NX_ENABLED                   0x80000000
 
+#define KF_XSAVEOPT_BIT                 15
+#define KF_XSTATE_BIT                   23
+#define KF_RDWRFSGSBASE_BIT             28
+
 //
 // Internal Exception Codes
 //
 #define KI_EXCEPTION_INTERNAL           0x10000000
 #define KI_EXCEPTION_ACCESS_VIOLATION   (KI_EXCEPTION_INTERNAL | 0x04)
 
-typedef struct _FIBER                                      /* Field offsets:  */
-{                                                          /* 32 bit   64 bit */
-    /* this must be the first field */
-    PVOID Parameter;                                       /*   0x00     0x00 */
-    struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;  /*   0x04     0x08 */
-    PVOID StackBase;                                       /*   0x08     0x10 */
-    PVOID StackLimit;                                      /*   0x0C     0x18 */
-    PVOID DeallocationStack;                               /*   0x10     0x20 */
-    CONTEXT Context;                                       /*   0x14     0x28 */
-    ULONG GuaranteedStackBytes;                            /*   0x2E0         */
-    PVOID FlsData;                                         /*   0x2E4         */
-    struct _ACTIVATION_CONTEXT_STACK *ActivationContextStack;/*   0x2E8         */
+typedef struct _FIBER                                    /* Field offsets:    */
+{                                                        /* i386  arm   x64   */
+    PVOID FiberData;                                     /* 0x000 0x000 0x000 */
+    struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;/* 0x004 0x004 0x008 */
+    PVOID StackBase;                                     /* 0x008 0x008 0x010 */
+    PVOID StackLimit;                                    /* 0x00C 0x00C 0x018 */
+    PVOID DeallocationStack;                             /* 0x010 0x010 0x020 */
+    CONTEXT FiberContext;                                /* 0x014 0x018 0x030 */
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    PVOID Wx86Tib;                                       /* 0x2E0 0x1b8 0x500 */
+    struct _ACTIVATION_CONTEXT_STACK *ActivationContextStackPointer; /* 0x2E4 0x1bc 0x508 */
+    PVOID FlsData;                                       /* 0x2E8 0x1c0 0x510 */
+    ULONG GuaranteedStackBytes;                          /* 0x2EC 0x1c4 0x518 */
+    ULONG TebFlags;                                      /* 0x2F0 0x1c8 0x51C */
+#else
+    ULONG GuaranteedStackBytes;                          /* 0x2E0         */
+    PVOID FlsData;                                       /* 0x2E4         */
+    struct _ACTIVATION_CONTEXT_STACK *ActivationContextStackPointer;
+#endif
 } FIBER, *PFIBER;
 
 #ifndef NTOS_MODE_USER
@@ -759,16 +774,30 @@ typedef struct _KNODE
     SLIST_HEADER DeadStackList;
     SLIST_HEADER PfnDereferenceSListHead;
     KAFFINITY ProcessorMask;
-    ULONG Color;
+    UCHAR Color;
     UCHAR Seed;
     UCHAR NodeNumber;
-    ULONG Flags;
+    struct _flags {
+        UCHAR Removable : 1;
+        UCHAR Fill : 7;
+    } Flags;
     ULONG MmShiftedColor;
     ULONG FreeCount[2];
     struct _SINGLE_LIST_ENTRY *PfnDeferredList;
 } KNODE, *PKNODE;
 #include <poppack.h>
 
+//
+// Structure for Get/SetContext APC
+//
+typedef struct _GETSETCONTEXT
+{
+    KAPC Apc;
+    KEVENT Event;
+    KPROCESSOR_MODE Mode;
+    CONTEXT Context;
+} GETSETCONTEXT, *PGETSETCONTEXT;
+
 //
 // Kernel Profile Object
 //
@@ -1421,6 +1450,28 @@ typedef struct _KSERVICE_TABLE_DESCRIPTOR
     PUCHAR Number;
 } KSERVICE_TABLE_DESCRIPTOR, *PKSERVICE_TABLE_DESCRIPTOR;
 
+#if (NTDDI_VERSION >= NTDDI_WIN8)
+//
+// Entropy Timing State
+//
+typedef struct _KENTROPY_TIMING_STATE
+{
+    ULONG EntropyCount;
+    ULONG Buffer[64];
+    KDPC Dpc;
+    ULONG LastDeliveredBuffer;
+    PULONG RawDataBuffer;
+} KENTROPY_TIMING_STATE, *PKENTROPY_TIMING_STATE;
+
+//
+// Constants from ks386.inc, ksamd64.inc and ksarm.h
+//
+#define KENTROPY_TIMING_INTERRUPTS_PER_BUFFER 0x400
+#define KENTROPY_TIMING_BUFFER_MASK 0x7ff
+#define KENTROPY_TIMING_ANALYSIS 0x0
+
+#endif /* (NTDDI_VERSION >= NTDDI_WIN8) */
+
 //
 // Exported Loader Parameter Block
 //