Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Münchhalfen
wine
Commits
d94b6319
Commit
d94b6319
authored
24 years ago
by
Ove Kåven
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a couple of recent bugs, and added some more safeguards (could
be handy for portability anyway) and trace statements.
parent
57f05e19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loader/dos/dosvm.c
+14
-6
14 additions, 6 deletions
loader/dos/dosvm.c
with
14 additions
and
6 deletions
loader/dos/dosvm.c
+
14
−
6
View file @
d94b6319
...
...
@@ -51,6 +51,7 @@ DECLARE_DEBUG_CHANNEL(relay)
#endif
#define IF_CLR(ctx) ((ctx)->EFlags &= ~VIF_MASK)
#define IF_SET(ctx) ((ctx)->EFlags |= VIF_MASK)
#define IF_ENABLED(ctx) ((ctx)->EFlags & VIF_MASK)
#define SET_PEND(ctx) ((ctx)->EFlags |= VIP_MASK)
#define CLR_PEND(ctx) ((ctx)->EFlags &= ~VIP_MASK)
...
...
@@ -126,7 +127,7 @@ static void DOSVM_Dump( int fn, int sig, struct vm86plus_struct*VM86 )
printf
(
"
\n
"
);
}
static
int
DOSVM_SimulateInt
(
int
vect
,
CONTEXT86
*
context
)
static
int
DOSVM_SimulateInt
(
int
vect
,
CONTEXT86
*
context
,
BOOL
inwine
)
{
FARPROC16
handler
=
INT_GetRMHandler
(
vect
);
...
...
@@ -139,12 +140,17 @@ static int DOSVM_SimulateInt( int vect, CONTEXT86 *context )
/* we could probably move some other dodgy stuff here too from dpmi.c */
}
/* check if the call is from our fake BIOS interrupt stubs */
if
(
context
->
SegCs
==
0xf000
)
{
if
((
context
->
SegCs
==
0xf000
)
&&
!
inwine
)
{
if
(
vect
!=
(
context
->
Eip
/
4
))
{
TRACE_
(
int
)(
"something fishy going on here (interrupt stub is %02lx)
\n
"
,
context
->
Eip
/
4
);
}
TRACE_
(
int
)(
"builtin interrupt %02x has been branched to
\n
"
,
vect
);
INT_RealModeInterrupt
(
vect
,
context
);
}
/* check if the call goes to an unhooked interrupt */
else
if
(
SELECTOROF
(
handler
)
==
0xf000
)
{
/* if so, call it directly */
TRACE_
(
int
)(
"builtin interrupt %02x has been invoked (through vector %02x)
\n
"
,
OFFSETOF
(
handler
)
/
4
,
vect
);
INT_RealModeInterrupt
(
OFFSETOF
(
handler
)
/
4
,
context
);
}
/* the interrupt is hooked, simulate interrupt in DOS space */
...
...
@@ -184,7 +190,7 @@ static void DOSVM_SendQueuedEvent(CONTEXT86 *context)
TRACE_
(
int
)(
"dispatching IRQ %d
\n
"
,
event
->
irq
);
/* note that if DOSVM_SimulateInt calls an internal interrupt directly,
* current_event might be cleared (and event freed) in this very call! */
DOSVM_SimulateInt
((
event
->
irq
<
8
)
?
(
event
->
irq
+
8
)
:
(
event
->
irq
-
8
+
0x70
),
context
);
DOSVM_SimulateInt
((
event
->
irq
<
8
)
?
(
event
->
irq
+
8
)
:
(
event
->
irq
-
8
+
0x70
),
context
,
TRUE
);
}
else
{
/* callback event */
TRACE_
(
int
)(
"dispatching callback event
\n
"
);
...
...
@@ -319,13 +325,14 @@ static int DOSVM_Process( int fn, int sig, struct vm86plus_struct*VM86 )
case
VM86_INTx
:
if
(
TRACE_ON
(
relay
))
DPRINTF
(
"Call DOS int 0x%02x (EAX=%08lx) ret=%04lx:%04lx
\n
"
,
VM86_ARG
(
fn
),
context
.
Eax
,
context
.
SegCs
,
context
.
Eip
);
ret
=
DOSVM_SimulateInt
(
VM86_ARG
(
fn
),
&
context
);
ret
=
DOSVM_SimulateInt
(
VM86_ARG
(
fn
),
&
context
,
FALSE
);
if
(
TRACE_ON
(
relay
))
DPRINTF
(
"Ret DOS int 0x%02x (EAX=%08lx) ret=%04lx:%04lx
\n
"
,
VM86_ARG
(
fn
),
context
.
Eax
,
context
.
SegCs
,
context
.
Eip
);
break
;
case
VM86_STI
:
case
VM86_PICRETURN
:
TRACE_
(
int
)(
"DOS task enabled interrupts with events pending, sending events
\n
"
);
IF_SET
(
&
context
);
/* case VM86_PICRETURN: */
TRACE_
(
int
)(
"DOS task enabled interrupts %s events pending, sending events
\n
"
,
IS_PEND
(
&
context
)
?
"with"
:
"without"
);
DOSVM_SendQueuedEvents
(
&
context
);
break
;
case
VM86_TRAP
:
...
...
@@ -459,6 +466,7 @@ int DOSVM_Enter( CONTEXT86 *context )
struct
vm86plus_struct
VM86
;
int
stat
,
len
,
sig
;
memset
(
&
VM86
,
0
,
sizeof
(
VM86
));
#define CP(x,y) VM86.regs.x = context->y
CV
;
#undef CP
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment