- Fix compile issues caused by previous patch.
authorAlex Ionescu <aionescu@gmail.com>
Sun, 27 Nov 2005 19:21:19 +0000 (19:21 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Sun, 27 Nov 2005 19:21:19 +0000 (19:21 +0000)
- Fix KPROFILE definition.
- Protect ReactOS-only members of EPROCESS, OBJECT_HEADER, W32_CALLOUT_DATA.
- Protect MADDRESS_SPACE for ReactOS only.

svn path=/trunk/; revision=19694

15 files changed:
reactos/include/ndk/asm.h
reactos/include/ndk/fixmes.txt
reactos/include/ndk/ketypes.h
reactos/include/ndk/mmtypes.h
reactos/include/ndk/obtypes.h
reactos/include/ndk/pstypes.h
reactos/ntoskrnl/ke/i386/exp.c
reactos/ntoskrnl/ke/i386/fpu.c
reactos/ntoskrnl/ke/i386/irq.c
reactos/ntoskrnl/ke/i386/thread.c
reactos/ntoskrnl/ke/i386/tss.c
reactos/ntoskrnl/ke/i386/usertrap.c
reactos/ntoskrnl/ke/i386/v86m.c
reactos/ntoskrnl/ke/profile.c
reactos/ntoskrnl/mm/i386/pfault.c

index 9465873..2f34530 100644 (file)
@@ -64,6 +64,7 @@ Author:
 #define KTSS_CR3                                0x1C
 #define KTSS_EFLAGS                             0x24
 #define KTSS_IOMAPBASE                          0x66
 #define KTSS_CR3                                0x1C
 #define KTSS_EFLAGS                             0x24
 #define KTSS_IOMAPBASE                          0x66
+#define KTSS_IO_MAPS                            0x68
 
 //
 // KTHREAD Offsets
 
 //
 // KTHREAD Offsets
index a419982..b3a07e0 100644 (file)
@@ -2,13 +2,7 @@ Complete list of NDK Fixmes before 1.0 Release (Nov 27th 2005)
 --------------------------------------------------------------\r
 ______________________________________________________________________________________\r
 [CRITICAL]     - Breaking compatibility with official structures.\r
 --------------------------------------------------------------\r
 ______________________________________________________________________________________\r
 [CRITICAL]     - Breaking compatibility with official structures.\r
-|pstypes.h     - EPROCESS has ReactOS only fields. Includes ReactOS Internal header. IFDEF_OUT\r
-|pstypes.h     - W32_CALLOUT_DATA has ReactOS only fields.              IFDEF-OUT\r
 |obtypes.h     - Object callbacks are ReactOS only definitions.         IFDEF-OUT ADDREAL\r
 |obtypes.h     - Object callbacks are ReactOS only definitions.         IFDEF-OUT ADDREAL\r
-|obtypes.h     - Object Header includes ReactOS only type.              IFDEF-OUT\r
-|mmtypes.h     - _MADDRESS_SPACE is ReactOS only field.                 IFDEF-OUT\r
-|ketypes.h     - _KPROFILE needs to be updated with new definitions.    FIXFIX\r
-|ketypes.h     - _KINTERRUPT needs to be verified with new definitions. FIXFIX\r
 |haltypes.h    - Loader Parameter Block is ReactOS Version, not NT.     IFDEF-OUT ADDREAL\r
 |\r
 [MAJOR]                - Using incorrect, missing, or invalid names or definitions.\r
 |haltypes.h    - Loader Parameter Block is ReactOS Version, not NT.     IFDEF-OUT ADDREAL\r
 |\r
 [MAJOR]                - Using incorrect, missing, or invalid names or definitions.\r
index aad9d30..504ea13 100644 (file)
@@ -350,7 +350,7 @@ typedef struct _CONFIGURATION_COMPONENT_DATA
 } CONFIGURATION_COMPONENT_DATA, *PCONFIGURATION_COMPONENT_DATA;
 
 //
 } CONFIGURATION_COMPONENT_DATA, *PCONFIGURATION_COMPONENT_DATA;
 
 //
-// Kernel Memory Node (FIXME: mmtypes?
+// Kernel Memory Node
 //
 typedef struct _KNODE
 {
 //
 typedef struct _KNODE
 {
@@ -367,25 +367,26 @@ typedef struct _KNODE
 } KNODE, *PKNODE;
 
 //
 } KNODE, *PKNODE;
 
 //
-// Kernel Profile Object (FIXME: Fix with new defs)
+// Kernel Profile Object
 //
 typedef struct _KPROFILE
 {
     CSHORT Type;
     CSHORT Size;
 //
 typedef struct _KPROFILE
 {
     CSHORT Type;
     CSHORT Size;
-    LIST_ENTRY ListEntry;
-    PVOID RegionStart;
-    PVOID RegionEnd;
+    LIST_ENTRY ProfileListEntry;
+    PKPROCESS Process;
+    PVOID RangeBase;
+    PVOID RangeLimit;
     ULONG BucketShift;
     PVOID Buffer;
     ULONG BucketShift;
     PVOID Buffer;
+    ULONG Segment;
+    KAFFINITY Affinity;
     KPROFILE_SOURCE Source;
     KPROFILE_SOURCE Source;
-    ULONG Affinity;
-    BOOLEAN Active;
-    struct _KPROCESS *Process;
+    BOOLEAN Started;
 } KPROFILE, *PKPROFILE;
 
 //
 } KPROFILE, *PKPROFILE;
 
 //
-// Kernel Interrupt Object (FIXME: Verify)
+// Kernel Interrupt Object
 //
 typedef struct _KINTERRUPT
 {
 //
 typedef struct _KINTERRUPT
 {
index 9994de4..11889db 100644 (file)
@@ -202,6 +202,7 @@ typedef struct _SECTION_IMAGE_INFORMATION
 //
 // FIXME: REACTOS SPECIFIC HACK IN EPROCESS
 //
 //
 // FIXME: REACTOS SPECIFIC HACK IN EPROCESS
 //
+#ifdef _REACTOS_
 typedef struct _MADDRESS_SPACE
 {
     struct _MEMORY_AREA *MemoryAreaRoot;
 typedef struct _MADDRESS_SPACE
 {
     struct _MEMORY_AREA *MemoryAreaRoot;
@@ -211,6 +212,7 @@ typedef struct _MADDRESS_SPACE
     PUSHORT PageTableRefCountTable;
     ULONG PageTableRefCountTableSize;
 } MADDRESS_SPACE, *PMADDRESS_SPACE;
     PUSHORT PageTableRefCountTable;
     ULONG PageTableRefCountTableSize;
 } MADDRESS_SPACE, *PMADDRESS_SPACE;
+#endif
 
 //
 // Generic Address Range Structure
 
 //
 // Generic Address Range Structure
index 586d12b..6219d59 100644 (file)
@@ -341,11 +341,13 @@ typedef struct _OBJECT_HEADER_CREATOR_INFO
 } OBJECT_HEADER_CREATOR_INFO, *POBJECT_HEADER_CREATOR_INFO;
 
 //
 } OBJECT_HEADER_CREATOR_INFO, *POBJECT_HEADER_CREATOR_INFO;
 
 //
-// FIXME: Object Header
+// Object Header
 //
 typedef struct _OBJECT_HEADER
 {
 //
 typedef struct _OBJECT_HEADER
 {
-    LIST_ENTRY Entry;
+#ifdef _REACTOS_
+    LIST_ENTRY Entry; // FIXME: REACTOS ONLY
+#endif
     LONG PointerCount;
     union
     {
     LONG PointerCount;
     union
     {
index f600eda..1f366b0 100644 (file)
@@ -529,10 +529,6 @@ typedef struct _THREAD_BASIC_INFORMATION
 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
 
 #ifndef NTOS_MODE_USER
 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
 
 #ifndef NTOS_MODE_USER
-/* FIXME: see note in mmtypes.h */
-#ifdef _NTOSKRNL_
-#include <internal/mm.h>
-#endif
 
 //
 // EPROCESS Quota Structures
 
 //
 // EPROCESS Quota Structures
@@ -690,6 +686,10 @@ typedef struct _ETHREAD
     UCHAR                          ActiveFaultCount;            /* 24E */
 } ETHREAD;
 
     UCHAR                          ActiveFaultCount;            /* 24E */
 } ETHREAD;
 
+#if defined(_NTOSKRNL_)
+    #include <internal/mm.h>
+#endif
+
 //
 // Executive Process (EPROCESS)
 //
 //
 // Executive Process (EPROCESS)
 //
@@ -818,16 +818,15 @@ typedef struct _EPROCESS
     MM_AVL_TABLE          VadRoot;                      /* 250 */
     ULONG                 Cookie;                       /* 270 */
 
     MM_AVL_TABLE          VadRoot;                      /* 250 */
     ULONG                 Cookie;                       /* 270 */
 
-/***************************************************************
- *                REACTOS SPECIFIC START
- ***************************************************************/
-    /* FIXME WILL BE DEPRECATED WITH PUSHLOCK SUPPORT IN 0.3.0 */
+#ifdef _REACTOS_
+    /* FIXME: WILL BE DEPRECATED WITH PUSHLOCK SUPPORT IN 0.3.0*/
     KEVENT                LockEvent;                    /* 274 */
     ULONG                 LockCount;                    /* 284 */
     struct _KTHREAD       *LockOwner;                   /* 288 */
 
     KEVENT                LockEvent;                    /* 274 */
     ULONG                 LockCount;                    /* 284 */
     struct _KTHREAD       *LockOwner;                   /* 288 */
 
-    /* FIXME MOVE TO AVL TREES                                 */
+    /* FIXME: MOVE TO AVL TREES                                */
     MADDRESS_SPACE        AddressSpace;                 /* 28C */
     MADDRESS_SPACE        AddressSpace;                 /* 28C */
+#endif
 } EPROCESS;
 #include <poppack.h>
 
 } EPROCESS;
 #include <poppack.h>
 
