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
a29ca210
Commit
a29ca210
authored
Mar 26, 2015
by
André Hentschel
Committed by
Alexandre Julliard
Mar 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add support for FreeBSD on ARM.
parent
f974d726
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
6 deletions
+53
-6
signal_arm.c
dlls/ntdll/signal_arm.c
+53
-6
No files found.
dlls/ntdll/signal_arm.c
View file @
a29ca210
...
...
@@ -2,7 +2,7 @@
* ARM signal handling routines
*
* Copyright 2002 Marcus Meissner, SuSE Linux AG
* Copyright 2010
, 2011
André Hentschel
* Copyright 2010
-2013, 2015
André Hentschel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -96,9 +96,21 @@ typedef struct ucontext
/* Exceptions */
# define ERROR_sig(context) REG_sig(error_code, context)
# define FAULT_sig(context) REG_sig(fault_address, context)
# define TRAP_sig(context) REG_sig(trap_no, context)
#elif defined(__FreeBSD__)
/* All Registers access - only for local access */
# define REGn_sig(reg_num, context) ((context)->uc_mcontext.__gregs[reg_num])
/* Special Registers access */
# define SP_sig(context) REGn_sig(_REG_SP, context)
/* Stack pointer */
# define LR_sig(context) REGn_sig(_REG_LR, context)
/* Link register */
# define PC_sig(context) REGn_sig(_REG_PC, context)
/* Program counter */
# define CPSR_sig(context) REGn_sig(_REG_CPSR, context)
/* Current State Register */
# define IP_sig(context) REGn_sig(_REG_R12, context)
/* Intra-Procedure-call scratch register */
# define FP_sig(context) REGn_sig(_REG_FP, context)
/* Frame pointer */
#endif
/* linux */
enum
arm_trap_code
...
...
@@ -123,6 +135,35 @@ struct UNWIND_INFO
WORD
unknown2
:
4
;
};
/***********************************************************************
* get_trap_code
*
* Get the trap code for a signal.
*/
static
inline
enum
arm_trap_code
get_trap_code
(
const
ucontext_t
*
sigcontext
)
{
#ifdef TRAP_sig
return
TRAP_sig
(
sigcontext
);
#else
return
TRAP_ARM_UNKNOWN
;
/* unknown trap code */
#endif
}
/***********************************************************************
* get_error_code
*
* Get the error code for a signal.
*/
static
inline
WORD
get_error_code
(
const
ucontext_t
*
sigcontext
)
{
#ifdef ERROR_sig
return
ERROR_sig
(
sigcontext
);
#else
return
0
;
#endif
}
/***********************************************************************
* dispatch_signal
*/
...
...
@@ -587,7 +628,7 @@ static void segv_handler( int signal, siginfo_t *info, void *ucontext )
ucontext_t
*
context
=
ucontext
;
/* check for page fault inside the thread stack */
if
(
TRAP_sig
(
context
)
==
TRAP_ARM_PAGEFLT
&&
if
(
get_trap_code
(
context
)
==
TRAP_ARM_PAGEFLT
&&
(
char
*
)
info
->
si_addr
>=
(
char
*
)
NtCurrentTeb
()
->
DeallocationStack
&&
(
char
*
)
info
->
si_addr
<
(
char
*
)
NtCurrentTeb
()
->
Tib
.
StackBase
&&
virtual_handle_stack_fault
(
info
->
si_addr
))
...
...
@@ -604,7 +645,7 @@ static void segv_handler( int signal, siginfo_t *info, void *ucontext )
rec
=
setup_exception
(
context
,
raise_segv_exception
);
if
(
rec
->
ExceptionCode
==
EXCEPTION_STACK_OVERFLOW
)
return
;
switch
(
TRAP_sig
(
context
))
switch
(
get_trap_code
(
context
))
{
case
TRAP_ARM_PRIVINFLT
:
/* Invalid opcode exception */
rec
->
ExceptionCode
=
EXCEPTION_ILLEGAL_INSTRUCTION
;
...
...
@@ -612,14 +653,20 @@ static void segv_handler( int signal, siginfo_t *info, void *ucontext )
case
TRAP_ARM_PAGEFLT
:
/* Page fault */
rec
->
ExceptionCode
=
EXCEPTION_ACCESS_VIOLATION
;
rec
->
NumberParameters
=
2
;
rec
->
ExceptionInformation
[
0
]
=
(
ERROR_sig
(
context
)
&
0x800
)
!=
0
;
rec
->
ExceptionInformation
[
0
]
=
(
get_error_code
(
context
)
&
0x800
)
!=
0
;
rec
->
ExceptionInformation
[
1
]
=
(
ULONG_PTR
)
info
->
si_addr
;
break
;
case
TRAP_ARM_ALIGNFLT
:
/* Alignment check exception */
rec
->
ExceptionCode
=
EXCEPTION_DATATYPE_MISALIGNMENT
;
break
;
case
TRAP_ARM_UNKNOWN
:
/* Unknown fault code */
rec
->
ExceptionCode
=
EXCEPTION_ACCESS_VIOLATION
;
rec
->
NumberParameters
=
2
;
rec
->
ExceptionInformation
[
0
]
=
0
;
rec
->
ExceptionInformation
[
1
]
=
0xffffffff
;
break
;
default
:
ERR
(
"Got unexpected trap %
ld
\n
"
,
TRAP_sig
(
context
));
ERR
(
"Got unexpected trap %
d
\n
"
,
get_trap_code
(
context
));
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