Author: aandrejevic
Date: Mon Nov 11 15:27:54 2013
New Revision: 60939
URL:
http://svn.reactos.org/svn/reactos?rev=60939&view=rev
Log:
[FAST486]
Fix Fast486GetCurrentPrivLevel.
Modified:
branches/ntvdm/lib/fast486/common.h
Modified: branches/ntvdm/lib/fast486/common.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/common.h?rev=…
==============================================================================
--- branches/ntvdm/lib/fast486/common.h [iso-8859-1] (original)
+++ branches/ntvdm/lib/fast486/common.h [iso-8859-1] Mon Nov 11 15:27:54 2013
@@ -167,7 +167,16 @@
INT
Fast486GetCurrentPrivLevel(PFAST486_STATE State)
{
- return GET_SEGMENT_RPL(State->SegmentRegs[FAST486_REG_CS].Selector);
+ if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
+ {
+ /* In protected mode, return the RPL of the CS */
+ return GET_SEGMENT_RPL(State->SegmentRegs[FAST486_REG_CS].Selector);
+ }
+ else
+ {
+ /* Real mode is always in supervisor mode */
+ return 0;
+ }
}
#include "common.inl"