@@ -919,11 +918,12 @@ typedef struct _W32_CALLOUT_DATA
     OB_DELETE_METHOD WinStaDelete;
     OB_PARSE_METHOD WinStaParse;
     OB_OPEN_METHOD WinStaOpen;
     OB_DELETE_METHOD WinStaDelete;
     OB_PARSE_METHOD WinStaParse;
     OB_OPEN_METHOD WinStaOpen;
-    
-    /* FIXME: These are ROS-ONLY and are fixed in a future local patch */
+#ifdef _REACTOS_
+    /* FIXME: REACTOS ONLY */
     OB_FIND_METHOD WinStaFind;
     OB_OPEN_METHOD WinStaCreate;
     OB_CREATE_METHOD DesktopCreate;
     OB_FIND_METHOD WinStaFind;
     OB_OPEN_METHOD WinStaCreate;
     OB_CREATE_METHOD DesktopCreate;
+#endif
 } W32_CALLOUT_DATA, *PW32_CALLOUT_DATA;
 
 #endif // !NTOS_MODE_USER
 } W32_CALLOUT_DATA, *PW32_CALLOUT_DATA;
 
 #endif // !NTOS_MODE_USER
index af8c5ef..a5275b6 100644 (file)
@@ -167,7 +167,7 @@ KiKernelTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2)
     {
       Er.ExceptionCode = STATUS_ACCESS_VIOLATION;
       Er.NumberParameters = 2;
     {
       Er.ExceptionCode = STATUS_ACCESS_VIOLATION;
       Er.NumberParameters = 2;
-      Er.ExceptionInformation[0] = Tf->ErrorCode & 0x1;
+      Er.ExceptionInformation[0] = Tf->ErrCode & 0x1;
       Er.ExceptionInformation[1] = (ULONG)Cr2;
     }
   else
       Er.ExceptionInformation[1] = (ULONG)Cr2;
     }
   else
@@ -194,6 +194,7 @@ KiKernelTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2)
 VOID
 KiDoubleFaultHandler(VOID)
 {
 VOID
 KiDoubleFaultHandler(VOID)
 {
+#if 0
   unsigned int cr2;
   ULONG StackLimit;
   ULONG StackBase;
   unsigned int cr2;
   ULONG StackLimit;
   ULONG StackBase;
@@ -212,7 +213,7 @@ KiDoubleFaultHandler(VOID)
 #endif
 
   OldTss = KeGetCurrentKPCR()->TSS;
 #endif
 
   OldTss = KeGetCurrentKPCR()->TSS;
-  Esp0 = OldTss->Esp;
+  Esp0 = OldTss->Esp0;
 
   /* Get CR2 */
   cr2 = Ke386GetCr2();
 
   /* Get CR2 */
   cr2 = Ke386GetCr2();
@@ -394,7 +395,7 @@ KiDoubleFaultHandler(VOID)
        }
 #endif
     }
        }
 #endif
     }
-
+#endif
    DbgPrint("\n");
    for(;;);
 }
    DbgPrint("\n");
    for(;;);
 }
@@ -406,8 +407,8 @@ KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG Parameter1, ULONG Parameter2)
   ULONG cr3_;
   ULONG StackLimit;
   ULONG Esp0;
   ULONG cr3_;
   ULONG StackLimit;
   ULONG Esp0;
-  ULONG ExceptionNr = (ULONG)Tf->DebugArgMark;
-  ULONG cr2 = (ULONG)Tf->DebugPointer;
+  ULONG ExceptionNr = (ULONG)Tf->DbgArgMark;
+  ULONG cr2 = (ULONG)Tf->DbgArgPointer;
 
   Esp0 = (ULONG)Tf;
 
 
   Esp0 = (ULONG)Tf;
 
@@ -417,14 +418,14 @@ KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG Parameter1, ULONG Parameter2)
    if (ExceptionNr < ARRAY_SIZE(ExceptionTypeStrings))
      {
        DbgPrint("%s Exception: %d(%x)\n", ExceptionTypeStrings[ExceptionNr],
    if (ExceptionNr < ARRAY_SIZE(ExceptionTypeStrings))
      {
        DbgPrint("%s Exception: %d(%x)\n", ExceptionTypeStrings[ExceptionNr],
-                ExceptionNr, Tf->ErrorCode&0xffff);
+                ExceptionNr, Tf->ErrCode&0xffff);
      }
    else
      {
      }
    else
      {
-       DbgPrint("Exception: %d(%x)\n", ExceptionNr, Tf->ErrorCode&0xffff);
+       DbgPrint("Exception: %d(%x)\n", ExceptionNr, Tf->ErrCode&0xffff);
      }
    DbgPrint("Processor: %d CS:EIP %x:%x ", KeGetCurrentProcessorNumber(),
      }
    DbgPrint("Processor: %d CS:EIP %x:%x ", KeGetCurrentProcessorNumber(),
-           Tf->Cs&0xffff, Tf->Eip);
+           Tf->SegCs&0xffff, Tf->Eip);
    KeRosPrintAddress((PVOID)Tf->Eip);
    DbgPrint("\n");
    Ke386GetPageTableDirectory(cr3_);
    KeRosPrintAddress((PVOID)Tf->Eip);
    DbgPrint("\n");
    Ke386GetPageTableDirectory(cr3_);
@@ -442,13 +443,13 @@ KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG Parameter1, ULONG Parameter2)
                 PsGetCurrentThread()->Cid.UniqueThread);
      }
    DbgPrint("\n");
                 PsGetCurrentThread()->Cid.UniqueThread);
      }
    DbgPrint("\n");
-   DbgPrint("DS %x ES %x FS %x GS %x\n", Tf->Ds&0xffff, Tf->Es&0xffff,
-           Tf->Fs&0xffff, Tf->Gs&0xfff);
+   DbgPrint("DS %x ES %x FS %x GS %x\n", Tf->SegDs&0xffff, Tf->SegEs&0xffff,
+           Tf->SegFs&0xffff, Tf->SegGs&0xfff);
    DbgPrint("EAX: %.8x   EBX: %.8x   ECX: %.8x\n", Tf->Eax, Tf->Ebx, Tf->Ecx);
    DbgPrint("EDX: %.8x   EBP: %.8x   ESI: %.8x   ESP: %.8x\n", Tf->Edx,
            Tf->Ebp, Tf->Esi, Esp0);
    DbgPrint("EAX: %.8x   EBX: %.8x   ECX: %.8x\n", Tf->Eax, Tf->Ebx, Tf->Ecx);
    DbgPrint("EDX: %.8x   EBP: %.8x   ESI: %.8x   ESP: %.8x\n", Tf->Edx,
            Tf->Ebp, Tf->Esi, Esp0);
