Author: aandrejevic
Date: Sat Oct 12 13:58:34 2013
New Revision: 60628
URL:
http://svn.reactos.org/svn/reactos?rev=60628&view=rev
Log:
[SOFT386]
Implement Soft386Interrupt.
[NTVDM]
Implement EmulatorInterrupt and EmulatorExternalInterrupt for NEW_EMULATOR.
Modified:
branches/ntvdm/include/reactos/libs/soft386/soft386.h
branches/ntvdm/lib/soft386/soft386.c
branches/ntvdm/subsystems/ntvdm/emulator.c
Modified: branches/ntvdm/include/reactos/libs/soft386/soft386.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/reactos/libs/soft…
==============================================================================
--- branches/ntvdm/include/reactos/libs/soft386/soft386.h [iso-8859-1] (original)
+++ branches/ntvdm/include/reactos/libs/soft386/soft386.h [iso-8859-1] Sat Oct 12 13:58:34
2013
@@ -359,7 +359,7 @@
VOID
NTAPI
-Soft386Interrupt(PSOFT386_STATE State, UCHAR Number);
+Soft386Interrupt(PSOFT386_STATE State, UCHAR Number, BOOLEAN Hardware);
VOID
NTAPI
Modified: branches/ntvdm/lib/soft386/soft386.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/soft386.c?rev…
==============================================================================
--- branches/ntvdm/lib/soft386/soft386.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/soft386/soft386.c [iso-8859-1] Sat Oct 12 13:58:34 2013
@@ -273,10 +273,27 @@
VOID
NTAPI
-Soft386Interrupt(PSOFT386_STATE State, UCHAR Number)
-{
- // TODO: NOT IMPLEMENTED!!!
- UNIMPLEMENTED;
+Soft386Interrupt(PSOFT386_STATE State, UCHAR Number, BOOLEAN Hardware)
+{
+ SOFT386_IDT_ENTRY IdtEntry;
+
+ if (Hardware)
+ {
+ /* Set the hardware interrupt flag */
+ State->HardwareInt = TRUE;
+ }
+
+ if (!Soft386GetIntVector(State, Number, &IdtEntry))
+ {
+ /* An exception occurred, let the handler execute */
+ return;
+ }
+
+ /* Perform the interrupt */
+ Soft386InterruptInternal(State,
+ IdtEntry.Selector,
+ MAKELONG(IdtEntry.Offset, IdtEntry.OffsetHigh),
+ IdtEntry.Type);
}
VOID
Modified: branches/ntvdm/subsystems/ntvdm/emulator.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Sat Oct 12 13:58:34 2013
@@ -461,6 +461,7 @@
VOID EmulatorInterrupt(BYTE Number)
{
+#ifndef NEW_EMULATOR
LPDWORD IntVecTable = (LPDWORD)((ULONG_PTR)BaseAddress);
UINT Segment, Offset;
@@ -468,13 +469,11 @@
Segment = HIWORD(IntVecTable[Number]);
Offset = LOWORD(IntVecTable[Number]);
-#ifndef NEW_EMULATOR
/* Call the softx86 API */
softx86_make_simple_interrupt_call(&EmulatorContext, &Segment, &Offset);
#else
- UNREFERENCED_PARAMETER(Segment);
- UNREFERENCED_PARAMETER(Offset);
- // TODO: NOT IMPLEMENTED
+ /* Call the Soft386 API */
+ Soft386Interrupt(&EmulatorContext, Number, FALSE);
#endif
}
@@ -483,6 +482,9 @@
#ifndef NEW_EMULATOR
/* Call the softx86 API */
softx86_ext_hw_signal(&EmulatorContext, Number);
+#else
+ /* Call the Soft386 API */
+ Soft386Interrupt(&EmulatorContext, Number, TRUE);
#endif
}