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
62af0706
Commit
62af0706
authored
Feb 03, 2006
by
Robert Millan
Committed by
Alexandre Julliard
Feb 03, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Rename i386 CPU trap codes to avoid collision with system headers.
parent
16cc1858
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
94 deletions
+87
-94
signal_i386.c
dlls/ntdll/signal_i386.c
+49
-57
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+38
-37
No files found.
dlls/ntdll/signal_i386.c
View file @
62af0706
...
...
@@ -411,35 +411,6 @@ typedef ucontext_t SIGCONTEXT;
#endif
/* svr4 || SCO_DS */
/* exception code definitions (already defined by FreeBSD/NetBSD) */
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
/* FIXME: other BSDs? */
#define T_DIVIDE 0
/* Division by zero exception */
#define T_TRCTRAP 1
/* Single-step exception */
#define T_NMI 2
/* NMI interrupt */
#define T_BPTFLT 3
/* Breakpoint exception */
#define T_OFLOW 4
/* Overflow exception */
#define T_BOUND 5
/* Bound range exception */
#define T_PRIVINFLT 6
/* Invalid opcode exception */
#define T_DNA 7
/* Device not available exception */
#define T_DOUBLEFLT 8
/* Double fault exception */
#define T_FPOPFLT 9
/* Coprocessor segment overrun */
#define T_TSSFLT 10
/* Invalid TSS exception */
#define T_SEGNPFLT 11
/* Segment not present exception */
#define T_STKFLT 12
/* Stack fault */
#define T_PROTFLT 13
/* General protection fault */
#define T_PAGEFLT 14
/* Page fault */
#define T_RESERVED 15
/* Unknown exception */
#define T_ARITHTRAP 16
/* Floating point exception */
#define T_ALIGNFLT 17
/* Alignment check exception */
#define T_MCHK 18
/* Machine check exception */
#define T_CACHEFLT 19
/* Cache flush exception */
#endif
#if defined(__NetBSD__)
#define T_MCHK 19
/* Machine check exception */
#endif
#define T_UNKNOWN (-1)
/* Unknown fault (TRAP_sig not defined) */
#include "wine/exception.h"
#include "wine/debug.h"
...
...
@@ -454,6 +425,30 @@ static wine_signal_handler handlers[256];
extern
void
DECLSPEC_NORETURN
__wine_call_from_32_restore_regs
(
const
CONTEXT
*
context
);
enum
i386_trap_code
{
TRAP_x86_UNKNOWN
=
-
1
,
/* Unknown fault (TRAP_sig not defined) */
TRAP_x86_DIVIDE
=
0
,
/* Division by zero exception */
TRAP_x86_TRCTRAP
=
1
,
/* Single-step exception */
TRAP_x86_NMI
=
2
,
/* NMI interrupt */
TRAP_x86_BPTFLT
=
3
,
/* Breakpoint exception */
TRAP_x86_OFLOW
=
4
,
/* Overflow exception */
TRAP_x86_BOUND
=
5
,
/* Bound range exception */
TRAP_x86_PRIVINFLT
=
6
,
/* Invalid opcode exception */
TRAP_x86_DNA
=
7
,
/* Device not available exception */
TRAP_x86_DOUBLEFLT
=
8
,
/* Double fault exception */
TRAP_x86_FPOPFLT
=
9
,
/* Coprocessor segment overrun */
TRAP_x86_TSSFLT
=
10
,
/* Invalid TSS exception */
TRAP_x86_SEGNPFLT
=
11
,
/* Segment not present exception */
TRAP_x86_STKFLT
=
12
,
/* Stack fault */
TRAP_x86_PROTFLT
=
13
,
/* General protection fault */
TRAP_x86_PAGEFLT
=
14
,
/* Page fault */
TRAP_x86_ARITHTRAP
=
16
,
/* Floating point exception */
TRAP_x86_ALIGNFLT
=
17
,
/* Alignment check exception */
TRAP_x86_MCHK
=
18
,
/* Machine check exception */
TRAP_x86_CACHEFLT
=
19
/* Cache flush exception */
};
/***********************************************************************
* dispatch_signal
...
...
@@ -470,12 +465,12 @@ inline static int dispatch_signal(unsigned int sig)
*
* Get the trap code for a signal.
*/
static
inline
int
get_trap_code
(
const
SIGCONTEXT
*
sigcontext
)
static
inline
enum
i386_trap_code
get_trap_code
(
const
SIGCONTEXT
*
sigcontext
)
{
#ifdef TRAP_sig
return
TRAP_sig
(
sigcontext
);
#else
return
T_UNKNOWN
;
/* unknown trap code */
return
T
RAP_x86
_UNKNOWN
;
/* unknown trap code */
#endif
}
...
...
@@ -1149,21 +1144,21 @@ static HANDLER_DEF(segv_handler)
switch
(
get_trap_code
(
HANDLER_CONTEXT
))
{
case
T_OFLOW
:
/* Overflow exception */
case
T
RAP_x86
_OFLOW
:
/* Overflow exception */
rec
->
ExceptionCode
=
EXCEPTION_INT_OVERFLOW
;
break
;
case
T_BOUND
:
/* Bound range exception */
case
T
RAP_x86
_BOUND
:
/* Bound range exception */
rec
->
ExceptionCode
=
EXCEPTION_ARRAY_BOUNDS_EXCEEDED
;
break
;
case
T_PRIVINFLT
:
/* Invalid opcode exception */
case
T
RAP_x86
_PRIVINFLT
:
/* Invalid opcode exception */
rec
->
ExceptionCode
=
EXCEPTION_ILLEGAL_INSTRUCTION
;
break
;
case
T_STKFLT
:
/* Stack fault */
case
T
RAP_x86
_STKFLT
:
/* Stack fault */
rec
->
ExceptionCode
=
EXCEPTION_STACK_OVERFLOW
;
break
;
case
T_SEGNPFLT
:
/* Segment not present exception */
case
T_PROTFLT
:
/* General protection fault */
case
T_UNKNOWN
:
/* Unknown fault code */
case
T
RAP_x86
_SEGNPFLT
:
/* Segment not present exception */
case
T
RAP_x86
_PROTFLT
:
/* General protection fault */
case
T
RAP_x86
_UNKNOWN
:
/* Unknown fault code */
if
(
!
get_error_code
(
HANDLER_CONTEXT
)
&&
is_privileged_instr
(
get_exception_context
(
rec
)
))
rec
->
ExceptionCode
=
EXCEPTION_PRIV_INSTRUCTION
;
else
...
...
@@ -1176,7 +1171,7 @@ static HANDLER_DEF(segv_handler)
rec
->
ExceptionInformation
[
1
]
=
(
err
&
7
)
==
4
?
(
err
&
~
7
)
:
0xffffffff
;
}
break
;
case
T_PAGEFLT
:
/* Page fault */
case
T
RAP_x86
_PAGEFLT
:
/* Page fault */
rec
->
ExceptionCode
=
EXCEPTION_ACCESS_VIOLATION
;
#ifdef FAULT_ADDRESS
rec
->
NumberParameters
=
2
;
...
...
@@ -1184,21 +1179,18 @@ static HANDLER_DEF(segv_handler)
rec
->
ExceptionInformation
[
1
]
=
(
ULONG_PTR
)
FAULT_ADDRESS
;
#endif
break
;
case
T_ALIGNFLT
:
/* Alignment check exception */
case
T
RAP_x86
_ALIGNFLT
:
/* Alignment check exception */
rec
->
ExceptionCode
=
EXCEPTION_DATATYPE_MISALIGNMENT
;
break
;
default:
ERR
(
"Got unexpected trap %d
\n
"
,
get_trap_code
(
HANDLER_CONTEXT
)
);
/* fall through */
case
T_NMI
:
/* NMI interrupt */
case
T_DNA
:
/* Device not available exception */
case
T_DOUBLEFLT
:
/* Double fault exception */
case
T_TSSFLT
:
/* Invalid TSS exception */
case
T_RESERVED
:
/* Unknown exception */
case
T_MCHK
:
/* Machine check exception */
#ifdef T_CACHEFLT
case
T_CACHEFLT
:
/* Cache flush exception */
#endif
case
TRAP_x86_NMI
:
/* NMI interrupt */
case
TRAP_x86_DNA
:
/* Device not available exception */
case
TRAP_x86_DOUBLEFLT
:
/* Double fault exception */
case
TRAP_x86_TSSFLT
:
/* Invalid TSS exception */
case
TRAP_x86_MCHK
:
/* Machine check exception */
case
TRAP_x86_CACHEFLT
:
/* Cache flush exception */
rec
->
ExceptionCode
=
EXCEPTION_ILLEGAL_INSTRUCTION
;
break
;
}
...
...
@@ -1216,10 +1208,10 @@ static HANDLER_DEF(trap_handler)
switch
(
get_trap_code
(
HANDLER_CONTEXT
))
{
case
T_TRCTRAP
:
/* Single-step exception */
case
T
RAP_x86
_TRCTRAP
:
/* Single-step exception */
rec
->
ExceptionCode
=
EXCEPTION_SINGLE_STEP
;
break
;
case
T_BPTFLT
:
/* Breakpoint exception */
case
T
RAP_x86
_BPTFLT
:
/* Breakpoint exception */
rec
->
ExceptionAddress
=
(
char
*
)
rec
->
ExceptionAddress
-
1
;
/* back up over the int3 instruction */
/* fall through */
default:
...
...
@@ -1244,14 +1236,14 @@ static HANDLER_DEF(fpe_handler)
switch
(
get_trap_code
(
HANDLER_CONTEXT
))
{
case
T_DIVIDE
:
/* Division by zero exception */
case
T
RAP_x86
_DIVIDE
:
/* Division by zero exception */
rec
->
ExceptionCode
=
EXCEPTION_INT_DIVIDE_BY_ZERO
;
break
;
case
T_FPOPFLT
:
/* Coprocessor segment overrun */
case
T
RAP_x86
_FPOPFLT
:
/* Coprocessor segment overrun */
rec
->
ExceptionCode
=
EXCEPTION_FLT_INVALID_OPERATION
;
break
;
case
T_ARITHTRAP
:
/* Floating point exception */
case
T_UNKNOWN
:
/* Unknown fault code */
case
T
RAP_x86
_ARITHTRAP
:
/* Floating point exception */
case
T
RAP_x86
_UNKNOWN
:
/* Unknown fault code */
rec
->
ExceptionCode
=
get_fpu_code
(
context
);
break
;
default:
...
...
@@ -1491,10 +1483,10 @@ void __wine_enter_vm86( CONTEXT *context )
case
VM86_TRAP
:
/* return due to DOS-debugger request */
switch
(
VM86_ARG
(
res
))
{
case
T_TRCTRAP
:
/* Single-step exception, single step flag is cleared by raise_trap_exception */
case
T
RAP_x86
_TRCTRAP
:
/* Single-step exception, single step flag is cleared by raise_trap_exception */
rec
.
ExceptionCode
=
EXCEPTION_SINGLE_STEP
;
break
;
case
T_BPTFLT
:
/* Breakpoint exception */
case
T
RAP_x86
_BPTFLT
:
/* Breakpoint exception */
rec
.
ExceptionAddress
=
(
char
*
)
rec
.
ExceptionAddress
-
1
;
/* back up over the int3 instruction */
/* fall through */
default:
...
...
dlls/ntdll/signal_x86_64.c
View file @
62af0706
...
...
@@ -93,27 +93,29 @@ typedef struct ucontext SIGCONTEXT;
#endif
/* linux */
#define T_UNKNOWN (-1)
/* Unknown fault (TRAP_sig not defined) */
#define T_DIVIDE 0
/* Division by zero exception */
#define T_TRCTRAP 1
/* Single-step exception */
#define T_NMI 2
/* NMI interrupt */
#define T_BPTFLT 3
/* Breakpoint exception */
#define T_OFLOW 4
/* Overflow exception */
#define T_BOUND 5
/* Bound range exception */
#define T_PRIVINFLT 6
/* Invalid opcode exception */
#define T_DNA 7
/* Device not available exception */
#define T_DOUBLEFLT 8
/* Double fault exception */
#define T_FPOPFLT 9
/* Coprocessor segment overrun */
#define T_TSSFLT 10
/* Invalid TSS exception */
#define T_SEGNPFLT 11
/* Segment not present exception */
#define T_STKFLT 12
/* Stack fault */
#define T_PROTFLT 13
/* General protection fault */
#define T_PAGEFLT 14
/* Page fault */
#define T_RESERVED 15
/* Unknown exception */
#define T_ARITHTRAP 16
/* Floating point exception */
#define T_ALIGNFLT 17
/* Alignment check exception */
#define T_MCHK 18
/* Machine check exception */
#define T_CACHEFLT 19
/* Cache flush exception */
enum
i386_trap_code
{
TRAP_x86_UNKNOWN
=
-
1
,
/* Unknown fault (TRAP_sig not defined) */
TRAP_x86_DIVIDE
=
0
,
/* Division by zero exception */
TRAP_x86_TRCTRAP
=
1
,
/* Single-step exception */
TRAP_x86_NMI
=
2
,
/* NMI interrupt */
TRAP_x86_BPTFLT
=
3
,
/* Breakpoint exception */
TRAP_x86_OFLOW
=
4
,
/* Overflow exception */
TRAP_x86_BOUND
=
5
,
/* Bound range exception */
TRAP_x86_PRIVINFLT
=
6
,
/* Invalid opcode exception */
TRAP_x86_DNA
=
7
,
/* Device not available exception */
TRAP_x86_DOUBLEFLT
=
8
,
/* Double fault exception */
TRAP_x86_FPOPFLT
=
9
,
/* Coprocessor segment overrun */
TRAP_x86_TSSFLT
=
10
,
/* Invalid TSS exception */
TRAP_x86_SEGNPFLT
=
11
,
/* Segment not present exception */
TRAP_x86_STKFLT
=
12
,
/* Stack fault */
TRAP_x86_PROTFLT
=
13
,
/* General protection fault */
TRAP_x86_PAGEFLT
=
14
,
/* Page fault */
TRAP_x86_ARITHTRAP
=
16
,
/* Floating point exception */
TRAP_x86_ALIGNFLT
=
17
,
/* Alignment check exception */
TRAP_x86_MCHK
=
18
,
/* Machine check exception */
TRAP_x86_CACHEFLT
=
19
/* Cache flush exception */
};
typedef
int
(
*
wine_signal_handler
)(
unsigned
int
sig
);
...
...
@@ -226,25 +228,25 @@ static HANDLER_DEF(segv_handler)
switch
(
TRAP_sig
(
HANDLER_CONTEXT
))
{
case
T_OFLOW
:
/* Overflow exception */
case
T
RAP_x86
_OFLOW
:
/* Overflow exception */
rec
.
ExceptionCode
=
EXCEPTION_INT_OVERFLOW
;
break
;
case
T_BOUND
:
/* Bound range exception */
case
T
RAP_x86
_BOUND
:
/* Bound range exception */
rec
.
ExceptionCode
=
EXCEPTION_ARRAY_BOUNDS_EXCEEDED
;
break
;
case
T_PRIVINFLT
:
/* Invalid opcode exception */
case
T
RAP_x86
_PRIVINFLT
:
/* Invalid opcode exception */
rec
.
ExceptionCode
=
EXCEPTION_ILLEGAL_INSTRUCTION
;
break
;
case
T_STKFLT
:
/* Stack fault */
case
T
RAP_x86
_STKFLT
:
/* Stack fault */
rec
.
ExceptionCode
=
EXCEPTION_STACK_OVERFLOW
;
break
;
case
T_SEGNPFLT
:
/* Segment not present exception */
case
T_PROTFLT
:
/* General protection fault */
case
T_UNKNOWN
:
/* Unknown fault code */
case
T
RAP_x86
_SEGNPFLT
:
/* Segment not present exception */
case
T
RAP_x86
_PROTFLT
:
/* General protection fault */
case
T
RAP_x86
_UNKNOWN
:
/* Unknown fault code */
rec
.
ExceptionCode
=
ERROR_sig
(
HANDLER_CONTEXT
)
?
EXCEPTION_ACCESS_VIOLATION
:
EXCEPTION_PRIV_INSTRUCTION
;
break
;
case
T_PAGEFLT
:
/* Page fault */
case
T
RAP_x86
_PAGEFLT
:
/* Page fault */
rec
.
ExceptionCode
=
EXCEPTION_ACCESS_VIOLATION
;
#ifdef FAULT_ADDRESS
rec
.
NumberParameters
=
2
;
...
...
@@ -252,19 +254,18 @@ static HANDLER_DEF(segv_handler)
rec
.
ExceptionInformation
[
1
]
=
(
ULONG_PTR
)
FAULT_ADDRESS
;
#endif
break
;
case
T_ALIGNFLT
:
/* Alignment check exception */
case
T
RAP_x86
_ALIGNFLT
:
/* Alignment check exception */
rec
.
ExceptionCode
=
EXCEPTION_DATATYPE_MISALIGNMENT
;
break
;
default:
ERR
(
"Got unexpected trap %ld
\n
"
,
TRAP_sig
(
HANDLER_CONTEXT
)
);
/* fall through */
case
T_NMI
:
/* NMI interrupt */
case
T_DNA
:
/* Device not available exception */
case
T_DOUBLEFLT
:
/* Double fault exception */
case
T_TSSFLT
:
/* Invalid TSS exception */
case
T_RESERVED
:
/* Unknown exception */
case
T_MCHK
:
/* Machine check exception */
case
T_CACHEFLT
:
/* Cache flush exception */
case
TRAP_x86_NMI
:
/* NMI interrupt */
case
TRAP_x86_DNA
:
/* Device not available exception */
case
TRAP_x86_DOUBLEFLT
:
/* Double fault exception */
case
TRAP_x86_TSSFLT
:
/* Invalid TSS exception */
case
TRAP_x86_MCHK
:
/* Machine check exception */
case
TRAP_x86_CACHEFLT
:
/* Cache flush exception */
rec
.
ExceptionCode
=
EXCEPTION_ILLEGAL_INSTRUCTION
;
break
;
}
...
...
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