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
dfa41308
Commit
dfa41308
authored
Oct 13, 2000
by
Ove Kaaven
Committed by
Alexandre Julliard
Oct 13, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged DOSVM_Int with DOSVM_SimulateInt, and made it handle apps that
purposefully shuffle the interrupt vectors around.
parent
036ae0b6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
dosvm.c
loader/dos/dosvm.c
+19
-16
No files found.
loader/dos/dosvm.c
View file @
dfa41308
...
@@ -126,8 +126,11 @@ static void DOSVM_Dump( int fn, int sig, struct vm86plus_struct*VM86 )
...
@@ -126,8 +126,11 @@ static void DOSVM_Dump( int fn, int sig, struct vm86plus_struct*VM86 )
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
static
int
DOSVM_Int
(
int
vect
,
CONTEXT86
*
context
)
static
int
DOSVM_
Simulate
Int
(
int
vect
,
CONTEXT86
*
context
)
{
{
FARPROC16
handler
=
INT_GetRMHandler
(
vect
);
/* check for our real-mode hooks */
if
(
vect
==
0x31
)
{
if
(
vect
==
0x31
)
{
if
(
context
->
SegCs
==
DOSMEM_wrap_seg
)
{
if
(
context
->
SegCs
==
DOSMEM_wrap_seg
)
{
/* exit from real-mode wrapper */
/* exit from real-mode wrapper */
...
@@ -135,18 +138,17 @@ static int DOSVM_Int( int vect, CONTEXT86 *context )
...
@@ -135,18 +138,17 @@ static int DOSVM_Int( int vect, CONTEXT86 *context )
}
}
/* we could probably move some other dodgy stuff here too from dpmi.c */
/* we could probably move some other dodgy stuff here too from dpmi.c */
}
}
INT_RealModeInterrupt
(
vect
,
context
);
/* check if the call is from our fake BIOS interrupt stubs */
return
0
;
if
(
context
->
SegCs
==
0xf000
)
{
}
INT_RealModeInterrupt
(
vect
,
context
);
}
static
void
DOSVM_SimulateInt
(
int
vect
,
CONTEXT86
*
context
)
/* check if the call goes to an unhooked interrupt */
{
else
if
(
SELECTOROF
(
handler
)
==
0xf000
)
{
FARPROC16
handler
=
INT_GetRMHandler
(
vect
);
/* if so, call it directly */
INT_RealModeInterrupt
(
OFFSETOF
(
handler
)
/
4
,
context
);
if
(
SELECTOROF
(
handler
)
==
0xf000
)
{
}
/* if internal interrupt, call it directly */
/* the interrupt is hooked, simulate interrupt in DOS space */
INT_RealModeInterrupt
(
vect
,
context
);
else
{
}
else
{
WORD
*
stack
=
PTR_REAL_TO_LIN
(
context
->
SegSs
,
context
->
Esp
);
WORD
*
stack
=
PTR_REAL_TO_LIN
(
context
->
SegSs
,
context
->
Esp
);
WORD
flag
=
LOWORD
(
context
->
EFlags
);
WORD
flag
=
LOWORD
(
context
->
EFlags
);
...
@@ -161,6 +163,7 @@ static void DOSVM_SimulateInt( int vect, CONTEXT86 *context )
...
@@ -161,6 +163,7 @@ static void DOSVM_SimulateInt( int vect, CONTEXT86 *context )
context
->
Eip
=
OFFSETOF
(
handler
);
context
->
Eip
=
OFFSETOF
(
handler
);
IF_CLR
(
context
);
IF_CLR
(
context
);
}
}
return
0
;
}
}
#define SHOULD_PEND(x) \
#define SHOULD_PEND(x) \
...
@@ -316,7 +319,7 @@ static int DOSVM_Process( int fn, int sig, struct vm86plus_struct*VM86 )
...
@@ -316,7 +319,7 @@ static int DOSVM_Process( int fn, int sig, struct vm86plus_struct*VM86 )
case
VM86_INTx
:
case
VM86_INTx
:
if
(
TRACE_ON
(
relay
))
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
);
DPRINTF
(
"Call DOS int 0x%02x (EAX=%08lx) ret=%04lx:%04lx
\n
"
,
VM86_ARG
(
fn
),
context
.
Eax
,
context
.
SegCs
,
context
.
Eip
);
ret
=
DOSVM_Int
(
VM86_ARG
(
fn
),
&
context
);
ret
=
DOSVM_
Simulate
Int
(
VM86_ARG
(
fn
),
&
context
);
if
(
TRACE_ON
(
relay
))
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
);
DPRINTF
(
"Ret DOS int 0x%02x (EAX=%08lx) ret=%04lx:%04lx
\n
"
,
VM86_ARG
(
fn
),
context
.
Eax
,
context
.
SegCs
,
context
.
Eip
);
break
;
break
;
...
@@ -561,7 +564,7 @@ void DOSVM_SetTimer( unsigned ticks )
...
@@ -561,7 +564,7 @@ void DOSVM_SetTimer( unsigned ticks )
if
(
MZ_Current
())
{
if
(
MZ_Current
())
{
/* the PC clocks ticks at 1193180 Hz */
/* the PC clocks ticks at 1193180 Hz */
tim
.
tv_sec
=
0
;
tim
.
tv_sec
=
0
;
tim
.
tv_usec
=
((
unsigned
long
long
)
ticks
*
1000000
)
/
1193180
;
tim
.
tv_usec
=
MulDiv
(
ticks
,
1000000
,
1193180
)
;
/* sanity check */
/* sanity check */
if
(
!
tim
.
tv_usec
)
tim
.
tv_usec
=
1
;
if
(
!
tim
.
tv_usec
)
tim
.
tv_usec
=
1
;
...
@@ -594,7 +597,7 @@ unsigned DOSVM_GetTimer( void )
...
@@ -594,7 +597,7 @@ unsigned DOSVM_GetTimer( void )
ERR_
(
module
)(
"dosmod sync lost, errno=%d
\n
"
,
errno
);
ERR_
(
module
)(
"dosmod sync lost, errno=%d
\n
"
,
errno
);
return
0
;
return
0
;
}
}
return
((
unsigned
long
long
)
tim
.
tv_usec
*
1193180
)
/
1000000
;
return
MulDiv
(
tim
.
tv_usec
,
1193180
,
1000000
)
;
}
}
return
0
;
return
0
;
}
}
...
...
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