-   DbgPrint("EDI: %.8x   EFLAGS: %.8x ", Tf->Edi, Tf->Eflags);
-   if ((Tf->Cs&0xffff) == KGDT_R0_CODE)
+   DbgPrint("EDI: %.8x   EFLAGS: %.8x ", Tf->Edi, Tf->EFlags);
+   if ((Tf->SegCs&0xffff) == KGDT_R0_CODE)
      {
        DbgPrint("kESP %.8x ", Esp0);
        if (PsGetCurrentThread() != NULL)
      {
        DbgPrint("kESP %.8x ", Esp0);
        if (PsGetCurrentThread() != NULL)
@@ -490,21 +491,21 @@ KiTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
    ASSERT(ExceptionNr != 14);
 
    /* Store the exception number in an unused field in the trap frame. */
    ASSERT(ExceptionNr != 14);
 
    /* Store the exception number in an unused field in the trap frame. */
-   Tf->DebugArgMark = ExceptionNr;
+   Tf->DbgArgMark = ExceptionNr;
 
    /* Use the address of the trap frame as approximation to the ring0 esp */
    Esp0 = (ULONG)&Tf->Eip;
 
    /* Get CR2 */
    cr2 = Ke386GetCr2();
 
    /* Use the address of the trap frame as approximation to the ring0 esp */
    Esp0 = (ULONG)&Tf->Eip;
 
    /* Get CR2 */
    cr2 = Ke386GetCr2();
-   Tf->DebugPointer = cr2;
+   Tf->DbgArgPointer = cr2;
 
    /*
     * If this was a V86 mode exception then handle it specially
     */
 
    /*
     * If this was a V86 mode exception then handle it specially
     */
-   if (Tf->Eflags & (1 << 17))
+   if (Tf->EFlags & (1 << 17))
      {
      {
-       DPRINT("Tf->Eflags, %x, Tf->Eip %x, ExceptionNr: %d\n", Tf->Eflags, Tf->Eip, ExceptionNr);
+       DPRINT("Tf->Eflags, %x, Tf->Eip %x, ExceptionNr: %d\n", Tf->EFlags, Tf->Eip, ExceptionNr);
        return(KeV86Exception(ExceptionNr, Tf, cr2));
      }
 
        return(KeV86Exception(ExceptionNr, Tf, cr2));
      }
 
@@ -561,7 +562,7 @@ KiTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
    /*
     * Handle user exceptions differently
     */
    /*
     * Handle user exceptions differently
     */
-   if ((Tf->Cs & 0xFFFF) == (KGDT_R3_CODE | RPL_MASK))
+   if ((Tf->SegCs & 0xFFFF) == (KGDT_R3_CODE | RPL_MASK))
      {
        return(KiUserTrapHandler(Tf, ExceptionNr, (PVOID)cr2));
      }
      {
        return(KiUserTrapHandler(Tf, ExceptionNr, (PVOID)cr2));
      }
@@ -576,15 +577,15 @@ NTAPI
 KiEspFromTrapFrame(IN PKTRAP_FRAME TrapFrame)
 {
     /* Check if this is user-mode or V86 */
 KiEspFromTrapFrame(IN PKTRAP_FRAME TrapFrame)
 {
     /* Check if this is user-mode or V86 */
-    if ((TrapFrame->Cs & 1) || (TrapFrame->Eflags & X86_EFLAGS_VM))
+    if ((TrapFrame->SegCs & MODE_MASK) || (TrapFrame->EFlags & X86_EFLAGS_VM))
     {
         /* Return it directly */
     {
         /* Return it directly */
-        return TrapFrame->Esp;
+        return TrapFrame->HardwareEsp;
     }
     else
     {
         /* Edited frame */
     }
     else
     {
         /* Edited frame */
-        if (!(TrapFrame->Cs & FRAME_EDITED))
+        if (!(TrapFrame->SegCs & FRAME_EDITED))
         {
             /* Return edited value */
             return TrapFrame->TempEsp;
         {
             /* Return edited value */
             return TrapFrame->TempEsp;
@@ -592,7 +593,7 @@ KiEspFromTrapFrame(IN PKTRAP_FRAME TrapFrame)
         else
         {
             /* Virgin frame, calculate */
         else
         {
             /* Virgin frame, calculate */
-            return (ULONG)&TrapFrame->Esp;
+            return (ULONG)&TrapFrame->HardwareEsp;
         }
     }
 }
         }
     }
 }
@@ -605,10 +606,10 @@ KiEspToTrapFrame(IN PKTRAP_FRAME TrapFrame,
     ULONG Previous = KiEspFromTrapFrame(TrapFrame);
 
     /* Check if this is user-mode or V86 */
     ULONG Previous = KiEspFromTrapFrame(TrapFrame);
 
     /* Check if this is user-mode or V86 */
-    if ((TrapFrame->Cs & MODE_MASK) || (TrapFrame->Eflags & X86_EFLAGS_VM))
+    if ((TrapFrame->SegCs & MODE_MASK) || (TrapFrame->EFlags & X86_EFLAGS_VM))
     {
         /* Write it directly */
     {
         /* Write it directly */
-        TrapFrame->Esp = Esp;
+        TrapFrame->HardwareEsp = Esp;
     }
     else
     {
     }
     else
     {
@@ -619,7 +620,7 @@ KiEspToTrapFrame(IN PKTRAP_FRAME TrapFrame,
         }
 
         /* Create an edit frame, check if it was alrady */
         }
 
         /* Create an edit frame, check if it was alrady */
-        if (!(TrapFrame->Cs & FRAME_EDITED))
+        if (!(TrapFrame->SegCs & FRAME_EDITED))
         {
             /* Update the value */
             TrapFrame->TempEsp = Esp;
         {
             /* Update the value */
             TrapFrame->TempEsp = Esp;
@@ -630,8 +631,8 @@ KiEspToTrapFrame(IN PKTRAP_FRAME TrapFrame,
             if (Previous != Esp)
             {
                 /* Save CS */
             if (Previous != Esp)
             {
                 /* Save CS */
-                TrapFrame->TempCs = TrapFrame->Cs;
-                TrapFrame->Cs &= ~FRAME_EDITED;
+                TrapFrame->TempSegCs = TrapFrame->SegCs;
+                TrapFrame->SegCs &= ~FRAME_EDITED;
 
                 /* Save ESP */
                 TrapFrame->TempEsp = Esp;
 
                 /* Save ESP */
                 TrapFrame->TempEsp = Esp;
@@ -645,15 +646,15 @@ NTAPI
 KiSsFromTrapFrame(IN PKTRAP_FRAME TrapFrame)
 {
     /* If this was V86 Mode */
 KiSsFromTrapFrame(IN PKTRAP_FRAME TrapFrame)
 {
     /* If this was V86 Mode */
-    if (TrapFrame->Eflags & X86_EFLAGS_VM)
+    if (TrapFrame->EFlags & X86_EFLAGS_VM)
     {
         /* Just return it */
     {
         /* Just return it */
-        return TrapFrame->Ss;
+        return TrapFrame->HardwareSegSs;
     }
     }
-    else if (TrapFrame->Cs & MODE_MASK)
+    else if (TrapFrame->SegCs & MODE_MASK)
     {
         /* Usermode, return the User SS */
     {
         /* Usermode, return the User SS */
-        return TrapFrame->Ss | RPL_MASK;
+        return TrapFrame->HardwareSegSs | RPL_MASK;
     }
     else
     {
     }
     else
     {
@@ -671,15 +672,15 @@ KiSsToTrapFrame(IN PKTRAP_FRAME TrapFrame,
     Ss &= 0xFFFF;
 
     /* If this was V86 Mode */
     Ss &= 0xFFFF;
 
     /* If this was V86 Mode */
-    if (TrapFrame->Eflags & X86_EFLAGS_VM)
+    if (TrapFrame->EFlags & X86_EFLAGS_VM)
     {
         /* Just write it */
     {
         /* Just write it */
-        TrapFrame->Ss = Ss;
+        TrapFrame->HardwareSegSs = Ss;
     }
     }
-    else if (TrapFrame->Cs & MODE_MASK)
+    else if (TrapFrame->SegCs & MODE_MASK)
     {
         /* Usermode, save the User SS */
     {
         /* Usermode, save the User SS */
-        TrapFrame->Ss = Ss | RPL_MASK;
+        TrapFrame->HardwareSegSs = Ss | RPL_MASK;
     }
 }
 
     }
 }
 
@@ -697,35 +698,35 @@ KeContextToTrapFrame(IN PCONTEXT Context,
     {
         /* Check if we went through a V86 switch */
         if ((Context->EFlags & X86_EFLAGS_VM) !=
     {
         /* Check if we went through a V86 switch */
         if ((Context->EFlags & X86_EFLAGS_VM) !=
-            (TrapFrame->Eflags & X86_EFLAGS_VM))
+            (TrapFrame->EFlags & X86_EFLAGS_VM))
         {
             /* We did, remember this for later */
             V86Switch = TRUE;
         }
 
         /* Copy EFLAGS. FIXME: Needs to be sanitized */
         {
             /* We did, remember this for later */
             V86Switch = TRUE;
         }
 
         /* Copy EFLAGS. FIXME: Needs to be sanitized */
-        TrapFrame->Eflags = Context->EFlags;
+        TrapFrame->EFlags = Context->EFlags;
 
         /* Copy EBP and EIP */
         TrapFrame->Ebp = Context->Ebp;
         TrapFrame->Eip = Context->Eip;
 
         /* Check if we were in V86 Mode */
 
         /* Copy EBP and EIP */
         TrapFrame->Ebp = Context->Ebp;
         TrapFrame->Eip = Context->Eip;
 
         /* Check if we were in V86 Mode */
-        if (TrapFrame->Eflags & X86_EFLAGS_VM)
+        if (TrapFrame->EFlags & X86_EFLAGS_VM)
         {
             /* Simply copy the CS value */
         {
             /* Simply copy the CS value */
-            TrapFrame->Cs = Context->SegCs;
+            TrapFrame->SegCs = Context->SegCs;
         }
         else
         {
             /* We weren't in V86, so sanitize the CS (FIXME!) */
         }
         else
         {
             /* We weren't in V86, so sanitize the CS (FIXME!) */
-            TrapFrame->Cs = Context->SegCs;
+            TrapFrame->SegCs = Context->SegCs;
 
             /* Don't let it under 8, that's invalid */
 
             /* Don't let it under 8, that's invalid */
-            if ((PreviousMode != KernelMode) && (TrapFrame->Cs < 8))
+            if ((PreviousMode != KernelMode) && (TrapFrame->SegCs < 8))
             {
                 /* Force it to User CS */
             {
                 /* Force it to User CS */
-                TrapFrame->Cs = (KGDT_R3_CODE | RPL_MASK);
+                TrapFrame->SegCs = (KGDT_R3_CODE | RPL_MASK);
             }
         }
 
             }
         }
 
@@ -754,39 +755,39 @@ KeContextToTrapFrame(IN PCONTEXT Context,
     if ((Context->ContextFlags & CONTEXT_SEGMENTS) == CONTEXT_SEGMENTS)
     {
         /* Check if we were in V86 Mode */
     if ((Context->ContextFlags & CONTEXT_SEGMENTS) == CONTEXT_SEGMENTS)
     {
         /* Check if we were in V86 Mode */
-        if (TrapFrame->Eflags & X86_EFLAGS_VM)
+        if (TrapFrame->EFlags & X86_EFLAGS_VM)
         {
             /* Copy the V86 Segments directlry */
         {
             /* Copy the V86 Segments directlry */
-            TrapFrame->V86_Ds = Context->SegDs;
-            TrapFrame->V86_Es = Context->SegEs;
-            TrapFrame->V86_Fs = Context->SegFs;
-            TrapFrame->V86_Gs = Context->SegGs;
+            TrapFrame->V86Ds = Context->SegDs;
+            TrapFrame->V86Es = Context->SegEs;
+            TrapFrame->V86Fs = Context->SegFs;
+            TrapFrame->V86Gs = Context->SegGs;
         }
         }
-        else if (!(TrapFrame->Cs & MODE_MASK))
+        else if (!(TrapFrame->SegCs & MODE_MASK))
         {
             /* For user mode, write the values directly */
         {
             /* For user mode, write the values directly */
-            TrapFrame->Ds = KGDT_R3_DATA | RPL_MASK;
-            TrapFrame->Es = KGDT_R3_DATA | RPL_MASK;
-            TrapFrame->Fs = Context->SegFs;
-            TrapFrame->Gs = 0;
+            TrapFrame->SegDs = KGDT_R3_DATA | RPL_MASK;
+            TrapFrame->SegEs = KGDT_R3_DATA | RPL_MASK;
+            TrapFrame->SegFs = Context->SegFs;
+            TrapFrame->SegGs = 0;
         }
         else
         {
             /* For kernel-mode, return the values */
         }
         else
         {
             /* For kernel-mode, return the values */
-            TrapFrame->Ds = Context->SegDs;
-            TrapFrame->Es = Context->SegEs;
-            TrapFrame->Fs = Context->SegFs;
+            TrapFrame->SegDs = Context->SegDs;
+            TrapFrame->SegEs = Context->SegEs;
+            TrapFrame->SegFs = Context->SegFs;
 
             /* Handle GS specially */
 
             /* Handle GS specially */
-            if (TrapFrame->Cs == (KGDT_R3_CODE | RPL_MASK))
+            if (TrapFrame->SegCs == (KGDT_R3_CODE | RPL_MASK))
             {
                 /* Don't use it, if user */
             {
                 /* Don't use it, if user */
-                TrapFrame->Gs = 0;
+                TrapFrame->SegGs = 0;
             }
             else
             {
                 /* Copy it if kernel */
             }
             else
             {
                 /* Copy it if kernel */
-                TrapFrame->Gs = Context->SegGs;
+                TrapFrame->SegGs = Context->SegGs;
             }
         }
     }
             }
         }
     }
@@ -828,19 +829,19 @@ KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame,
         /* EBP, EIP and EFLAGS */
         Context->Ebp = TrapFrame->Ebp;
         Context->Eip = TrapFrame->Eip;
         /* EBP, EIP and EFLAGS */
         Context->Ebp = TrapFrame->Ebp;
         Context->Eip = TrapFrame->Eip;
-        Context->EFlags = TrapFrame->Eflags;
+        Context->EFlags = TrapFrame->EFlags;
 
         /* Return the correct CS */
 
         /* Return the correct CS */
-        if (!(TrapFrame->Cs & FRAME_EDITED) &&
-            !(TrapFrame->Eflags & X86_EFLAGS_VM))
+        if (!(TrapFrame->SegCs & FRAME_EDITED) &&
+            !(TrapFrame->EFlags & X86_EFLAGS_VM))
         {
             /* Get it from the Temp location */
         {
             /* Get it from the Temp location */
-            Context->SegCs = TrapFrame->TempCs & 0xFFFF;
+            Context->SegCs = TrapFrame->TempSegCs & 0xFFFF;
         }
         else
         {
             /* Return it directly */
         }
         else
         {
             /* Return it directly */
-            Context->SegCs = TrapFrame->Cs & 0xFFFF;
+            Context->SegCs = TrapFrame->SegCs & 0xFFFF;
         }
 
         /* Get the Ss and ESP */
         }
 
         /* Get the Ss and ESP */
@@ -852,31 +853,31 @@ KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame,
     if ((Context->ContextFlags & CONTEXT_SEGMENTS) == CONTEXT_SEGMENTS)
     {
         /* Do V86 Mode first */
     if ((Context->ContextFlags & CONTEXT_SEGMENTS) == CONTEXT_SEGMENTS)
     {
         /* Do V86 Mode first */
-        if (TrapFrame->Eflags & X86_EFLAGS_VM)
+        if (TrapFrame->EFlags & X86_EFLAGS_VM)
         {
             /* Return from the V86 location */
         {
             /* Return from the V86 location */
-            Context->SegGs = TrapFrame->V86_Gs & 0xFFFF;
-            Context->SegFs = TrapFrame->V86_Fs & 0xFFFF;
-            Context->SegEs = TrapFrame->V86_Es & 0xFFFF;
-            Context->SegDs = TrapFrame->V86_Ds & 0xFFFF;
+            Context->SegGs = TrapFrame->V86Gs & 0xFFFF;
+            Context->SegFs = TrapFrame->V86Fs & 0xFFFF;
+            Context->SegEs = TrapFrame->V86Es & 0xFFFF;
+            Context->SegDs = TrapFrame->V86Ds & 0xFFFF;
         }
         else
         {
             /* Check if this was a Kernel Trap */
         }
         else
         {
             /* Check if this was a Kernel Trap */
-            if (TrapFrame->Cs == KGDT_R0_CODE)
+            if (TrapFrame->SegCs == KGDT_R0_CODE)
             {
                 /* Set valid selectors */
             {
                 /* Set valid selectors */
-                TrapFrame->Gs = 0;
-                TrapFrame->Fs = KGDT_R0_PCR;
-                TrapFrame->Es = KGDT_R3_DATA | RPL_MASK;
-                TrapFrame->Ds = KGDT_R3_DATA | RPL_MASK;
+                TrapFrame->SegGs = 0;
+                TrapFrame->SegFs = KGDT_R0_PCR;
+                TrapFrame->SegEs = KGDT_R3_DATA | RPL_MASK;
+                TrapFrame->SegDs = KGDT_R3_DATA | RPL_MASK;
             }
 
             /* Return the segments */
             }
 
             /* Return the segments */
-            Context->SegGs = TrapFrame->Gs & 0xFFFF;
-            Context->SegFs = TrapFrame->Fs & 0xFFFF;
-            Context->SegEs = TrapFrame->Es & 0xFFFF;
-            Context->SegDs = TrapFrame->Ds & 0xFFFF;
+            Context->SegGs = TrapFrame->SegGs & 0xFFFF;
+            Context->SegFs = TrapFrame->SegFs & 0xFFFF;
+            Context->SegEs = TrapFrame->SegEs & 0xFFFF;
+            Context->SegDs = TrapFrame->SegDs & 0xFFFF;
         }
     }
 
         }
     }
 
index 8662f49..a9908da 100644 (file)
@@ -373,7 +373,7 @@ KiHandleFpuFault(PKTRAP_FRAME Tf, ULONG ExceptionNr)
 
         (void) cr0;
         ASSERT((cr0 & X86_CR0_TS) == X86_CR0_TS);
 
         (void) cr0;
         ASSERT((cr0 & X86_CR0_TS) == X86_CR0_TS);
-        ASSERT((Tf->Eflags & X86_EFLAGS_VM) == 0);
+        ASSERT((Tf->EFlags & X86_EFLAGS_VM) == 0);
         ASSERT((cr0 & X86_CR0_EM) == 0);
 
         /* disable scheduler, clear TS in cr0 */
         ASSERT((cr0 & X86_CR0_EM) == 0);
 
         /* disable scheduler, clear TS in cr0 */
@@ -485,7 +485,7 @@ KiHandleFpuFault(PKTRAP_FRAME Tf, ULONG ExceptionNr)
         }
         KeLowerIrql(OldIrql);
 
         }
         KeLowerIrql(OldIrql);
 
-        PreviousMode = ((Tf->Cs & 0xffff) == (KGDT_R3_CODE | RPL_MASK)) ? (UserMode) : (KernelMode);
+        PreviousMode = ((Tf->SegCs & 0xffff) == (KGDT_R3_CODE | RPL_MASK)) ? (UserMode) : (KernelMode);
         DPRINT("Math/Xmm fault happened! (PreviousMode = %s)\n",
                (PreviousMode != KernelMode) ? ("UserMode") : ("KernelMode"));
 
         DPRINT("Math/Xmm fault happened! (PreviousMode = %s)\n",
                (PreviousMode != KernelMode) ? ("UserMode") : ("KernelMode"));
 
index abc833f..cb0fd4d 100644 (file)
@@ -170,42 +170,42 @@ STATIC VOID
 KeIRQTrapFrameToTrapFrame(PKIRQ_TRAPFRAME IrqTrapFrame,
                           PKTRAP_FRAME TrapFrame)
 {
 KeIRQTrapFrameToTrapFrame(PKIRQ_TRAPFRAME IrqTrapFrame,
                           PKTRAP_FRAME TrapFrame)
 {
-   TrapFrame->Gs     = (USHORT)IrqTrapFrame->Gs;
-   TrapFrame->Fs     = (USHORT)IrqTrapFrame->Fs;
-   TrapFrame->Es     = (USHORT)IrqTrapFrame->Es;
-   TrapFrame->Ds     = (USHORT)IrqTrapFrame->Ds;
+   TrapFrame->SegGs     = (USHORT)IrqTrapFrame->Gs;
+   TrapFrame->SegFs     = (USHORT)IrqTrapFrame->Fs;
+   TrapFrame->SegEs     = (USHORT)IrqTrapFrame->Es;
+   TrapFrame->SegDs     = (USHORT)IrqTrapFrame->Ds;
    TrapFrame->Eax    = IrqTrapFrame->Eax;
    TrapFrame->Ecx    = IrqTrapFrame->Ecx;
    TrapFrame->Edx    = IrqTrapFrame->Edx;
    TrapFrame->Ebx    = IrqTrapFrame->Ebx;
    TrapFrame->Eax    = IrqTrapFrame->Eax;
    TrapFrame->Ecx    = IrqTrapFrame->Ecx;
    TrapFrame->Edx    = IrqTrapFrame->Edx;
    TrapFrame->Ebx    = IrqTrapFrame->Ebx;
-   TrapFrame->Esp    = IrqTrapFrame->Esp;
+   TrapFrame->HardwareEsp    = IrqTrapFrame->Esp;
    TrapFrame->Ebp    = IrqTrapFrame->Ebp;
    TrapFrame->Esi    = IrqTrapFrame->Esi;
    TrapFrame->Edi    = IrqTrapFrame->Edi;
    TrapFrame->Eip    = IrqTrapFrame->Eip;
    TrapFrame->Ebp    = IrqTrapFrame->Ebp;
    TrapFrame->Esi    = IrqTrapFrame->Esi;
    TrapFrame->Edi    = IrqTrapFrame->Edi;
    TrapFrame->Eip    = IrqTrapFrame->Eip;
-   TrapFrame->Cs     = IrqTrapFrame->Cs;
-   TrapFrame->Eflags = IrqTrapFrame->Eflags;
+   TrapFrame->SegCs     = IrqTrapFrame->Cs;
+   TrapFrame->EFlags = IrqTrapFrame->Eflags;
 }
 
 STATIC VOID
 KeTrapFrameToIRQTrapFrame(PKTRAP_FRAME TrapFrame,
                           PKIRQ_TRAPFRAME IrqTrapFrame)
 {
 }
 
 STATIC VOID
 KeTrapFrameToIRQTrapFrame(PKTRAP_FRAME TrapFrame,
                           PKIRQ_TRAPFRAME IrqTrapFrame)
 {
-   IrqTrapFrame->Gs     = TrapFrame->Gs;
-   IrqTrapFrame->Fs     = TrapFrame->Fs;
-   IrqTrapFrame->Es     = TrapFrame->Es;
-   IrqTrapFrame->Ds     = TrapFrame->Ds;
+   IrqTrapFrame->Gs     = TrapFrame->SegGs;
+   IrqTrapFrame->Fs     = TrapFrame->SegFs;
+   IrqTrapFrame->Es     = TrapFrame->SegEs;
+   IrqTrapFrame->Ds     = TrapFrame->SegDs;
    IrqTrapFrame->Eax    = TrapFrame->Eax;
    IrqTrapFrame->Ecx    = TrapFrame->Ecx;
    IrqTrapFrame->Edx    = TrapFrame->Edx;
    IrqTrapFrame->Ebx    = TrapFrame->Ebx;
    IrqTrapFrame->Eax    = TrapFrame->Eax;
    IrqTrapFrame->Ecx    = TrapFrame->Ecx;
    IrqTrapFrame->Edx    = TrapFrame->Edx;
    IrqTrapFrame->Ebx    = TrapFrame->Ebx;
-   IrqTrapFrame->Esp    = TrapFrame->Esp;
+   IrqTrapFrame->Esp    = TrapFrame->HardwareEsp;
    IrqTrapFrame->Ebp    = TrapFrame->Ebp;
    IrqTrapFrame->Esi    = TrapFrame->Esi;
    IrqTrapFrame->Edi    = TrapFrame->Edi;
    IrqTrapFrame->Eip    = TrapFrame->Eip;
    IrqTrapFrame->Ebp    = TrapFrame->Ebp;
    IrqTrapFrame->Esi    = TrapFrame->Esi;
    IrqTrapFrame->Edi    = TrapFrame->Edi;
    IrqTrapFrame->Eip    = TrapFrame->Eip;
-   IrqTrapFrame->Cs     = TrapFrame->Cs;
-   IrqTrapFrame->Eflags = TrapFrame->Eflags;
+   IrqTrapFrame->Cs     = TrapFrame->SegCs;
+   IrqTrapFrame->Eflags = TrapFrame->EFlags;
 }
 
 VOID STDCALL
 }
 
 VOID STDCALL
index d0f92e1..7a9e8bb 100644 (file)
@@ -95,11 +95,11 @@ Ke386InitThreadWithContext(PKTHREAD Thread,
         }
 
         /* Enable Interrupts and disable some unsupported flags right now */
         }
 
         /* Enable Interrupts and disable some unsupported flags right now */
-        TrapFrame->Eflags = Context->EFlags | X86_EFLAGS_IF;
-        TrapFrame->Eflags &= ~(X86_EFLAGS_VM | X86_EFLAGS_NT | X86_EFLAGS_IOPL);
+        TrapFrame->EFlags = Context->EFlags | X86_EFLAGS_IF;
+        TrapFrame->EFlags &= ~(X86_EFLAGS_VM | X86_EFLAGS_NT | X86_EFLAGS_IOPL);
 
         /* Set the previous mode as user */
 
         /* Set the previous mode as user */
-        TrapFrame->PreviousMode = UserMode;
+        TrapFrame->PreviousPreviousMode = UserMode;
 
         /* Terminate the Exception Handler List */
         TrapFrame->ExceptionList = (PVOID)0xFFFFFFFF;
 
         /* Terminate the Exception Handler List */
         TrapFrame->ExceptionList = (PVOID)0xFFFFFFFF;
index f220a35..cf37e9c 100644 (file)
 
 /* GLOBALS *******************************************************************/
 
 
 /* GLOBALS *******************************************************************/
 
+typedef struct _KTSSNOIOPM
+{
+    UCHAR TssData[KTSS_IO_MAPS];
+} KTSSNOIOPM;
+
 static KTSS* Ki386TssArray[MAXIMUM_PROCESSORS];
 PVOID Ki386InitialStackArray[MAXIMUM_PROCESSORS];
 static KTSSNOIOPM* Ki386TrapTssArray[MAXIMUM_PROCESSORS];
 static KTSS* Ki386TssArray[MAXIMUM_PROCESSORS];
 PVOID Ki386InitialStackArray[MAXIMUM_PROCESSORS];
 static KTSSNOIOPM* Ki386TrapTssArray[MAXIMUM_PROCESSORS];
@@ -38,7 +43,7 @@ Ke386IoSetAccessProcess(PEPROCESS Process, BOOL EnableDisable)
   USHORT Offset;
 
   if(EnableDisable > 1) return FALSE;
   USHORT Offset;
 
   if(EnableDisable > 1) return FALSE;
-  Offset = (EnableDisable) ? (USHORT) FIELD_OFFSET(KTSS, IoBitmap) : 0xffff;
+  Offset = (EnableDisable) ? (USHORT) FIELD_OFFSET(KTSS, IoMaps) : 0xffff;
 
   oldIrql = KeRaiseIrqlToSynchLevel();
   Process->Pcb.IopmOffset = Offset;
 
   oldIrql = KeRaiseIrqlToSynchLevel();
   Process->Pcb.IopmOffset = Offset;
@@ -62,7 +67,7 @@ Ke386SetIoAccessMap(DWORD MapNumber, PULONG IOMapStart)
 
   oldIrql = KeRaiseIrqlToSynchLevel();
 
 
   oldIrql = KeRaiseIrqlToSynchLevel();
 
-  memcpy(&KeGetCurrentKPCR()->TSS->IoBitmap[0],
+  memcpy(&KeGetCurrentKPCR()->TSS->IoMaps[0],
          IOMapStart,
          0x2000);
 
          IOMapStart,
          0x2000);
 
@@ -85,7 +90,7 @@ Ke386QueryIoAccessMap(DWORD MapNumber, PULONG IOMapStart)
   oldIrql = KeRaiseIrqlToSynchLevel();
 
   memcpy(IOMapStart,
   oldIrql = KeRaiseIrqlToSynchLevel();
 
   memcpy(IOMapStart,
-         &KeGetCurrentKPCR()->TSS->IoBitmap[0],
+         &KeGetCurrentKPCR()->TSS->IoMaps[0],
          0x2000);
 
   KeLowerIrql(oldIrql);
          0x2000);
 
   KeLowerIrql(oldIrql);
@@ -96,8 +101,8 @@ VOID
 Ki386ApplicationProcessorInitializeTSS(VOID)
 {
   ULONG cr3_;
 Ki386ApplicationProcessorInitializeTSS(VOID)
 {
   ULONG cr3_;
-  KTSS* Tss;
-  KTSSNOIOPM* TrapTss;
+  PKTSS Tss;
+  PKTSS TrapTss;
   PVOID TrapStack;
   ULONG Id;
   PUSHORT Gdt;
   PVOID TrapStack;
   ULONG Id;
   PUSHORT Gdt;
@@ -113,7 +118,7 @@ Ki386ApplicationProcessorInitializeTSS(VOID)
   TrapStack = ExAllocatePool(NonPagedPool, MM_STACK_SIZE);
 
   Ki386TssArray[Id] = Tss;
   TrapStack = ExAllocatePool(NonPagedPool, MM_STACK_SIZE);
 
   Ki386TssArray[Id] = Tss;
-  Ki386TrapTssArray[Id] = TrapTss;
+  Ki386TrapTssArray[Id] = (KTSSNOIOPM*)TrapTss;
   Ki386TrapStackArray[Id] = TrapStack;
   KeGetCurrentKPCR()->TSS = Tss;
 
   Ki386TrapStackArray[Id] = TrapStack;
   KeGetCurrentKPCR()->TSS = Tss;
 
@@ -121,8 +126,7 @@ Ki386ApplicationProcessorInitializeTSS(VOID)
   Tss->Esp0 = (ULONG)Ki386InitialStackArray[Id] + MM_STACK_SIZE; /* FIXME: - sizeof(FX_SAVE_AREA)? */
   Tss->Ss0 = KGDT_R0_DATA;
   Tss->IoMapBase = 0xFFFF; /* No i/o bitmap */
   Tss->Esp0 = (ULONG)Ki386InitialStackArray[Id] + MM_STACK_SIZE; /* FIXME: - sizeof(FX_SAVE_AREA)? */
   Tss->Ss0 = KGDT_R0_DATA;
   Tss->IoMapBase = 0xFFFF; /* No i/o bitmap */
-  Tss->IoBitmap[8192] = 0xFF;
-  Tss->Ldt = 0;
+  Tss->LDT = 0;
 
   /*
    * Initialize a descriptor for the TSS
 
   /*
    * Initialize a descriptor for the TSS
@@ -137,20 +141,16 @@ Ki386ApplicationProcessorInitializeTSS(VOID)
     ((base & 0xFF000000) >> 16));
 
   /* Initialize the TSS used for handling double faults. */
     ((base & 0xFF000000) >> 16));
 
   /* Initialize the TSS used for handling double faults. */
-  TrapTss->Eflags = 0;
+  TrapTss->Flags = 0;
   TrapTss->Esp0 = ((ULONG)TrapStack + MM_STACK_SIZE); /* FIXME: - sizeof(FX_SAVE_AREA)? */
   TrapTss->Ss0 = KGDT_R0_DATA;
   TrapTss->Esp0 = ((ULONG)TrapStack + MM_STACK_SIZE); /* FIXME: - sizeof(FX_SAVE_AREA)? */
   TrapTss->Ss0 = KGDT_R0_DATA;
-  TrapTss->Esp = ((ULONG)TrapStack + MM_STACK_SIZE); /* FIXME: - sizeof(FX_SAVE_AREA)? */
   TrapTss->Cs = KGDT_R0_CODE;
   TrapTss->Eip = (ULONG)KiTrap8;
   TrapTss->Cs = KGDT_R0_CODE;
   TrapTss->Eip = (ULONG)KiTrap8;
-  TrapTss->Ss = KGDT_R0_DATA;
   TrapTss->Ds = KGDT_R0_DATA;
   TrapTss->Es = KGDT_R0_DATA;
   TrapTss->Fs = KGDT_R0_PCR;
   TrapTss->IoMapBase = 0xFFFF; /* No i/o bitmap */
   TrapTss->Ds = KGDT_R0_DATA;
   TrapTss->Es = KGDT_R0_DATA;
   TrapTss->Fs = KGDT_R0_PCR;
   TrapTss->IoMapBase = 0xFFFF; /* No i/o bitmap */
-  TrapTss->IoBitmap[0] = 0xFF;
-  TrapTss->Ldt = 0;
-  TrapTss->Cr3 = cr3_;
+  TrapTss->LDT = 0;
 
   /*
    * Initialize a descriptor for the trap TSS.
 
   /*
    * Initialize a descriptor for the trap TSS.
@@ -185,6 +185,7 @@ Ki386BootInitializeTSS(VOID)
   ULONG cr3_;
   extern unsigned int trap_stack, trap_stack_top;
   unsigned int base, length;
   ULONG cr3_;
   extern unsigned int trap_stack, trap_stack_top;
   unsigned int base, length;
+  PKTSS Tss;
 
   Ke386GetPageTableDirectory(cr3_);
 
 
   Ke386GetPageTableDirectory(cr3_);
 
@@ -196,10 +197,8 @@ Ki386BootInitializeTSS(VOID)
   /* Initialize the boot TSS. */
   KiBootTss.Esp0 = (ULONG)init_stack_top - sizeof(FX_SAVE_AREA);
   KiBootTss.Ss0 = KGDT_R0_DATA;
   /* Initialize the boot TSS. */
   KiBootTss.Esp0 = (ULONG)init_stack_top - sizeof(FX_SAVE_AREA);
   KiBootTss.Ss0 = KGDT_R0_DATA;
-  //   KiBootTss.IoMapBase = FIELD_OFFSET(KTSS, IoBitmap);
   KiBootTss.IoMapBase = 0xFFFF; /* No i/o bitmap */
   KiBootTss.IoMapBase = 0xFFFF; /* No i/o bitmap */
-  KiBootTss.IoBitmap[8192] = 0xFF;
-  KiBootTss.Ldt = KGDT_LDT;
+  KiBootTss.LDT = KGDT_LDT;
 
   /*
    * Initialize a descriptor for the TSS
 
   /*
    * Initialize a descriptor for the TSS
@@ -214,20 +213,17 @@ Ki386BootInitializeTSS(VOID)
     ((base & 0xFF000000) >> 16);
 
   /* Initialize the TSS used for handling double faults. */
     ((base & 0xFF000000) >> 16);
 
   /* Initialize the TSS used for handling double faults. */
-  KiBootTrapTss.Eflags = 0;
-  KiBootTrapTss.Esp0 = (ULONG)trap_stack_top; /* FIXME: - sizeof(FX_SAVE_AREA)? */
-  KiBootTrapTss.Ss0 = KGDT_R0_DATA;
-  KiBootTrapTss.Esp = (ULONG)trap_stack_top; /* FIXME: - sizeof(FX_SAVE_AREA)? */
-  KiBootTrapTss.Cs = KGDT_R0_CODE;
-  KiBootTrapTss.Eip = (ULONG)KiTrap8;
-  KiBootTrapTss.Ss = KGDT_R0_DATA;
-  KiBootTrapTss.Ds = KGDT_R0_DATA;
-  KiBootTrapTss.Es = KGDT_R0_DATA;
-  KiBootTrapTss.Fs = KGDT_R0_PCR;
-  KiBootTrapTss.IoMapBase = 0xFFFF; /* No i/o bitmap */
-  KiBootTrapTss.IoBitmap[0] = 0xFF;
-  KiBootTrapTss.Ldt = 0x0;
-  KiBootTrapTss.Cr3 = cr3_;
+  Tss = (PKTSS)&KiBootTrapTss;
+  Tss->Flags = 0;
+  Tss->Esp0 = (ULONG)trap_stack_top; /* FIXME: - sizeof(FX_SAVE_AREA)? */
+  Tss->Ss0 = KGDT_R0_DATA;
+  Tss->Cs = KGDT_R0_CODE;
+  Tss->Eip = (ULONG)KiTrap8;
+  Tss->Ds = KGDT_R0_DATA;
+  Tss->Es = KGDT_R0_DATA;
+  Tss->Fs = KGDT_R0_PCR;
+  Tss->IoMapBase = 0xFFFF; /* No i/o bitmap */
+  Tss->LDT = 0x0;
 
   /*
    * Initialize a descriptor for the trap TSS.
 
   /*
    * Initialize a descriptor for the trap TSS.
index 2710823..cb4c29f 100644 (file)
@@ -117,7 +117,7 @@ KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2)
   if (ExceptionNr == 14)
     {
       Er.NumberParameters = 2;
   if (ExceptionNr == 14)
     {
       Er.NumberParameters = 2;
-      Er.ExceptionInformation[0] = Tf->ErrorCode & 0x1;
+      Er.ExceptionInformation[0] = Tf->ErrCode & 0x1;
       Er.ExceptionInformation[1] = (ULONG)Cr2;
     }
   else
       Er.ExceptionInformation[1] = (ULONG)Cr2;
     }
   else
index 07646d3..df5e988 100644 (file)
@@ -37,12 +37,12 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
   ULONG i = 0;
   BOOL Exit = FALSE;
 
   ULONG i = 0;
   BOOL Exit = FALSE;
 
-  ip = (PUCHAR)((Tf->Cs & 0xFFFF) * 16 + (Tf->Eip & 0xFFFF));
-  sp = (PUSHORT)((Tf->Ss & 0xFFFF) * 16 + (Tf->Esp & 0xFFFF));
+  ip = (PUCHAR)((Tf->SegCs & 0xFFFF) * 16 + (Tf->Eip & 0xFFFF));
+  sp = (PUSHORT)((Tf->HardwareSegSs & 0xFFFF) * 16 + (Tf->HardwareEsp & 0xFFFF));
   dsp = (PULONG)sp;
 
   DPRINT("KeV86GPF handling %x at %x:%x ss:sp %x:%x Flags %x\n",
   dsp = (PULONG)sp;
 
   DPRINT("KeV86GPF handling %x at %x:%x ss:sp %x:%x Flags %x\n",
-        ip[0], Tf->Cs, Tf->Eip, Tf->Ss, Tf->Esp, VTf->regs->Flags);
+        ip[0], Tf->SegCs, Tf->Eip, Tf->Ss, Tf->HardwareEsp, VTf->regs->Flags);
 
   while (!Exit)
     {
 
   while (!Exit)
     {
@@ -113,9 +113,9 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
              Tf->Eip++;
              if (!BigAddressPrefix)
                {
              Tf->Eip++;
              if (!BigAddressPrefix)
                {
-                 Tf->Esp = Tf->Esp - 2;
+                 Tf->HardwareEsp = Tf->HardwareEsp - 2;
                  sp = sp - 1;
                  sp = sp - 1;
-                 sp[0] = (USHORT)(Tf->Eflags & 0xFFFF);
+                 sp[0] = (USHORT)(Tf->EFlags & 0xFFFF);
                  if (VTf->regs->Vif == 1)
                    {
                      sp[0] = (USHORT)(sp[0] | INTERRUPT_FLAG);
                  if (VTf->regs->Vif == 1)
                    {
                      sp[0] = (USHORT)(sp[0] | INTERRUPT_FLAG);
@@ -127,9 +127,9 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
                }
              else
                {
                }
              else
                {
-                 Tf->Esp = Tf->Esp - 4;
+                 Tf->HardwareEsp = Tf->HardwareEsp - 4;
                  dsp = dsp - 1;
                  dsp = dsp - 1;
-                 dsp[0] = Tf->Eflags;
+                 dsp[0] = Tf->EFlags;
                  dsp[0] = dsp[0] & VALID_FLAGS;
                  if (VTf->regs->Vif == 1)
                    {
                  dsp[0] = dsp[0] & VALID_FLAGS;
                  if (VTf->regs->Vif == 1)
                    {
@@ -157,9 +157,9 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
              Tf->Eip++;
              if (!BigAddressPrefix)
                {
              Tf->Eip++;
              if (!BigAddressPrefix)
                {
-                 Tf->Eflags = Tf->Eflags & (~0xFFFF);
-                 Tf->Eflags = Tf->Eflags | (sp[0] & VALID_FLAGS);
-                 if (Tf->Eflags & INTERRUPT_FLAG)
+                 Tf->EFlags = Tf->EFlags & (~0xFFFF);
+                 Tf->EFlags = Tf->EFlags | (sp[0] & VALID_FLAGS);
+                 if (Tf->EFlags & INTERRUPT_FLAG)
                    {
                      VTf->regs->Vif = 1;
                    }
                    {
                      VTf->regs->Vif = 1;
                    }
@@ -167,12 +167,12 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
                    {
                      VTf->regs->Vif = 0;
                    }
                    {
                      VTf->regs->Vif = 0;
                    }
-                 Tf->Eflags = Tf->Eflags | INTERRUPT_FLAG;
-                 Tf->Esp = Tf->Esp + 2;
+                 Tf->EFlags = Tf->EFlags | INTERRUPT_FLAG;
+                 Tf->HardwareEsp = Tf->HardwareEsp + 2;
                }
              else
                {
                }
              else
                {
-                 Tf->Eflags = Tf->Eflags | (dsp[0] & VALID_FLAGS);
+                 Tf->EFlags = Tf->EFlags | (dsp[0] & VALID_FLAGS);
                  if (dsp[0] & INTERRUPT_FLAG)
                    {
                      VTf->regs->Vif = 1;
                  if (dsp[0] & INTERRUPT_FLAG)
                    {
                      VTf->regs->Vif = 1;
@@ -181,8 +181,8 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
                    {
                      VTf->regs->Vif = 0;
                    }
                    {
                      VTf->regs->Vif = 0;
                    }
-                 Tf->Eflags = Tf->Eflags | INTERRUPT_FLAG;
-                 Tf->Esp = Tf->Esp + 2;
+                 Tf->EFlags = Tf->EFlags | INTERRUPT_FLAG;
+                 Tf->HardwareEsp = Tf->HardwareEsp + 2;
                }
              return(0);
            }
                }
              return(0);
            }
@@ -199,10 +199,10 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
          if (VTf->regs->Flags & KV86M_EMULATE_CLI_STI)
            {
              Tf->Eip = sp[0];
          if (VTf->regs->Flags & KV86M_EMULATE_CLI_STI)
            {
              Tf->Eip = sp[0];
-             Tf->Cs = sp[1];
-             Tf->Eflags = Tf->Eflags & (~0xFFFF);
-             Tf->Eflags = Tf->Eflags | sp[2];
-             if (Tf->Eflags & INTERRUPT_FLAG)
+             Tf->SegCs = sp[1];
+             Tf->EFlags = Tf->EFlags & (~0xFFFF);
+             Tf->EFlags = Tf->EFlags | sp[2];
+             if (Tf->EFlags & INTERRUPT_FLAG)
                {
                  VTf->regs->Vif = 1;
                }
                {
                  VTf->regs->Vif = 1;
                }
@@ -210,8 +210,8 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
                {
                  VTf->regs->Vif = 0;
                }
                {
                  VTf->regs->Vif = 0;
                }
-             Tf->Eflags = Tf->Eflags & (~INTERRUPT_FLAG);
-             Tf->Esp = Tf->Esp + 6;
+             Tf->EFlags = Tf->EFlags & (~INTERRUPT_FLAG);
+             Tf->HardwareEsp = Tf->HardwareEsp + 6;
              return(0);
            }
          Exit = TRUE;
              return(0);
            }
          Exit = TRUE;
@@ -433,11 +433,11 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
                {
                  Offset = Offset & 0xFFFF;
                }
                {
                  Offset = Offset & 0xFFFF;
                }
-             Buffer = (PUCHAR)((Tf->Es * 16) + Offset);
+             Buffer = (PUCHAR)((Tf->SegEs * 16) + Offset);
              for (; Count > 0; Count--)
                {
                  WRITE_PORT_UCHAR(Port, *Buffer);
              for (; Count > 0; Count--)
                {
                  WRITE_PORT_UCHAR(Port, *Buffer);
-                 if (Tf->Eflags & DIRECTION_FLAG)
+                 if (Tf->EFlags & DIRECTION_FLAG)
                    {
                      Buffer++;
                    }
                    {
                      Buffer++;
                    }
@@ -480,11 +480,11 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
                }
              if (BigDataPrefix)
                {
                }
              if (BigDataPrefix)
                {
-                 BufferL = (PULONG)((Tf->Es * 16) + Offset);
+                 BufferL = (PULONG)((Tf->SegEs * 16) + Offset);
                }
              else
                {
                }
              else
                {
-                 BufferS = (PUSHORT)((Tf->Es * 16) + Offset);
+                 BufferS = (PUSHORT)((Tf->SegEs * 16) + Offset);
                }
              for (; Count > 0; Count--)
                {
                }
              for (; Count > 0; Count--)
                {
@@ -496,7 +496,7 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
                    {
                      WRITE_PORT_USHORT((PUSHORT)Port, *BufferS);
                    }
                    {
                      WRITE_PORT_USHORT((PUSHORT)Port, *BufferS);
                    }
-                 if (Tf->Eflags & DIRECTION_FLAG)
+                 if (Tf->EFlags & DIRECTION_FLAG)
                    {
                      if (BigDataPrefix)
                        {
                    {
                      if (BigDataPrefix)
                        {
@@ -550,11 +550,11 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
                {
                  Offset = Offset & 0xFFFF;
                }
                {
                  Offset = Offset & 0xFFFF;
                }
-             Buffer = (PUCHAR)((Tf->Es * 16) + Offset);
+             Buffer = (PUCHAR)((Tf->SegEs * 16) + Offset);
              for (; Count > 0; Count--)
                {
                  *Buffer = READ_PORT_UCHAR(Port);
              for (; Count > 0; Count--)
                {
                  *Buffer = READ_PORT_UCHAR(Port);
-                 if (Tf->Eflags & DIRECTION_FLAG)
+                 if (Tf->EFlags & DIRECTION_FLAG)
                    {
                      Buffer++;
                    }
                    {
                      Buffer++;
                    }
@@ -597,11 +597,11 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
                }
              if (BigDataPrefix)
                {
                }
              if (BigDataPrefix)
                {
-                 BufferL = (PULONG)((Tf->Es * 16) + Offset);
+                 BufferL = (PULONG)((Tf->SegEs * 16) + Offset);
                }
              else
                {
                }
              else
                {
-                 BufferS = (PUSHORT)((Tf->Es * 16) + Offset);
+                 BufferS = (PUSHORT)((Tf->SegEs * 16) + Offset);
                }
              for (; Count > 0; Count--)
                {
                }
              for (; Count > 0; Count--)
                {
@@ -613,7 +613,7 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
                    {
                      *BufferS = READ_PORT_USHORT((PUSHORT)Port);
                    }
                    {
                      *BufferS = READ_PORT_USHORT((PUSHORT)Port);
                    }
-                 if (Tf->Eflags & DIRECTION_FLAG)
+                 if (Tf->EFlags & DIRECTION_FLAG)
                    {
                      if (BigDataPrefix)
                        {
                    {
                      if (BigDataPrefix)
                        {
@@ -651,20 +651,20 @@ KeV86GPF(PKV86M_TRAP_FRAME VTf, PKTRAP_FRAME Tf)
            inum = ip[1];
            entry = ((unsigned int *)0)[inum];
 
            inum = ip[1];
            entry = ((unsigned int *)0)[inum];
 
-           Tf->Esp = Tf->Esp - 6;
+           Tf->HardwareEsp = Tf->HardwareEsp - 6;
            sp = sp - 3;
 
            sp[0] = (USHORT)((Tf->Eip & 0xFFFF) + 2);
            sp = sp - 3;
 
            sp[0] = (USHORT)((Tf->Eip & 0xFFFF) + 2);
-           sp[1] = (USHORT)(Tf->Cs & 0xFFFF);
-           sp[2] = (USHORT)(Tf->Eflags & 0xFFFF);
+           sp[1] = (USHORT)(Tf->SegCs & 0xFFFF);
+           sp[2] = (USHORT)(Tf->EFlags & 0xFFFF);
            if (VTf->regs->Vif == 1)
              {
                sp[2] = (USHORT)(sp[2] | INTERRUPT_FLAG);
              }
            DPRINT("sp[0] %x sp[1] %x sp[2] %x\n", sp[0], sp[1], sp[2]);
            Tf->Eip = entry & 0xFFFF;
            if (VTf->regs->Vif == 1)
              {
                sp[2] = (USHORT)(sp[2] | INTERRUPT_FLAG);
              }
            DPRINT("sp[0] %x sp[1] %x sp[2] %x\n", sp[0], sp[1], sp[2]);
            Tf->Eip = entry & 0xFFFF;
-           Tf->Cs = entry >> 16;
-           Tf->Eflags = Tf->Eflags & (~TRAP_FLAG);
+           Tf->SegCs = entry >> 16;
+           Tf->EFlags = Tf->EFlags & (~TRAP_FLAG);
 
            return(0);
          }
 
            return(0);
          }
@@ -701,16 +701,16 @@ KeV86Exception(ULONG ExceptionNr, PKTRAP_FRAME Tf, ULONG address)
   /*
    * Check if we have reached the recovery instruction
    */
   /*
    * Check if we have reached the recovery instruction
    */
-  Ip = (PUCHAR)((Tf->Cs & 0xFFFF) * 16 + (Tf->Eip & 0xFFFF));
+  Ip = (PUCHAR)((Tf->SegCs & 0xFFFF) * 16 + (Tf->Eip & 0xFFFF));
   
   
-  DPRINT("ExceptionNr %d Ip[0] %x Ip[1] %x Ip[2] %x Ip[3] %x Tf->Cs %x "
-        "Tf->Eip %x\n", ExceptionNr, Ip[0], Ip[1], Ip[2], Ip[3], Tf->Cs,
+  DPRINT("ExceptionNr %d Ip[0] %x Ip[1] %x Ip[2] %x Ip[3] %x Tf->SegCs %x "
+        "Tf->Eip %x\n", ExceptionNr, Ip[0], Ip[1], Ip[2], Ip[3], Tf->SegCs,
         Tf->Eip);
   DPRINT("VTf %x VTf->regs %x\n", VTf, VTf->regs);
 
   if (ExceptionNr == 6 &&
       memcmp(Ip, VTf->regs->RecoveryInstruction, 4) == 0 &&
         Tf->Eip);
   DPRINT("VTf %x VTf->regs %x\n", VTf, VTf->regs);
 
   if (ExceptionNr == 6 &&
       memcmp(Ip, VTf->regs->RecoveryInstruction, 4) == 0 &&
-      (Tf->Cs * 16 + Tf->Eip) == VTf->regs->RecoveryAddress)
+      (Tf->SegCs * 16 + Tf->Eip) == VTf->regs->RecoveryAddress)
     {
       *VTf->regs->PStatus = STATUS_SUCCESS;
       return(1);
     {
       *VTf->regs->PStatus = STATUS_SUCCESS;
       return(1);
index 224f5ac..e903050 100644 (file)
@@ -38,10 +38,10 @@ KeInitializeProfile(PKPROFILE Profile,
 
     /* Copy all the settings we were given */
     Profile->Process = Process;
 
     /* Copy all the settings we were given */
     Profile->Process = Process;
-    Profile->RegionStart = ImageBase;
+    Profile->RangeBase = ImageBase;
     Profile->BucketShift = BucketSize - 2; /* See ntinternals.net -- Alex */
     Profile->BucketShift = BucketSize - 2; /* See ntinternals.net -- Alex */
-    Profile->RegionEnd = (PVOID)((ULONG_PTR)ImageBase + ImageSize);
-    Profile->Active = FALSE;
+    Profile->RangeLimit = (PVOID)((ULONG_PTR)ImageBase + ImageSize);
+    Profile->Started = FALSE;
     Profile->Source = ProfileSource;
     Profile->Affinity = Affinity;
 }
     Profile->Source = ProfileSource;
     Profile->Affinity = Affinity;
 }
@@ -68,11 +68,11 @@ KeStartProfile(PKPROFILE Profile,
     KeAcquireSpinLockAtDpcLevel(&KiProfileLock);
 
     /* Make sure it's not running */
     KeAcquireSpinLockAtDpcLevel(&KiProfileLock);
 
     /* Make sure it's not running */
-    if (!Profile->Active) {
+    if (!Profile->Started) {
 
 
-        /* Set it as active */
+        /* Set it as Started */
         Profile->Buffer = Buffer;
         Profile->Buffer = Buffer;
-        Profile->Active = TRUE;
+        Profile->Started = TRUE;
 
         /* Get the process, if any */
         ProfileProcess = Profile->Process;
 
         /* Get the process, if any */
         ProfileProcess = Profile->Process;
@@ -80,11 +80,11 @@ KeStartProfile(PKPROFILE Profile,
         /* Insert it into the Process List or Global List */
         if (ProfileProcess) {
 
         /* Insert it into the Process List or Global List */
         if (ProfileProcess) {
 
-            InsertTailList(&ProfileProcess->ProfileListHead, &Profile->ListEntry);
+            InsertTailList(&ProfileProcess->ProfileListHead, &Profile->ProfileListEntry);
 
         } else {
 
 
         } else {
 
-            InsertTailList(&KiProfileListHead, &Profile->ListEntry);
+            InsertTailList(&KiProfileListHead, &Profile->ProfileListEntry);
         }
 
         /* Check if this type of profile (source) is already running */
         }
 
         /* Check if this type of profile (source) is already running */
@@ -134,11 +134,11 @@ KeStopProfile(PKPROFILE Profile)
     KeAcquireSpinLockAtDpcLevel(&KiProfileLock);
 
     /* Make sure it's running */
     KeAcquireSpinLockAtDpcLevel(&KiProfileLock);
 
     /* Make sure it's running */
-    if (Profile->Active) {
+    if (Profile->Started) {
 
         /* Remove it from the list and disable */
 
         /* Remove it from the list and disable */
-        RemoveEntryList(&Profile->ListEntry);
-        Profile->Active = FALSE;
+        RemoveEntryList(&Profile->ProfileListEntry);
+        Profile->Started = FALSE;
 
         /* Find the Source Object */
         LIST_FOR_EACH(CurrentSource, &KiProfileSourceListHead, KPROFILE_SOURCE_OBJECT, ListEntry) 
 
         /* Find the Source Object */
         LIST_FOR_EACH(CurrentSource, &KiProfileSourceListHead, KPROFILE_SOURCE_OBJECT, ListEntry) 
@@ -227,19 +227,19 @@ KiParseProfileList(IN PKTRAP_FRAME TrapFrame,
     PKPROFILE Profile;
 
     /* Loop the List */
     PKPROFILE Profile;
 
     /* Loop the List */
-    LIST_FOR_EACH(Profile, ListHead, KPROFILE, ListEntry)
+    LIST_FOR_EACH(Profile, ListHead, KPROFILE, ProfileListEntry)
     {
         /* Check if the source is good, and if it's within the range */
         if ((Profile->Source != Source) ||
     {
         /* Check if the source is good, and if it's within the range */
         if ((Profile->Source != Source) ||
-            (TrapFrame->Eip < (ULONG_PTR)Profile->RegionStart) ||
-            (TrapFrame->Eip > (ULONG_PTR)Profile->RegionEnd)) {
+            (TrapFrame->Eip < (ULONG_PTR)Profile->RangeBase) ||
+            (TrapFrame->Eip > (ULONG_PTR)Profile->RangeLimit)) {
 
             continue;
         }
 
         /* Get the Pointer to the Bucket Value representing this EIP */
         BucketValue = (PULONG)((((ULONG_PTR)Profile->Buffer +
 
             continue;
         }
 
         /* Get the Pointer to the Bucket Value representing this EIP */
         BucketValue = (PULONG)((((ULONG_PTR)Profile->Buffer +
-                               (TrapFrame->Eip - (ULONG_PTR)Profile->RegionStart))
+                               (TrapFrame->Eip - (ULONG_PTR)Profile->RangeBase))
                                 >> Profile->BucketShift) &~ 0x3);
 
         /* Increment the value */
                                 >> Profile->BucketShift) &~ 0x3);
 
         /* Increment the value */
index 08bcadc..3bfc9da 100644 (file)
@@ -36,14 +36,14 @@ ULONG KiPageFaultHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
    ASSERT(ExceptionNr == 14);
    
    /* Store the exception number in an unused field in the trap frame. */
    ASSERT(ExceptionNr == 14);
    
    /* Store the exception number in an unused field in the trap frame. */
-   Tf->DebugArgMark = 14;
+   Tf->DbgArgMark = 14;
 
    /* get the faulting address */
    cr2 = Ke386GetCr2();
 
    /* get the faulting address */
    cr2 = Ke386GetCr2();
-   Tf->DebugPointer = cr2;
+   Tf->DbgArgPointer = cr2;
 
    /* it's safe to enable interrupts after cr2 has been saved */
 
    /* it's safe to enable interrupts after cr2 has been saved */
-   if (Tf->Eflags & (X86_EFLAGS_VM|X86_EFLAGS_IF))
+   if (Tf->EFlags & (X86_EFLAGS_VM|X86_EFLAGS_IF))
    {
       Ke386EnableInterrupts();
    }
    {
       Ke386EnableInterrupts();
    }
@@ -51,22 +51,22 @@ ULONG KiPageFaultHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
    if (cr2 >= (ULONG_PTR)MmSystemRangeStart)
    {
       /* check for an invalid page directory in kernel mode */
    if (cr2 >= (ULONG_PTR)MmSystemRangeStart)
    {
       /* check for an invalid page directory in kernel mode */
-      if (!(Tf->ErrorCode & 0x5) && Mmi386MakeKernelPageTableGlobal((PVOID)cr2))
+      if (!(Tf->ErrCode & 0x5) && Mmi386MakeKernelPageTableGlobal((PVOID)cr2))
       {
          return 0;
       }
 
       /* check for non executable memory in kernel mode */
       {
          return 0;
       }
 
       /* check for non executable memory in kernel mode */
-      if (Ke386NoExecute && Tf->ErrorCode & 0x10)
+      if (Ke386NoExecute && Tf->ErrCode & 0x10)
       {
          KEBUGCHECKWITHTF(ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY, 0, 0, 0, 0, Tf);
       }
    }
 
       {
          KEBUGCHECKWITHTF(ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY, 0, 0, 0, 0, Tf);
       }
    }
 
-   Mode = Tf->ErrorCode & 0x4 ? UserMode : KernelMode;
+   Mode = Tf->ErrCode & 0x4 ? UserMode : KernelMode;
 
    /* handle the fault */
 
    /* handle the fault */
-   if (Tf->ErrorCode & 0x1)
+   if (Tf->ErrCode & 0x1)
    {
       Status = MmAccessFault(Mode, cr2, FALSE);
    }
    {
       Status = MmAccessFault(Mode, cr2, FALSE);
    }
@@ -76,7 +76,7 @@ ULONG KiPageFaultHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
    }
    
    /* handle the return for v86 mode */
    }
    
    /* handle the return for v86 mode */
-   if (Tf->Eflags & X86_EFLAGS_VM)
+   if (Tf->EFlags & X86_EFLAGS_VM)
    {
       if (!NT_SUCCESS(Status))
       {
    {
       if (!NT_SUCCESS(Status))
       {