Author: aandrejevic Date: Sat Oct 26 17:33:10 2013 New Revision: 60752
URL: http://svn.reactos.org/svn/reactos?rev=60752&view=rev Log: [FAST486] Implement the CLTS instruction.
Modified: branches/ntvdm/lib/fast486/extraops.c branches/ntvdm/lib/fast486/extraops.h
Modified: branches/ntvdm/lib/fast486/extraops.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/extraops.c?rev... ============================================================================== --- branches/ntvdm/lib/fast486/extraops.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/extraops.c [iso-8859-1] Sat Oct 26 17:33:10 2013 @@ -45,7 +45,7 @@ NULL, // TODO: OPCODE 0x03 NOT IMPLEMENTED NULL, // TODO: OPCODE 0x04 NOT IMPLEMENTED NULL, // TODO: OPCODE 0x05 NOT IMPLEMENTED - NULL, // TODO: OPCODE 0x06 NOT IMPLEMENTED + Fast486ExtOpcodeClts, NULL, // TODO: OPCODE 0x07 NOT IMPLEMENTED NULL, // TODO: OPCODE 0x08 NOT IMPLEMENTED NULL, // TODO: OPCODE 0x09 NOT IMPLEMENTED @@ -299,6 +299,23 @@
/* PUBLIC FUNCTIONS ***********************************************************/
+FAST486_OPCODE_HANDLER(Fast486ExtOpcodeClts) +{ + NO_LOCK_PREFIX(); + + /* The current privilege level must be zero */ + if (Fast486GetCurrentPrivLevel(State) != 0) + { + Fast486Exception(State, FAST486_EXCEPTION_GP); + return FALSE; + } + + /* Clear the task switch bit */ + State->ControlRegisters[FAST486_REG_CR0] &= ~FAST486_CR0_TS; + + return TRUE; +} + FAST486_OPCODE_HANDLER(Fast486ExtOpcodeStoreControlReg) { BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
Modified: branches/ntvdm/lib/fast486/extraops.h URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/extraops.h?rev... ============================================================================== --- branches/ntvdm/lib/fast486/extraops.h [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/extraops.h [iso-8859-1] Sat Oct 26 17:33:10 2013 @@ -23,6 +23,7 @@ #define _EXTRAOPS_H_
/* DEFINES ********************************************************************/ +FAST486_OPCODE_HANDLER(Fast486ExtOpcodeClts); FAST486_OPCODE_HANDLER(Fast486ExtOpcodeStoreControlReg); FAST486_OPCODE_HANDLER(Fast486ExtOpcodeStoreDebugReg); FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLoadControlReg);