[FAST486]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Thu, 4 Jun 2015 20:25:14 +0000 (20:25 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Thu, 4 Jun 2015 20:25:14 +0000 (20:25 +0000)
Fix VERR and VERW.

svn path=/trunk/; revision=68016

reactos/lib/fast486/opgroups.c

index f540904..e3e6ba7 100644 (file)
@@ -2002,13 +2002,6 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeGroup0F00)
                 return;
             }
 
                 return;
             }
 
-            /* This is a privileged instruction */
-            if (Fast486GetCurrentPrivLevel(State) != 0)
-            {
-                Fast486Exception(State, FAST486_EXCEPTION_GP);
-                return;
-            }
-
             if (!Fast486ReadModrmWordOperands(State,
                                               &ModRegRm,
                                               NULL,
             if (!Fast486ReadModrmWordOperands(State,
                                               &ModRegRm,
                                               NULL,
@@ -2033,23 +2026,23 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeGroup0F00)
 
             /* Set ZF if it is valid and accessible */
             State->Flags.Zf = GdtEntry.Present // must be present
 
             /* Set ZF if it is valid and accessible */
             State->Flags.Zf = GdtEntry.Present // must be present
-                               && GdtEntry.SystemType // must be a segment
-                               && (((ModRegRm.Register == 4)
-                               /* code segments are only readable if the RW bit is set */
-                               && (!GdtEntry.Executable || GdtEntry.ReadWrite))
-                               || ((ModRegRm.Register == 5)
-                               /* code segments are never writable, data segments are writable when RW is set */
-                               && (!GdtEntry.Executable && GdtEntry.ReadWrite)))
-                               /*
-                                * for segments other than conforming code segments,
-                                * both RPL and CPL must be less than or equal to DPL
-                                */
-                               && ((!GdtEntry.Executable || !GdtEntry.DirConf)
-                               && ((GET_SEGMENT_RPL(Selector) <= GdtEntry.Dpl)
-                               && (Fast486GetCurrentPrivLevel(State) <= GdtEntry.Dpl)))
-                               /* for conforming code segments, DPL must be less than or equal to CPL */
-                               && ((GdtEntry.Executable && GdtEntry.DirConf)
-                               && (GdtEntry.Dpl <= Fast486GetCurrentPrivLevel(State)));
+                              && GdtEntry.SystemType // must be a segment
+                              && (((ModRegRm.Register == 4)
+                              /* code segments are only readable if the RW bit is set */
+                              && (!GdtEntry.Executable || GdtEntry.ReadWrite))
+                              || ((ModRegRm.Register == 5)
+                              /* code segments are never writable, data segments are writable when RW is set */
+                              && (!GdtEntry.Executable && GdtEntry.ReadWrite)))
+                              /*
+                               * for segments other than conforming code segments,
+                               * both RPL and CPL must be less than or equal to DPL
+                               */
+                              && (((!GdtEntry.Executable || !GdtEntry.DirConf)
+                              && (GET_SEGMENT_RPL(Selector) <= GdtEntry.Dpl)
+                              && (Fast486GetCurrentPrivLevel(State) <= GdtEntry.Dpl))
+                              /* for conforming code segments, DPL must be less than or equal to CPL */
+                              || ((GdtEntry.Executable && GdtEntry.DirConf)
+                              && (GdtEntry.Dpl <= Fast486GetCurrentPrivLevel(State))));
 
 
             break;
 
 
             break;