Jacek Caban
e0a934d0ef
ntdll: Handle Unix lib exception outside Unix stack.
...
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 18:03:11 +02:00
Jacek Caban
2ec2e136bf
ntdll: Allow Unix libraries to use exception macros.
...
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 18:03:11 +02:00
Alexandre Julliard
15d5cb2256
ntdll: Copy __wine_setjmpex/longjmp implementation to avoid importing winecrt0.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:39:24 +02:00
Alexandre Julliard
ff04d8a4c2
ntdll: Move the syscall dispatcher implementation to the platform-specific files.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 11:25:38 +02:00
Alexandre Julliard
847db3c1d3
ntdll: Store the syscall table in the syscall frame on all platforms.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 10:47:38 +02:00
Alexandre Julliard
94f63ea23f
ntdll: Add support for user callbacks.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 18:16:43 +02:00
Alexandre Julliard
daa1886a2c
ntdll: Add a stub for NtCallbackReturn().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 11:52:35 +02:00
Martin Storsjo
23b44e8df6
ntdll: Fix arm64 call_user_exception_dispatcher with kernel stack for syscalls.
...
Don't call KiUserExceptionDispatcher directly on the stack pointer
stored in the CONTEXT, but use the one stored in syscall_frame
(which includes the stack allocation in e.g. RtlRaiseException).
This fixes unwinding test cases that worked before
08c4419a49
.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-26 19:42:25 +02:00
Alexandre Julliard
7404ef3ef5
ntdll: Don't rely on get_thread_context() updating the context flags.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 15:25:42 +02:00
Alexandre Julliard
8ac411ed6d
server: Support both native and wow64 register contexts.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-27 11:42:32 +02:00
Alexandre Julliard
fed7e7a78b
ntdll: Simulate a syscall return when starting a thread.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 18:35:20 +02:00
Alexandre Julliard
db26df5934
ntdll: Go through the syscall return path for syscall faults.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 18:35:20 +02:00
Alexandre Julliard
9a430dc6db
ntdll: Also pass the TEB to signal_exit_thread().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 18:32:24 +02:00
Alexandre Julliard
fa5759b9ef
ntdll: Simplify the platform-specific dispatcher interface.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 18:45:44 +02:00
Alexandre Julliard
08c4419a49
ntdll: Switch to the kernel stack for syscalls on ARM64.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 18:45:44 +02:00
Alexandre Julliard
a2fce84a8b
ntdll: Fix some exception test failures on ARM64.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 19:54:33 +02:00
Alexandre Julliard
1bd4473484
ntdll: Create a thread to run the ctrl-C routine instead of raising an exception.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-09 23:38:43 +02:00
Alexandre Julliard
e5982993ae
ntdll: Get rid of signal_init_syscalls().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-02 20:16:07 +02:00
Alexandre Julliard
1cc0649755
ntdll: Store exception jump buffer in the per-thread data.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-01 15:16:23 +02:00
Zebediah Figura
10eba9b2e9
Revert "ntdll: Preserve syscall frame when calling async IO system APC.".
...
This reverts commit 8b8ddffa21
.
ws2_32 no longer uses system APCs.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-01 09:12:54 +02:00
Alexandre Julliard
1364b11fd4
ntdll: Pass the result status to call_user_apc_dispatcher().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:00 +02:00
Alexandre Julliard
e8a1341f5c
ntdll: Add platform-specific helpers for getting/setting the Wow64 context.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 17:53:30 +02:00
Alexandre Julliard
f04c2bd4f1
ntdll: Make the server context conversion functions generic.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 17:46:41 +02:00
Alexandre Julliard
308bd35746
server: Store a machine ID instead of a CPU in the context structure.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 10:40:53 +02:00
Jacek Caban
437bef6ac1
ntdll: Use syscall dispatcher for restoring context in x86_64 NtSetContextThread implementation.
...
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 20:19:15 +01:00
Jacek Caban
a0a62463e3
ntdll: Introduce signal_init_syscalls.
...
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-19 23:46:30 +01:00
Paul Gofman
8b8ddffa21
ntdll: Preserve syscall frame when calling async IO system APC.
...
The frame can currently be reset from ws2_32.dll async IO callbacks
which are still in the user part and are calling 'syscall' functions.
If the user APC is processed after that during the same call to
server_select(), the call_user_apc_dispatcher() faults.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49782
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-23 22:07:50 +01:00
Martin Storsjo
dcf3874e00
ntdll: Restore the original Lr value when unwinding through raise_func_trampoline on arm64.
...
When a signal is raised in a leaf function (that hasn't backed up
the Lr register itself), we need to restore both Pc and Lr separately.
This doesn't seem to be possible via libunwind, so add a special case
unwinding rule for this function.
As we have a special case for the function, we could also just as well
skip normal dwarf unwinding for this function altogether and just
restore the full context from the stack.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-05 12:33:31 +02:00
Alexandre Julliard
cc9d69b20b
ntdll: Pop the Unix stack completely in call_user_apc_dispatcher().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-04 21:16:49 +02:00
Martin Storsjo
5bbd8130ad
ntdll: Don't truncate SP in arm64 handle_syscall_fault.
...
This seems to be a copypaste typo from 0b3db9dfa2
.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-04 15:42:18 +02:00
Martin Storsjo
d99a454a6b
ntdll: Fix arm64 regression from "Clear the syscall frame on return".
...
The restoring of registers in call_user_exception_dispatcher
was broken in 75e616d52b
.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-04 15:42:15 +02:00
Alexandre Julliard
c2c330532e
ntdll: Call the process entry point through RtlUserThreadStart().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-01 16:41:03 +02:00
Alexandre Julliard
75e616d52b
ntdll: Clear the syscall frame on return instead of popping the previous one.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-27 12:14:35 +02:00
Alexandre Julliard
1581fb619b
ntdll: Get rid of the server_init_process_done() Unix library callback.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 13:04:09 +02:00
Alexandre Julliard
0b3db9dfa2
ntdll: Handle page faults happening during a syscall without dispatching the exception.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 11:46:22 +02:00
Martin Storsjo
5b3842451b
include: Update ARM64 context flag definitions to match current SDKs.
...
CONTEXT_FLOATING_POINT should be included in CONTEXT_FULL, and
there's a new flag CONTEXT_ARM64_X18 (not available without
the arch specific prefix) that only is part of CONTEXT_ALL.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-21 15:01:56 +02:00
Alexandre Julliard
77fbf3a9fd
ntdll: Unwind the syscall frame in NtSetContextThread().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 18:45:53 +02:00
Alexandre Julliard
a686759f1d
ntdll: Unwind the syscall frame when calling KiUserApcDispatcher().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 18:45:53 +02:00
Alexandre Julliard
53e0bf2f9f
ntdll: Don't expect LdrInitializeThunk() to return to the Unix side.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 18:45:53 +02:00
Martin Storsjo
8f3bd63b52
ntdll: Fix arm64 sigcontext access for darwin.
...
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-18 22:33:39 +02:00
Martin Storsjo
7f8224411c
ntdll: Fix the arm64 use of libunwind for macOS.
...
MacOS uses the LLVM libunwind, which doesn't expose quite as much
internals of the cursor as GNU libunwind, and uses slightly different
names for the arch specific register enums (for get/set registers).
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-18 22:33:34 +02:00
Martin Storsjo
cffd06ea67
ntdll: Trust libunwind's returned pc value on arm64.
...
Use this instead of manually copying LR to PC. With GNU libunwind,
both registers are equal after unw_step.
With the LLVM libunwind (which Apple uses), the return address isn't
reflected at all in LR, only in UNW_REG_IP.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-18 22:32:27 +02:00
Alexandre Julliard
9b7f14f1b4
ntdll: Unwind the syscall frame when calling KiRaiseUserExceptionDispatcher().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 17:56:10 +02:00
Alexandre Julliard
1e7e21534e
ntdll: Unwind the syscall frame when calling KiUserExceptionDispatcher().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 17:56:10 +02:00
Alexandre Julliard
13abe9e2bd
ntdll/tests: Run exception tests under the debugger on all platforms.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 17:56:10 +02:00
Alexandre Julliard
7a71f98640
ntdll: Use KiUserApcDispatcher() to call user APCs.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-06 19:31:24 +02:00
Alexandre Julliard
8e5c11b964
ntdll/tests: Enable more exception tests on ARM platforms.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 14:13:48 +02:00
Alexandre Julliard
57f419993e
ntdll: Use a syscall thunk for NtGetContextThread().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 13:51:44 +02:00
Alexandre Julliard
15b3584603
winebuild: Store the syscall frame in the thread data on ARM64.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 13:35:30 +02:00
Alexandre Julliard
0bf52b09f2
ntdll: Update the TEB and PEB structures for newer Windows versions.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 23:21:08 +02:00