Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1479aebd
Commit
1479aebd
authored
Sep 17, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved instruction emulation to dlls/kernel.
parent
1084a8ba
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
43 deletions
+21
-43
Makefile.in
dlls/kernel/Makefile.in
+3
-2
instr.c
dlls/kernel/instr.c
+5
-26
wowthunk.c
dlls/kernel/wowthunk.c
+9
-4
Makefile.in
dlls/ntdll/Makefile.in
+0
-1
signal_i386.c
dlls/ntdll/signal_i386.c
+4
-10
No files found.
dlls/kernel/Makefile.in
View file @
1479aebd
...
...
@@ -31,6 +31,7 @@ C_SRCS = \
file16.c
\
format_msg.c
\
heap.c
\
instr.c
\
kernel_main.c
\
lcformat.c
\
local16.c
\
...
...
@@ -48,6 +49,7 @@ C_SRCS = \
stress.c
\
string.c
\
sync.c
\
system.c
\
tape.c
\
task.c
\
thread.c
\
...
...
@@ -61,8 +63,7 @@ C_SRCS = \
C_SRCS16
=
\
error16.c
\
registry16.c
\
system.c
registry16.c
ASM_SRCS
=
relay16asm.s
...
...
memory
/instr.c
→
dlls/kernel
/instr.c
View file @
1479aebd
...
...
@@ -67,19 +67,6 @@ inline static void *get_stack( CONTEXT86 *context )
/***********************************************************************
* timer_thread
*/
static
DWORD
CALLBACK
timer_thread
(
void
*
dummy
)
{
for
(;;)
{
Sleep
(
55
);
DOSMEM_Tick
(
0
);
}
return
0
;
/* unreached */
}
/***********************************************************************
* INSTR_ReplaceSelector
*
* Try to replace an invalid selector by a valid one.
...
...
@@ -94,13 +81,9 @@ static BOOL INSTR_ReplaceSelector( CONTEXT86 *context, WORD *sel )
{
if
(
*
sel
==
0x40
)
{
#if 0 /* hack until this is moved to kernel */
static
WORD
sys_timer
=
0
;
if
(
!
sys_timer
)
sys_timer
=
CreateSystemTimer
(
55
,
DOSMEM_Tick
);
#endif
static
HANDLE
sys_thread
;
if
(
!
sys_thread
)
sys_thread
=
CreateThread
(
NULL
,
0
,
timer_thread
,
NULL
,
0
,
NULL
);
*
sel
=
DOSMEM_BiosDataSeg
;
return
TRUE
;
}
...
...
@@ -502,7 +485,8 @@ DWORD INSTR_EmulateInstruction( CONTEXT86 *context )
switch
(
instr
[
1
])
{
case
0x22
:
/* mov eax, crX */
switch
(
instr
[
2
])
{
switch
(
instr
[
2
])
{
case
0xc0
:
ERR
(
"mov eax,cr0 at 0x%08lx, EAX=0x%08lx
\n
"
,
context
->
Eip
,
context
->
Eax
);
...
...
@@ -513,7 +497,8 @@ DWORD INSTR_EmulateInstruction( CONTEXT86 *context )
}
break
;
/*fallthrough to bad instruction handling */
case
0x20
:
/* mov crX, eax */
switch
(
instr
[
2
])
{
switch
(
instr
[
2
])
{
case
0xe0
:
/* mov cr4, eax */
/* CR4 register . See linux/arch/i386/mm/init.c, X86_CR4_ defs
* bit 0: VME Virtual Mode Exception ?
...
...
@@ -699,13 +684,7 @@ DWORD INSTR_EmulateInstruction( CONTEXT86 *context )
break
;
/* Unable to emulate it */
case
0xcd
:
/* int <XX> */
if
(
IS_SELECTOR_SYSTEM
(
context
->
SegCs
))
{
/* Win32 applications cannot use interrupts */
ret
=
EXCEPTION_ACCESS_VIOLATION
;
break
;
}
else
if
(
!
Dosvm
.
EmulateInterruptPM
&&
!
DPMI_LoadDosSystem
())
if
(
!
Dosvm
.
EmulateInterruptPM
&&
!
DPMI_LoadDosSystem
())
{
ERR
(
"could not initialize interrupt handling
\n
"
);
}
...
...
dlls/kernel/wowthunk.c
View file @
1479aebd
...
...
@@ -170,16 +170,21 @@ static DWORD call16_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION_RE
NtCurrentTeb
()
->
cur_stack
=
frame32
->
frame16
;
_LeaveWin16Lock
();
}
else
else
if
(
record
->
ExceptionCode
==
EXCEPTION_ACCESS_VIOLATION
||
record
->
ExceptionCode
==
EXCEPTION_PRIV_INSTRUCTION
)
{
if
(
IS_SELECTOR_SYSTEM
(
context
->
SegCs
))
{
if
(
fix_selector
(
context
))
return
ExceptionContinueExecution
;
}
else
/* check for Win16 __GP handler */
else
{
SEGPTR
gpHandler
=
HasGPHandler16
(
MAKESEGPTR
(
context
->
SegCs
,
context
->
Eip
)
);
if
(
gpHandler
)
SEGPTR
gpHandler
;
if
(
!
INSTR_EmulateInstruction
(
context
))
return
ExceptionContinueExecution
;
/* check for Win16 __GP handler */
if
((
gpHandler
=
HasGPHandler16
(
MAKESEGPTR
(
context
->
SegCs
,
context
->
Eip
)
)))
{
WORD
*
stack
=
wine_ldt_get_ptr
(
context
->
SegSs
,
context
->
Esp
);
*--
stack
=
context
->
SegCs
;
...
...
dlls/ntdll/Makefile.in
View file @
1479aebd
...
...
@@ -21,7 +21,6 @@ C_SRCS = \
$(TOPOBJDIR)
/memory/environ.c
\
$(TOPOBJDIR)
/memory/global.c
\
$(TOPOBJDIR)
/memory/heap.c
\
$(TOPOBJDIR)
/memory/instr.c
\
$(TOPOBJDIR)
/memory/selector.c
\
$(TOPOBJDIR)
/memory/string.c
\
$(TOPOBJDIR)
/memory/virtual.c
\
...
...
dlls/ntdll/signal_i386.c
View file @
1479aebd
...
...
@@ -407,7 +407,6 @@ typedef struct
#include "wine/exception.h"
#include "global.h"
#include "miscemu.h"
#include "syslevel.h"
#include "wine/debug.h"
...
...
@@ -748,13 +747,6 @@ static inline DWORD get_fpu_code( const CONTEXT *context )
static
void
do_segv
(
CONTEXT
*
context
,
int
trap_code
,
void
*
cr2
,
int
err_code
)
{
EXCEPTION_RECORD
rec
;
DWORD
page_fault_code
=
EXCEPTION_ACCESS_VIOLATION
;
#ifdef FAULT_ADDRESS
/* we want the page-fault case to be fast */
if
(
trap_code
==
T_PAGEFLT
)
if
(
!
(
page_fault_code
=
VIRTUAL_HandleFault
(
cr2
)))
return
;
#endif
rec
.
ExceptionRecord
=
NULL
;
rec
.
ExceptionFlags
=
EXCEPTION_CONTINUABLE
;
...
...
@@ -778,15 +770,17 @@ static void do_segv( CONTEXT *context, int trap_code, void *cr2, int err_code )
case
T_SEGNPFLT
:
/* Segment not present exception */
case
T_PROTFLT
:
/* General protection fault */
case
T_UNKNOWN
:
/* Unknown fault code */
if
(
!
(
rec
.
ExceptionCode
=
INSTR_EmulateInstruction
(
context
)))
return
;
rec
.
ExceptionCode
=
err_code
?
EXCEPTION_ACCESS_VIOLATION
:
EXCEPTION_PRIV_INSTRUCTION
;
break
;
case
T_PAGEFLT
:
/* Page fault */
#ifdef FAULT_ADDRESS
if
(
!
(
rec
.
ExceptionCode
=
VIRTUAL_HandleFault
(
cr2
)))
return
;
rec
.
NumberParameters
=
2
;
rec
.
ExceptionInformation
[
0
]
=
(
err_code
&
2
)
!=
0
;
rec
.
ExceptionInformation
[
1
]
=
(
DWORD
)
cr2
;
#else
rec
.
ExceptionCode
=
EXCEPTION_ACCESS_VIOLATION
;
#endif
rec
.
ExceptionCode
=
page_fault_code
;
break
;
case
T_ALIGNFLT
:
/* Alignment check exception */
/* FIXME: pass through exception handler first? */
...
...
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