mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against 85d8d1390467147fca416236fd50bb6ea2e2c8e4
This commit is contained in:
parent
6ef7be2566
commit
26e542b4e5
@ -1,49 +1,38 @@
|
||||
From 40f4e264b0c957eafe187bc0de597c3aa18dc6be Mon Sep 17 00:00:00 2001
|
||||
From ee30dc13a100788219ecc357056f8edf3a2f2113 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 19 Mar 2017 19:08:34 +0100
|
||||
Subject: ntdll: Catch windows int 0x2e syscall on i386.
|
||||
Subject: [PATCH] ntdll: Catch windows int 0x2e syscall on i386.
|
||||
|
||||
---
|
||||
dlls/ntdll/signal_i386.c | 13 +++++++++++++
|
||||
dlls/ntdll/signal_i386.c | 10 +++++++++-
|
||||
include/wine/exception.h | 1 +
|
||||
2 files changed, 14 insertions(+)
|
||||
2 files changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
|
||||
index d76fe95dfa..93d9418527 100644
|
||||
index 8876790195..7ddc64284e 100644
|
||||
--- a/dlls/ntdll/signal_i386.c
|
||||
+++ b/dlls/ntdll/signal_i386.c
|
||||
@@ -1572,6 +1572,14 @@ static inline BOOL handle_interrupt( unsigned int interrupt, EXCEPTION_RECORD *r
|
||||
rec->ExceptionInformation[1] = context->Ecx;
|
||||
rec->ExceptionInformation[2] = context->Edx;
|
||||
@@ -1945,6 +1944,15 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, st
|
||||
stack->rec.ExceptionInformation[2] = stack->context.Edx;
|
||||
setup_raise_exception( sigcontext, stack );
|
||||
return TRUE;
|
||||
+ case 0x2e:
|
||||
+ context->Eip += 2;
|
||||
+ rec->ExceptionCode = EXCEPTION_WINE_SYSCALL;
|
||||
+ rec->ExceptionAddress = (void *)context->Eip;
|
||||
+ rec->NumberParameters = 2;
|
||||
+ rec->ExceptionInformation[0] = context->Eax;
|
||||
+ rec->ExceptionInformation[1] = context->Edx;
|
||||
+ stack->context.Eip += 2;
|
||||
+ stack->rec.ExceptionCode = EXCEPTION_WINE_SYSCALL;
|
||||
+ stack->rec.ExceptionAddress = (void *)stack->context.Eip;
|
||||
+ stack->rec.NumberParameters = 2;
|
||||
+ stack->rec.ExceptionInformation[0] = stack->context.Eax;
|
||||
+ stack->rec.ExceptionInformation[1] = stack->context.Edx;
|
||||
+ setup_raise_exception( sigcontext, stack );
|
||||
+ return TRUE;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1953,6 +1961,11 @@ static void WINAPI raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context
|
||||
}
|
||||
}
|
||||
break;
|
||||
+ case EXCEPTION_WINE_SYSCALL:
|
||||
+ FIXME("unimplemented syscall handler for 0x%lx, stack 0x%lx\n",
|
||||
+ rec->ExceptionInformation[0], rec->ExceptionInformation[1]);
|
||||
+ context->Eax = STATUS_INVALID_SYSTEM_SERVICE;
|
||||
+ goto done;
|
||||
}
|
||||
status = NtRaiseException( rec, context, TRUE );
|
||||
raise_status( status, rec );
|
||||
diff --git a/include/wine/exception.h b/include/wine/exception.h
|
||||
index f275568f4d..b8aeb3b866 100644
|
||||
index 3281130c50..e822573ace 100644
|
||||
--- a/include/wine/exception.h
|
||||
+++ b/include/wine/exception.h
|
||||
@@ -302,6 +302,7 @@ static inline EXCEPTION_REGISTRATION_REC
|
||||
@@ -315,6 +315,7 @@ static inline EXCEPTION_REGISTRATION_RECORD *__wine_get_frame(void)
|
||||
|
||||
#define EXCEPTION_WINE_STUB 0x80000100 /* stub entry point called */
|
||||
#define EXCEPTION_WINE_ASSERTION 0x80000101 /* assertion failed */
|
||||
@ -52,4 +41,5 @@ index f275568f4d..b8aeb3b866 100644
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
2.17.1
|
||||
|
||||
|
@ -1,14 +1,15 @@
|
||||
From b27c92f6d5f212307e291eac1b2abd376399366c Mon Sep 17 00:00:00 2001
|
||||
From 39d6c2f1add7583ea3305777a6e869d4f1e7b5de Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 20 Aug 2017 17:22:20 +0200
|
||||
Subject: ntdll: Avoid stack protector frame in signal handler functions.
|
||||
Subject: [PATCH] ntdll: Avoid stack protector frame in signal handler
|
||||
functions.
|
||||
|
||||
---
|
||||
dlls/ntdll/signal_i386.c | 31 +++++++++++++++++++------------
|
||||
1 file changed, 19 insertions(+), 12 deletions(-)
|
||||
dlls/ntdll/signal_i386.c | 27 +++++++++++++++++----------
|
||||
1 file changed, 17 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
|
||||
index c46d50eb271..8a637f23825 100644
|
||||
index 7ddc64284e..372fd1e91b 100644
|
||||
--- a/dlls/ntdll/signal_i386.c
|
||||
+++ b/dlls/ntdll/signal_i386.c
|
||||
@@ -96,6 +96,13 @@ typedef struct
|
||||
@ -25,7 +26,7 @@ index c46d50eb271..8a637f23825 100644
|
||||
/***********************************************************************
|
||||
* signal context platform-specific definitions
|
||||
*/
|
||||
@@ -663,7 +670,7 @@ static inline void *get_signal_stack(void)
|
||||
@@ -582,7 +589,7 @@ static inline int has_fpux(void)
|
||||
*
|
||||
* Get the current teb based on the stack pointer.
|
||||
*/
|
||||
@ -34,7 +35,7 @@ index c46d50eb271..8a637f23825 100644
|
||||
{
|
||||
unsigned long esp;
|
||||
__asm__("movl %%esp,%0" : "=g" (esp) );
|
||||
@@ -1023,7 +1030,7 @@ __ASM_GLOBAL_FUNC( clear_alignment_flag,
|
||||
@@ -820,7 +827,7 @@ __ASM_GLOBAL_FUNC( clear_alignment_flag,
|
||||
* Handler initialization when the full context is not needed.
|
||||
* Return the stack pointer to use for pushing the exception data.
|
||||
*/
|
||||
@ -43,25 +44,16 @@ index c46d50eb271..8a637f23825 100644
|
||||
{
|
||||
TEB *teb = get_current_teb();
|
||||
|
||||
@@ -2032,7 +2039,7 @@ static EXCEPTION_RECORD *setup_exception_record( ucontext_t *sigcontext, void *s
|
||||
@@ -1840,7 +1847,7 @@ static struct stack_layout *setup_exception_record( ucontext_t *sigcontext, void
|
||||
* sigcontext so that the return from the signal handler will call
|
||||
* the raise function.
|
||||
*/
|
||||
-static EXCEPTION_RECORD *setup_exception( ucontext_t *sigcontext, raise_func func )
|
||||
+static EXCEPTION_RECORD * SIGNALFUNC setup_exception( ucontext_t *sigcontext, raise_func func )
|
||||
-static struct stack_layout *setup_exception( ucontext_t *sigcontext )
|
||||
+static struct stack_layout * SIGNALFUNC setup_exception( ucontext_t *sigcontext )
|
||||
{
|
||||
WORD fs, gs;
|
||||
void *stack = init_handler( sigcontext, &fs, &gs );
|
||||
@@ -2245,7 +2252,7 @@ static void usr2_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
* Handler for SIGSEGV and related errors. Used only during the initialization
|
||||
* of the process to handle virtual faults.
|
||||
*/
|
||||
-static void segv_handler_early( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
+static void SIGNALFUNC segv_handler_early( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
{
|
||||
WORD fs, gs;
|
||||
ucontext_t *context = sigcontext;
|
||||
@@ -2269,7 +2276,7 @@ static void segv_handler_early( int signal, siginfo_t *siginfo, void *sigcontext
|
||||
@@ -1964,7 +1971,7 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, st
|
||||
*
|
||||
* Handler for SIGSEGV and related errors.
|
||||
*/
|
||||
@ -69,8 +61,8 @@ index c46d50eb271..8a637f23825 100644
|
||||
+static void SIGNALFUNC segv_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
{
|
||||
WORD fs, gs;
|
||||
EXCEPTION_RECORD *rec;
|
||||
@@ -2363,7 +2370,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
struct stack_layout *stack;
|
||||
@@ -2083,7 +2090,7 @@ done:
|
||||
*
|
||||
* Handler for SIGTRAP.
|
||||
*/
|
||||
@ -78,17 +70,17 @@ index c46d50eb271..8a637f23825 100644
|
||||
+static void SIGNALFUNC trap_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
{
|
||||
ucontext_t *context = sigcontext;
|
||||
EXCEPTION_RECORD *rec = setup_exception( context, raise_trap_exception );
|
||||
@@ -2392,7 +2399,7 @@ static void trap_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
struct stack_layout *stack = setup_exception( context );
|
||||
@@ -2125,7 +2132,7 @@ static void trap_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
*
|
||||
* Handler for SIGFPE.
|
||||
*/
|
||||
-static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
+static void SIGNALFUNC fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
{
|
||||
CONTEXT *win_context;
|
||||
ucontext_t *context = sigcontext;
|
||||
@@ -2441,7 +2448,7 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
struct stack_layout *stack = setup_exception( context );
|
||||
@@ -2173,7 +2180,7 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
*
|
||||
* FIXME: should not be calling external functions on the signal stack.
|
||||
*/
|
||||
@ -97,16 +89,16 @@ index c46d50eb271..8a637f23825 100644
|
||||
{
|
||||
WORD fs, gs;
|
||||
init_handler( sigcontext, &fs, &gs );
|
||||
@@ -2457,7 +2464,7 @@ static void int_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
@@ -2190,7 +2197,7 @@ static void int_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
*
|
||||
* Handler for SIGABRT.
|
||||
*/
|
||||
-static void abrt_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
+static void SIGNALFUNC abrt_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
{
|
||||
EXCEPTION_RECORD *rec = setup_exception( sigcontext, raise_generic_exception );
|
||||
rec->ExceptionCode = EXCEPTION_WINE_ASSERTION;
|
||||
@@ -2470,7 +2477,7 @@ static void abrt_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
struct stack_layout *stack = setup_exception( sigcontext );
|
||||
stack->rec.ExceptionCode = EXCEPTION_WINE_ASSERTION;
|
||||
@@ -2204,7 +2211,7 @@ static void abrt_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
*
|
||||
* Handler for SIGQUIT.
|
||||
*/
|
||||
@ -115,7 +107,7 @@ index c46d50eb271..8a637f23825 100644
|
||||
{
|
||||
WORD fs, gs;
|
||||
init_handler( sigcontext, &fs, &gs );
|
||||
@@ -2483,7 +2490,7 @@ static void quit_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
@@ -2217,7 +2224,7 @@ static void quit_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
*
|
||||
* Handler for SIGUSR1, used to signal a thread that it got suspended.
|
||||
*/
|
||||
@ -125,5 +117,5 @@ index c46d50eb271..8a637f23825 100644
|
||||
CONTEXT context;
|
||||
WORD fs, gs;
|
||||
--
|
||||
2.14.1
|
||||
2.17.1
|
||||
|
||||
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "6033b3a7fbc29bc911b0173499b288ce7f226a4a"
|
||||
echo "85d8d1390467147fca416236fd50bb6ea2e2c8e4"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
|
Loading…
Reference in New Issue
Block a user