Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
46f29944
Commit
46f29944
authored
Oct 14, 2003
by
Jukka Heinonen
Committed by
Alexandre Julliard
Oct 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove races from DPMI async event handling.
parent
9b4b21b7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
45 deletions
+40
-45
instr.c
dlls/kernel/instr.c
+0
-6
signal_i386.c
dlls/ntdll/signal_i386.c
+40
-17
dosvm.c
dlls/winedos/dosvm.c
+0
-11
relay.c
dlls/winedos/relay.c
+0
-11
No files found.
dlls/kernel/instr.c
View file @
46f29944
...
...
@@ -779,12 +779,6 @@ DWORD INSTR_EmulateInstruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
case
0xfb
:
/* sti */
NtCurrentTeb
()
->
dpmi_vif
=
1
;
context
->
Eip
+=
prefixlen
+
1
;
if
(
NtCurrentTeb
()
->
vm86_pending
)
{
NtCurrentTeb
()
->
vm86_pending
=
0
;
rec
->
ExceptionCode
=
EXCEPTION_VM86_STI
;
return
ExceptionContinueSearch
;
}
return
ExceptionContinueExecution
;
}
return
ExceptionContinueSearch
;
/* Unable to emulate it */
...
...
dlls/ntdll/signal_i386.c
View file @
46f29944
...
...
@@ -595,9 +595,11 @@ static void save_context( CONTEXT *context, const SIGCONTEXT *sigcontext )
*
* Build a sigcontext from the register values.
*/
static
void
restore_context
(
const
CONTEXT
*
context
,
SIGCONTEXT
*
sigcontext
)
static
void
restore_context
(
CONTEXT
*
context
,
SIGCONTEXT
*
sigcontext
)
{
#ifdef __HAVE_VM86
BOOL
check_pending
=
TRUE
;
/* check if exception occurred in vm86 mode */
if
((
void
*
)
EIP_sig
(
sigcontext
)
==
vm86_return
&&
IS_SELECTOR_SYSTEM
(
CS_sig
(
sigcontext
))
&&
...
...
@@ -610,6 +612,43 @@ static void restore_context( const CONTEXT *context, SIGCONTEXT *sigcontext )
restore_vm86_context
(
context
,
vm86
);
return
;
}
while
(
NtCurrentTeb
()
->
dpmi_vif
&&
!
IS_SELECTOR_SYSTEM
(
context
->
SegCs
)
&&
!
IS_SELECTOR_SYSTEM
(
context
->
SegSs
)
&&
check_pending
)
{
/*
* Executing DPMI code and virtual interrupts are enabled.
* We must block signals so that we can be safely check
* for pending asynchronous events. Return from signal handler
* will unblock signals again so it is is safe to do so.
*/
SIGNAL_Block
();
check_pending
=
FALSE
;
if
(
NtCurrentTeb
()
->
vm86_pending
)
{
EXCEPTION_RECORD
rec
;
rec
.
ExceptionAddress
=
(
LPVOID
)
context
->
Eip
;
rec
.
ExceptionCode
=
EXCEPTION_VM86_STI
;
rec
.
ExceptionFlags
=
EXCEPTION_CONTINUABLE
;
rec
.
ExceptionRecord
=
NULL
;
rec
.
NumberParameters
=
1
;
rec
.
ExceptionInformation
[
0
]
=
0
;
NtCurrentTeb
()
->
vm86_pending
=
0
;
EXC_RtlRaiseException
(
&
rec
,
context
);
/*
* EXC_RtlRaiseException has unblocked all signals
* and we must retry check for pending asynchronous
* events in order to prevent races.
*/
check_pending
=
TRUE
;
}
}
#endif
/* __HAVE_VM86 */
EAX_sig
(
sigcontext
)
=
context
->
Eax
;
...
...
@@ -977,22 +1016,6 @@ static void set_vm86_pend( CONTEXT *context )
restore_vm86_context
(
&
vcontext
,
vm86
);
}
}
else
if
(
teb
->
dpmi_vif
&&
!
IS_SELECTOR_SYSTEM
(
context
->
SegCs
)
&&
!
IS_SELECTOR_SYSTEM
(
context
->
SegSs
))
{
/* Executing DPMI code and virtual interrupts are enabled. */
teb
->
vm86_pending
=
0
;
rec
.
ExceptionAddress
=
(
LPVOID
)
context
->
Eip
;
EXC_RtlRaiseException
(
&
rec
,
context
);
/*
* EXC_RtlRaiseException has unblocked all signals and this
* signal handler is about to return to either DOS relay or
* IRQ handler. Because both of these will check pending
* interrupts again, it is not a problem if we receive
* a nested SIGUSR2 here and ignore it.
*/
}
}
...
...
dlls/winedos/dosvm.c
View file @
46f29944
...
...
@@ -227,17 +227,6 @@ void DOSVM_SendQueuedEvents( CONTEXT86 *context )
#ifdef MZ_SUPPORTED
if
(
!
ISV86
(
context
)
&&
context
->
SegCs
==
old_cs
&&
context
->
Eip
==
old_ip
)
{
/*
* Routine was called from DPMI but there was nothing to do.
* We force a dummy relay call here so that we don't get a race
* if signals are unblocked when we return to DPMI application.
*/
TRACE
(
"Called but there was nothing to do, calling NULL relay.
\n
"
);
DOSVM_BuildCallFrame
(
context
,
NULL
,
NULL
);
}
if
(
DOSVM_HasPendingEvents
())
{
/*
...
...
dlls/winedos/relay.c
View file @
46f29944
...
...
@@ -157,17 +157,6 @@ void DOSVM_RelayHandler( CONTEXT86 *context )
ERR
(
"Stack corrupted!
\n
"
);
stack
->
inuse
=
0
;
/*
* We have now restored original stack and instruction pointers.
* Because signals are blocked here, this is a safe place to
* check for pending events before we return to application context.
*/
if
(
NtCurrentTeb
()
->
vm86_pending
&&
NtCurrentTeb
()
->
dpmi_vif
)
{
NtCurrentTeb
()
->
vm86_pending
=
0
;
DOSVM_SendQueuedEvents
(
context
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment