Author: hbelusca
Date: Sat Oct 4 15:41:29 2014
New Revision: 64523
URL:
http://svn.reactos.org/svn/reactos?rev=64523&view=rev
Log:
[NTVDM]
- Move registers code into cpu/
- Implement getIntelRegistersPointer.
Added:
trunk/reactos/subsystems/ntvdm/cpu/registers.c
- copied, changed from r64477, trunk/reactos/subsystems/ntvdm/registers.c
trunk/reactos/subsystems/ntvdm/cpu/registers.h
- copied, changed from r64477, trunk/reactos/subsystems/ntvdm/registers.h
trunk/reactos/subsystems/ntvdm/cpu/x86context.h (with props)
Removed:
trunk/reactos/subsystems/ntvdm/registers.c
trunk/reactos/subsystems/ntvdm/registers.h
Modified:
trunk/reactos/subsystems/ntvdm/CMakeLists.txt
trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c
Modified: trunk/reactos/subsystems/ntvdm/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/CMakeList…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] Sat Oct 4 15:41:29 2014
@@ -17,6 +17,7 @@
cpu/bop.c
cpu/callback.c
cpu/cpu.c
+ cpu/registers.c
hardware/cmos.c
hardware/keyboard.c
hardware/mouse.c
@@ -34,7 +35,6 @@
emulator.c
int32.c
io.c
- registers.c
utils.c
vddsup.c
ntvdm.c
Copied: trunk/reactos/subsystems/ntvdm/cpu/registers.c (from r64477,
trunk/reactos/subsystems/ntvdm/registers.c)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/cpu/regis…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/registers.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/cpu/registers.c [iso-8859-1] Sat Oct 4 15:41:29 2014
@@ -11,23 +11,83 @@
#define NDEBUG
#include "emulator.h"
-#include "cpu/cpu.h"
+#include "cpu.h"
+#include "x86context.h"
+
+/* PRIVATE VARIABLES **********************************************************/
+
+// This structure must by synced with our CPU context
+X86CONTEXT IntelRegPtr;
/* PUBLIC FUNCTIONS ***********************************************************/
-VOID EmulatorSetStack(WORD Segment, DWORD Offset)
-{
- Fast486SetStack(&EmulatorContext, Segment, Offset);
-}
-
-
-
PVOID
WINAPI
getIntelRegistersPointer(VOID)
{
- UNIMPLEMENTED;
- return NULL;
+ /*
+ * Sync the Intel Registers x86 Context with our CPU context
+ */
+
+ if (IntelRegPtr.ContextFlags & CONTEXT_DEBUG_REGISTERS)
+ {
+ IntelRegPtr.Dr0 = EmulatorContext.DebugRegisters[FAST486_REG_DR0];
+ IntelRegPtr.Dr1 = EmulatorContext.DebugRegisters[FAST486_REG_DR1];
+ IntelRegPtr.Dr2 = EmulatorContext.DebugRegisters[FAST486_REG_DR2];
+ IntelRegPtr.Dr3 = EmulatorContext.DebugRegisters[FAST486_REG_DR3];
+ IntelRegPtr.Dr6 = EmulatorContext.DebugRegisters[FAST486_REG_DR6];
+ IntelRegPtr.Dr7 = EmulatorContext.DebugRegisters[FAST486_REG_DR7];
+ }
+
+ if (IntelRegPtr.ContextFlags & CONTEXT_FLOATING_POINT)
+ {
+ // IntelRegPtr.FloatSave = ;
+ IntelRegPtr.FloatSave.ControlWord = EmulatorContext.FpuControl.Value;
+ IntelRegPtr.FloatSave.StatusWord = EmulatorContext.FpuStatus.Value;
+ // IntelRegPtr.FloatSave.TagWord = ;
+ // IntelRegPtr.FloatSave.ErrorOffset = ;
+ // IntelRegPtr.FloatSave.ErrorSelector = ;
+ // IntelRegPtr.FloatSave.DataOffset = ;
+ // IntelRegPtr.FloatSave.DataSelector = ;
+ // IntelRegPtr.FloatSave.RegisterArea = ; // This is a region of size
SIZE_OF_80387_REGISTERS == 80 bytes
+ // IntelRegPtr.FloatSave.Cr0NpxState = ;
+ }
+
+ if (IntelRegPtr.ContextFlags & CONTEXT_SEGMENTS)
+ {
+ IntelRegPtr.SegGs = EmulatorContext.SegmentRegs[FAST486_REG_GS].Selector;
+ IntelRegPtr.SegFs = EmulatorContext.SegmentRegs[FAST486_REG_FS].Selector;
+ IntelRegPtr.SegEs = EmulatorContext.SegmentRegs[FAST486_REG_ES].Selector;
+ IntelRegPtr.SegDs = EmulatorContext.SegmentRegs[FAST486_REG_DS].Selector;
+ }
+
+ if (IntelRegPtr.ContextFlags & CONTEXT_INTEGER)
+ {
+ IntelRegPtr.Edi = EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long;
+ IntelRegPtr.Esi = EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long;
+ IntelRegPtr.Ebx = EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long;
+ IntelRegPtr.Edx = EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long;
+ IntelRegPtr.Ecx = EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long;
+ IntelRegPtr.Eax = EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long;
+ }
+
+ if (IntelRegPtr.ContextFlags & CONTEXT_CONTROL)
+ {
+ IntelRegPtr.Ebp = EmulatorContext.GeneralRegs[FAST486_REG_EBP].Long;
+ IntelRegPtr.Eip = EmulatorContext.InstPtr.Long;
+ IntelRegPtr.SegCs = EmulatorContext.SegmentRegs[FAST486_REG_CS].Selector;
+ IntelRegPtr.EFlags = EmulatorContext.Flags.Long;
+ IntelRegPtr.Esp = EmulatorContext.GeneralRegs[FAST486_REG_ESP].Long;
+ IntelRegPtr.SegSs = EmulatorContext.SegmentRegs[FAST486_REG_SS].Selector;
+ }
+
+ if (IntelRegPtr.ContextFlags & CONTEXT_EXTENDED_REGISTERS)
+ {
+ // IntelRegPtr.ExtendedRegisters = ;
+ }
+
+ /* Return the address of the Intel Registers x86 Context */
+ return &IntelRegPtr;
}
ULONG
@@ -271,7 +331,7 @@
WINAPI
setESP(ULONG Value)
{
- EmulatorSetStack(getSS(), Value);
+ Fast486SetStack(&EmulatorContext, getSS(), Value);
}
USHORT
@@ -285,7 +345,7 @@
WINAPI
setSP(USHORT Value)
{
- EmulatorSetStack(getSS(), Value);
+ Fast486SetStack(&EmulatorContext, getSS(), Value);
}
Copied: trunk/reactos/subsystems/ntvdm/cpu/registers.h (from r64477,
trunk/reactos/subsystems/ntvdm/registers.h)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/cpu/regis…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/registers.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/cpu/registers.h [iso-8859-1] Sat Oct 4 15:41:29 2014
@@ -10,8 +10,6 @@
#define _REGISTERS_H_
/* INCLUDES *******************************************************************/
-
-VOID EmulatorSetStack(WORD Segment, DWORD Offset);
#if 0 // Those function prototypes are already included via ddk/vddsvc.h
Added: trunk/reactos/subsystems/ntvdm/cpu/x86context.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/cpu/x86co…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/cpu/x86context.h (added)
+++ trunk/reactos/subsystems/ntvdm/cpu/x86context.h [iso-8859-1] Sat Oct 4 15:41:29 2014
@@ -0,0 +1,139 @@
+/*
+ * COPYRIGHT: GPL - See COPYING in the top level directory
+ * PROJECT: ReactOS Virtual DOS Machine
+ * FILE: x86context.h
+ * PURPOSE: x86 CPU Context Frame definitions
+ * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ *
+ * NOTE: Taken from the PSDK.
+ */
+
+#ifndef __X86CONTEXT_H__
+#define __X86CONTEXT_H__
+
+#pragma once
+
+/* Clean everything that may have been defined before */
+#undef SIZE_OF_80387_REGISTERS
+#undef MAXIMUM_SUPPORTED_EXTENSION
+#undef CONTEXT_i386
+#undef CONTEXT_i486
+#undef CONTEXT_CONTROL
+#undef CONTEXT_INTEGER
+#undef CONTEXT_SEGMENTS
+#undef CONTEXT_FLOATING_POINT
+#undef CONTEXT_DEBUG_REGISTERS
+#undef CONTEXT_EXTENDED_REGISTERS
+#undef CONTEXT_FULL
+#undef CONTEXT_ALL
+#undef CONTEXT_DEBUGGER
+#undef CONTEXT_XSTATE
+
+
+
+#define SIZE_OF_80387_REGISTERS 80
+#define MAXIMUM_SUPPORTED_EXTENSION 512
+
+#define CONTEXT_i386 0x00010000
+#define CONTEXT_i486 0x00010000
+
+#define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L) // SS:SP, CS:IP, FLAGS, BP
+#define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L) // AX, BX, CX, DX, SI, DI
+#define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L) // DS, ES, FS, GS
+#define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L) // 387 state
+#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L) // DB 0-3,6,7
+#define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L) // CPU-specific extensions
+
+#define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
+#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | \
+ CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | \
+ CONTEXT_EXTENDED_REGISTERS)
+
+#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
+#define CONTEXT_XSTATE (CONTEXT_i386 | 0x00000040L)
+
+
+typedef struct _X87FLOATING_SAVE_AREA
+{
+ ULONG ControlWord;
+ ULONG StatusWord;
+ ULONG TagWord;
+ ULONG ErrorOffset;
+ ULONG ErrorSelector;
+ ULONG DataOffset;
+ ULONG DataSelector;
+ UCHAR RegisterArea[SIZE_OF_80387_REGISTERS];
+ ULONG Cr0NpxState;
+} X87FLOATING_SAVE_AREA, *PX87FLOATING_SAVE_AREA;
+
+#include "pshpack4.h"
+/*
+ * x86 CPU Context Frame
+ */
+typedef struct _X86CONTEXT
+{
+ /*
+ * The flags values within this flag control the contents of
+ * a CONTEXT record.
+ */
+ ULONG ContextFlags;
+
+ /*
+ * Section specified/returned if CONTEXT_DEBUG_REGISTERS
+ * is set in ContextFlags.
+ */
+ ULONG Dr0;
+ ULONG Dr1;
+ ULONG Dr2;
+ ULONG Dr3;
+ ULONG Dr6;
+ ULONG Dr7;
+
+ /*
+ * Section specified/returned if CONTEXT_FLOATING_POINT
+ * is set in ContextFlags.
+ */
+ X87FLOATING_SAVE_AREA FloatSave;
+
+ /*
+ * Section specified/returned if CONTEXT_SEGMENTS
+ * is set in ContextFlags.
+ */
+ ULONG SegGs;
+ ULONG SegFs;
+ ULONG SegEs;
+ ULONG SegDs;
+
+ /*
+ * Section specified/returned if CONTEXT_INTEGER
+ * is set in ContextFlags.
+ */
+ ULONG Edi;
+ ULONG Esi;
+ ULONG Ebx;
+ ULONG Edx;
+ ULONG Ecx;
+ ULONG Eax;
+
+ /*
+ * Section specified/returned if CONTEXT_CONTROL
+ * is set in ContextFlags.
+ */
+ ULONG Ebp;
+ ULONG Eip;
+ ULONG SegCs;
+ ULONG EFlags;
+ ULONG Esp;
+ ULONG SegSs;
+
+ /*
+ * Section specified/returned if CONTEXT_EXTENDED_REGISTERS
+ * is set in ContextFlags. The format and contexts are processor specific.
+ */
+ UCHAR ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
+} X86CONTEXT;
+#include "poppack.h"
+
+#endif // __X86CONTEXT_H__
+
+/* EOF */
Propchange: trunk/reactos/subsystems/ntvdm/cpu/x86context.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Sat Oct 4 15:41:29
2014
@@ -19,7 +19,6 @@
#include "dos/dem.h"
#include "bios/bios.h"
-#include "registers.h"
/* PRIVATE VARIABLES **********************************************************/
@@ -1057,8 +1056,8 @@
setES(Segment);
/* Set the stack to the location from the header */
- EmulatorSetStack(Segment + (sizeof(DOS_PSP) >> 4) + Header->e_ss,
- Header->e_sp);
+ setSS(Segment + (sizeof(DOS_PSP) >> 4) + Header->e_ss);
+ setSP(Header->e_sp);
/* Execute */
CurrentPsp = Segment;
@@ -1111,7 +1110,8 @@
setES(Segment);
/* Set the stack to the last word of the segment */
- EmulatorSetStack(Segment, 0xFFFE);
+ setSS(Segment);
+ setSP(0xFFFE);
/*
* Set the value on the stack to 0, so that a near return
Removed: trunk/reactos/subsystems/ntvdm/registers.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/registers…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/registers.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/registers.c (removed)
@@ -1,645 +0,0 @@
-/*
- * COPYRIGHT: GPL - See COPYING in the top level directory
- * PROJECT: ReactOS Virtual DOS Machine
- * FILE: registers.c
- * PURPOSE: Exported functions for manipulating registers
- * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
- */
-
-/* INCLUDES *******************************************************************/
-
-#define NDEBUG
-
-#include "emulator.h"
-#include "cpu/cpu.h"
-
-/* PUBLIC FUNCTIONS ***********************************************************/
-
-VOID EmulatorSetStack(WORD Segment, DWORD Offset)
-{
- Fast486SetStack(&EmulatorContext, Segment, Offset);
-}
-
-
-
-PVOID
-WINAPI
-getIntelRegistersPointer(VOID)
-{
- UNIMPLEMENTED;
- return NULL;
-}
-
-ULONG
-WINAPI
-getEAX(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long;
-}
-
-VOID
-WINAPI
-setEAX(ULONG Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long = Value;
-}
-
-USHORT
-WINAPI
-getAX(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowWord;
-}
-
-VOID
-WINAPI
-setAX(USHORT Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowWord = Value;
-}
-
-UCHAR
-WINAPI
-getAH(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EAX].HighByte;
-}
-
-VOID
-WINAPI
-setAH(UCHAR Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EAX].HighByte = Value;
-}
-
-UCHAR
-WINAPI
-getAL(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowByte;
-}
-
-VOID
-WINAPI
-setAL(UCHAR Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowByte = Value;
-}
-
-ULONG
-WINAPI
-getEBX(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long;
-}
-
-VOID
-WINAPI
-setEBX(ULONG Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long = Value;
-}
-
-USHORT
-WINAPI
-getBX(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowWord;
-}
-
-VOID
-WINAPI
-setBX(USHORT Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowWord = Value;
-}
-
-UCHAR
-WINAPI
-getBH(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EBX].HighByte;
-}
-
-VOID
-WINAPI
-setBH(UCHAR Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EBX].HighByte = Value;
-}
-
-UCHAR
-WINAPI
-getBL(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowByte;
-}
-
-VOID
-WINAPI
-setBL(UCHAR Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowByte = Value;
-}
-
-
-
-ULONG
-WINAPI
-getECX(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long;
-}
-
-VOID
-WINAPI
-setECX(ULONG Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long = Value;
-}
-
-USHORT
-WINAPI
-getCX(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowWord;
-}
-
-VOID
-WINAPI
-setCX(USHORT Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowWord = Value;
-}
-
-UCHAR
-WINAPI
-getCH(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_ECX].HighByte;
-}
-
-VOID
-WINAPI
-setCH(UCHAR Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_ECX].HighByte = Value;
-}
-
-UCHAR
-WINAPI
-getCL(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowByte;
-}
-
-VOID
-WINAPI
-setCL(UCHAR Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowByte = Value;
-}
-
-
-
-ULONG
-WINAPI
-getEDX(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long;
-}
-
-VOID
-WINAPI
-setEDX(ULONG Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long = Value;
-}
-
-USHORT
-WINAPI
-getDX(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowWord;
-}
-
-VOID
-WINAPI
-setDX(USHORT Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowWord = Value;
-}
-
-UCHAR
-WINAPI
-getDH(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EDX].HighByte;
-}
-
-VOID
-WINAPI
-setDH(UCHAR Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EDX].HighByte = Value;
-}
-
-UCHAR
-WINAPI
-getDL(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowByte;
-}
-
-VOID
-WINAPI
-setDL(UCHAR Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowByte = Value;
-}
-
-
-
-ULONG
-WINAPI
-getESP(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_ESP].Long;
-}
-
-VOID
-WINAPI
-setESP(ULONG Value)
-{
- EmulatorSetStack(getSS(), Value);
-}
-
-USHORT
-WINAPI
-getSP(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_ESP].LowWord;
-}
-
-VOID
-WINAPI
-setSP(USHORT Value)
-{
- EmulatorSetStack(getSS(), Value);
-}
-
-
-
-ULONG
-WINAPI
-getEBP(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EBP].Long;
-}
-
-VOID
-WINAPI
-setEBP(ULONG Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EBP].Long = Value;
-}
-
-USHORT
-WINAPI
-getBP(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EBP].LowWord;
-}
-
-VOID
-WINAPI
-setBP(USHORT Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EBP].LowWord = Value;
-}
-
-
-
-ULONG
-WINAPI
-getESI(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long;
-}
-
-VOID
-WINAPI
-setESI(ULONG Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long = Value;
-}
-
-USHORT
-WINAPI
-getSI(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_ESI].LowWord;
-}
-
-VOID
-WINAPI
-setSI(USHORT Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_ESI].LowWord = Value;
-}
-
-
-
-ULONG
-WINAPI
-getEDI(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long;
-}
-
-VOID
-WINAPI
-setEDI(ULONG Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long = Value;
-}
-
-USHORT
-WINAPI
-getDI(VOID)
-{
- return EmulatorContext.GeneralRegs[FAST486_REG_EDI].LowWord;
-}
-
-VOID
-WINAPI
-setDI(USHORT Value)
-{
- EmulatorContext.GeneralRegs[FAST486_REG_EDI].LowWord = Value;
-}
-
-
-
-ULONG
-WINAPI
-getEIP(VOID)
-{
- return EmulatorContext.InstPtr.Long;
-}
-
-VOID
-WINAPI
-setEIP(ULONG Value)
-{
- CpuExecute(getCS(), Value);
-}
-
-USHORT
-WINAPI
-getIP(VOID)
-{
- return EmulatorContext.InstPtr.LowWord;
-}
-
-VOID
-WINAPI
-setIP(USHORT Value)
-{
- CpuExecute(getCS(), Value);
-}
-
-
-
-USHORT
-WINAPI
-getCS(VOID)
-{
- return EmulatorContext.SegmentRegs[FAST486_REG_CS].Selector;
-}
-
-VOID
-WINAPI
-setCS(USHORT Value)
-{
- Fast486SetSegment(&EmulatorContext, FAST486_REG_CS, Value);
-}
-
-USHORT
-WINAPI
-getSS(VOID)
-{
- return EmulatorContext.SegmentRegs[FAST486_REG_SS].Selector;
-}
-
-VOID
-WINAPI
-setSS(USHORT Value)
-{
- Fast486SetSegment(&EmulatorContext, FAST486_REG_SS, Value);
-}
-
-USHORT
-WINAPI
-getDS(VOID)
-{
- return EmulatorContext.SegmentRegs[FAST486_REG_DS].Selector;
-}
-
-VOID
-WINAPI
-setDS(USHORT Value)
-{
- Fast486SetSegment(&EmulatorContext, FAST486_REG_DS, Value);
-}
-
-USHORT
-WINAPI
-getES(VOID)
-{
- return EmulatorContext.SegmentRegs[FAST486_REG_ES].Selector;
-}
-
-VOID
-WINAPI
-setES(USHORT Value)
-{
- Fast486SetSegment(&EmulatorContext, FAST486_REG_ES, Value);
-}
-
-USHORT
-WINAPI
-getFS(VOID)
-{
- return EmulatorContext.SegmentRegs[FAST486_REG_FS].Selector;
-}
-
-VOID
-WINAPI
-setFS(USHORT Value)
-{
- Fast486SetSegment(&EmulatorContext, FAST486_REG_FS, Value);
-}
-
-USHORT
-WINAPI
-getGS(VOID)
-{
- return EmulatorContext.SegmentRegs[FAST486_REG_GS].Selector;
-}
-
-VOID
-WINAPI
-setGS(USHORT Value)
-{
- Fast486SetSegment(&EmulatorContext, FAST486_REG_GS, Value);
-}
-
-
-
-ULONG
-WINAPI
-getCF(VOID)
-{
- return EmulatorContext.Flags.Cf;
-}
-
-VOID
-WINAPI
-setCF(ULONG Flag)
-{
- EmulatorContext.Flags.Cf = !!(Flag & 1);
-}
-
-ULONG
-WINAPI
-getPF(VOID)
-{
- return EmulatorContext.Flags.Pf;
-}
-
-VOID
-WINAPI
-setPF(ULONG Flag)
-{
- EmulatorContext.Flags.Pf = !!(Flag & 1);
-}
-
-ULONG
-WINAPI
-getAF(VOID)
-{
- return EmulatorContext.Flags.Af;
-}
-
-VOID
-WINAPI
-setAF(ULONG Flag)
-{
- EmulatorContext.Flags.Af = !!(Flag & 1);
-}
-
-ULONG
-WINAPI
-getZF(VOID)
-{
- return EmulatorContext.Flags.Zf;
-}
-
-VOID
-WINAPI
-setZF(ULONG Flag)
-{
- EmulatorContext.Flags.Zf = !!(Flag & 1);
-}
-
-ULONG
-WINAPI
-getSF(VOID)
-{
- return EmulatorContext.Flags.Sf;
-}
-
-VOID
-WINAPI
-setSF(ULONG Flag)
-{
- EmulatorContext.Flags.Sf = !!(Flag & 1);
-}
-
-ULONG
-WINAPI
-getIF(VOID)
-{
- return EmulatorContext.Flags.If;
-}
-
-VOID
-WINAPI
-setIF(ULONG Flag)
-{
- EmulatorContext.Flags.If = !!(Flag & 1);
-}
-
-ULONG
-WINAPI
-getDF(VOID)
-{
- return EmulatorContext.Flags.Df;
-}
-
-VOID
-WINAPI
-setDF(ULONG Flag)
-{
- EmulatorContext.Flags.Df = !!(Flag & 1);
-}
-
-ULONG
-WINAPI
-getOF(VOID)
-{
- return EmulatorContext.Flags.Of;
-}
-
-VOID
-WINAPI
-setOF(ULONG Flag)
-{
- EmulatorContext.Flags.Of = !!(Flag & 1);
-}
-
-
-
-ULONG
-WINAPI
-getEFLAGS(VOID)
-{
- return EmulatorContext.Flags.Long;
-}
-
-VOID
-WINAPI
-setEFLAGS(ULONG Flags)
-{
- EmulatorContext.Flags.Long = Flags;
-}
-
-
-
-USHORT
-WINAPI
-getMSW(VOID)
-{
- return LOWORD(EmulatorContext.ControlRegisters[FAST486_REG_CR0]);
-}
-
-VOID
-WINAPI
-setMSW(USHORT Value)
-{
- /* Set the lower 16 bits (Machine Status Word) of CR0 */
- EmulatorContext.ControlRegisters[FAST486_REG_CR0] &= 0xFFFF0000;
- EmulatorContext.ControlRegisters[FAST486_REG_CR0] |= Value & 0xFFFF;
-}
-
-/* EOF */
Removed: trunk/reactos/subsystems/ntvdm/registers.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/registers…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/registers.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/registers.h (removed)
@@ -1,123 +0,0 @@
-/*
- * COPYRIGHT: GPL - See COPYING in the top level directory
- * PROJECT: ReactOS Virtual DOS Machine
- * FILE: registers.c
- * PURPOSE: Exported functions for manipulating registers
- * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
- */
-
-#ifndef _REGISTERS_H_
-#define _REGISTERS_H_
-
-/* INCLUDES *******************************************************************/
-
-VOID EmulatorSetStack(WORD Segment, DWORD Offset);
-
-#if 0 // Those function prototypes are already included via ddk/vddsvc.h
-
-PVOID WINAPI getIntelRegistersPointer(VOID);
-
-ULONG WINAPI getEAX(VOID);
-VOID WINAPI setEAX(ULONG);
-USHORT WINAPI getAX(VOID);
-VOID WINAPI setAX(USHORT);
-UCHAR WINAPI getAH(VOID);
-VOID WINAPI setAH(UCHAR);
-UCHAR WINAPI getAL(VOID);
-VOID WINAPI setAL(UCHAR);
-
-ULONG WINAPI getEBX(VOID);
-VOID WINAPI setEBX(ULONG);
-USHORT WINAPI getBX(VOID);
-VOID WINAPI setBX(USHORT);
-UCHAR WINAPI getBH(VOID);
-VOID WINAPI setBH(UCHAR);
-UCHAR WINAPI getBL(VOID);
-VOID WINAPI setBL(UCHAR);
-
-ULONG WINAPI getECX(VOID);
-VOID WINAPI setECX(ULONG);
-USHORT WINAPI getCX(VOID);
-VOID WINAPI setCX(USHORT);
-UCHAR WINAPI getCH(VOID);
-VOID WINAPI setCH(UCHAR);
-UCHAR WINAPI getCL(VOID);
-VOID WINAPI setCL(UCHAR);
-
-ULONG WINAPI getEDX(VOID);
-VOID WINAPI setEDX(ULONG);
-USHORT WINAPI getDX(VOID);
-VOID WINAPI setDX(USHORT);
-UCHAR WINAPI getDH(VOID);
-VOID WINAPI setDH(UCHAR);
-UCHAR WINAPI getDL(VOID);
-VOID WINAPI setDL(UCHAR);
-
-
-
-ULONG WINAPI getESP(VOID);
-VOID WINAPI setESP(ULONG);
-USHORT WINAPI getSP(VOID);
-VOID WINAPI setSP(USHORT);
-
-ULONG WINAPI getEBP(VOID);
-VOID WINAPI setEBP(ULONG);
-USHORT WINAPI getBP(VOID);
-VOID WINAPI setBP(USHORT);
-
-ULONG WINAPI getESI(VOID);
-VOID WINAPI setESI(ULONG);
-USHORT WINAPI getSI(VOID);
-VOID WINAPI setSI(USHORT);
-
-ULONG WINAPI getEDI(VOID);
-VOID WINAPI setEDI(ULONG);
-USHORT WINAPI getDI(VOID);
-VOID WINAPI setDI(USHORT);
-
-ULONG WINAPI getEIP(VOID);
-VOID WINAPI setEIP(ULONG);
-USHORT WINAPI getIP(VOID);
-VOID WINAPI setIP(USHORT);
-
-USHORT WINAPI getCS(VOID);
-VOID WINAPI setCS(USHORT);
-USHORT WINAPI getSS(VOID);
-VOID WINAPI setSS(USHORT);
-USHORT WINAPI getDS(VOID);
-VOID WINAPI setDS(USHORT);
-USHORT WINAPI getES(VOID);
-VOID WINAPI setES(USHORT);
-USHORT WINAPI getFS(VOID);
-VOID WINAPI setFS(USHORT);
-USHORT WINAPI getGS(VOID);
-VOID WINAPI setGS(USHORT);
-
-ULONG WINAPI getCF(VOID);
-VOID WINAPI setCF(ULONG);
-ULONG WINAPI getPF(VOID);
-VOID WINAPI setPF(ULONG);
-ULONG WINAPI getAF(VOID);
-VOID WINAPI setAF(ULONG);
-ULONG WINAPI getZF(VOID);
-VOID WINAPI setZF(ULONG);
-ULONG WINAPI getSF(VOID);
-VOID WINAPI setSF(ULONG);
-ULONG WINAPI getIF(VOID);
-VOID WINAPI setIF(ULONG);
-ULONG WINAPI getDF(VOID);
-VOID WINAPI setDF(ULONG);
-ULONG WINAPI getOF(VOID);
-VOID WINAPI setOF(ULONG);
-
-ULONG WINAPI getEFLAGS(VOID);
-VOID WINAPI setEFLAGS(ULONG);
-
-USHORT WINAPI getMSW(VOID);
-VOID WINAPI setMSW(USHORT);
-
-#endif
-
-#endif // _REGISTERS_H_
-
-/* EOF */