Commit 37925eaf authored by Jukka Heinonen's avatar Jukka Heinonen Committed by Alexandre Julliard

Remove unnecessary __wine_call_from_16_regs call frame management code

from raw mode switch handler.
parent 5498cc51
......@@ -28,7 +28,6 @@
#include "miscemu.h"
struct _DOSEVENT;
struct _STACK16FRAME;
/* amount of space reserved for relay stack */
#define DOSVM_RELAY_DATA_SIZE 4096
......@@ -256,8 +255,6 @@ extern void DOSVM_SetRMHandler( BYTE, FARPROC16 );
/* relay.c */
void DOSVM_RelayHandler( CONTEXT86 * );
void DOSVM_SaveCallFrame( CONTEXT86 *, struct _STACK16FRAME * );
void DOSVM_RestoreCallFrame( CONTEXT86 *, struct _STACK16FRAME * );
void DOSVM_BuildCallFrame( CONTEXT86 *, DOSRELAY, LPVOID );
/* soundblaster.c */
......
......@@ -675,11 +675,11 @@ void WINAPI DPMI_FreeInternalRMCB( FARPROC16 proc )
/**********************************************************************
* RawModeSwitch (WINEDOS.@)
* DOSVM_RawModeSwitchHandler
*
* DPMI Raw Mode Switch handler
*/
void WINAPI DOSVM_RawModeSwitch( CONTEXT86 *context )
void WINAPI DOSVM_RawModeSwitchHandler( CONTEXT86 *context )
{
CONTEXT86 rm_ctx;
int ret;
......@@ -768,23 +768,6 @@ void WINAPI DOSVM_FreeRMCB( CONTEXT86 *context )
/**********************************************************************
* DOSVM_RawModeSwitchHandler
*
* DPMI Raw Mode Switch handler.
* This routine does all the stack manipulation tricks needed
* to return from protected mode interrupt using modified
* code and stack pointers.
*/
void WINAPI DOSVM_RawModeSwitchHandler( CONTEXT86 *context )
{
STACK16FRAME frame;
DOSVM_SaveCallFrame( context, &frame );
DOSVM_RawModeSwitch( context );
DOSVM_RestoreCallFrame( context, &frame );
}
/**********************************************************************
* DOSVM_CheckWrappers
*
* Check if this was really a wrapper call instead of an interrupt.
......
......@@ -172,81 +172,6 @@ void DOSVM_RelayHandler( CONTEXT86 *context )
/**********************************************************************
* DOSVM_SaveCallFrame
*
* Save current call frame. This routine must be called from DOSRELAY
* called using DOSVM_BuildCallFrame before the relay modifies stack
* pointer. This routine makes sure that the relay can return safely
* to application context and that no memory is leaked.
*
* Note: If DOSVM_BuildCallFrame was called using 32-bit CS or SS,
* old values of CS and SS will be lost. This does not matter
* since this routine is only used by Raw Mode Switch.
*/
void DOSVM_SaveCallFrame( CONTEXT86 *context, STACK16FRAME *frame )
{
*frame = *CURRENT_STACK16;
/*
* If context is using allocated stack, release it.
*/
if (context->SegSs == DOSVM_dpmi_segments->relay_data_sel)
{
RELAY_Stack16 *stack = RELAY_GetPointer( context->Esp );
if (!stack->inuse ||
stack->stack_bottom != RELAY_MAGIC ||
stack->stack_top != RELAY_MAGIC)
ERR( "Stack corrupted!\n" );
stack->inuse = 0;
}
}
/**********************************************************************
* DOSVM_RestoreCallFrame
*
* Restore saved call frame to currect stack. This routine must always
* be called after DOSVM_SaveCallFrame has been called and before returning
* from DOSRELAY.
*/
void DOSVM_RestoreCallFrame( CONTEXT86 *context, STACK16FRAME *frame )
{
/*
* Allocate separate stack for relay call.
*/
RELAY_MakeShortContext( context );
/*
* After this function returns to relay code, protected mode
* 16 bit stack will contain STACK16FRAME and single WORD
* (EFlags, see next comment).
*/
NtCurrentTeb()->cur_stack =
MAKESEGPTR( context->SegSs,
context->Esp - sizeof(STACK16FRAME) - sizeof(WORD) );
/*
* After relay code returns to glue function, protected
* mode 16 bit stack will contain interrupt return record:
* IP, CS and EFlags. Since EFlags is ignored, it won't
* need to be initialized.
*/
context->Esp -= 3 * sizeof(WORD);
/*
* Restore stack frame so that relay code won't be confused.
* It should be noted that relay code overwrites IP and CS
* in STACK16FRAME with values taken from current CONTEXT86.
* These values are what is returned to glue function
* (see previous comment).
*/
*CURRENT_STACK16 = *frame;
}
/**********************************************************************
* DOSVM_BuildCallFrame
*
* Modifies the context so that return to context calls DOSRELAY and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment