From 3d3d0806886b7a4d6470ed97a6368926059dc034 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 8 Sep 2017 09:47:33 +0300 Subject: [PATCH] msvcrt: Implement setjmp/longjmp on aarch64. Also include the rest of except_*.c (based on except_arm.c) as stubs. Signed-off-by: Martin Storsjo Signed-off-by: Alexandre Julliard --- .../api-ms-win-crt-private-l1-1-0.spec | 16 +- .../api-ms-win-crt-runtime-l1-1-0.spec | 4 +- dlls/crtdll/crtdll.spec | 6 +- dlls/msvcr100/Makefile.in | 1 + dlls/msvcr100/msvcr100.spec | 20 +- dlls/msvcr110/Makefile.in | 1 + dlls/msvcr110/msvcr110.spec | 20 +- dlls/msvcr120/Makefile.in | 1 + dlls/msvcr120/msvcr120.spec | 20 +- dlls/msvcr120_app/msvcr120_app.spec | 20 +- dlls/msvcr70/Makefile.in | 1 + dlls/msvcr70/msvcr70.spec | 14 +- dlls/msvcr71/Makefile.in | 1 + dlls/msvcr71/msvcr71.spec | 16 +- dlls/msvcr80/Makefile.in | 1 + dlls/msvcr80/msvcr80.spec | 20 +- dlls/msvcr90/Makefile.in | 1 + dlls/msvcr90/msvcr90.spec | 20 +- dlls/msvcrt/Makefile.in | 1 + dlls/msvcrt/except_arm64.c | 237 ++++++++++++++++++ dlls/msvcrt/msvcrt.h | 22 ++ dlls/msvcrt/msvcrt.spec | 20 +- dlls/msvcrt20/msvcrt20.spec | 8 +- dlls/msvcrt40/msvcrt40.spec | 8 +- dlls/msvcrtd/msvcrtd.spec | 8 +- dlls/ucrtbase/Makefile.in | 1 + dlls/ucrtbase/ucrtbase.spec | 20 +- dlls/vcruntime140/vcruntime140.spec | 16 +- include/msvcrt/setjmp.h | 27 ++ include/winnt.h | 39 +++ 30 files changed, 462 insertions(+), 128 deletions(-) create mode 100644 dlls/msvcrt/except_arm64.c diff --git a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec index 741ca2e5cfb..2ce5311e29d 100644 --- a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec +++ b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec @@ -15,13 +15,13 @@ @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ucrtbase.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) ucrtbase.__CxxDetectRethrow -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) ucrtbase.__CxxExceptionFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler2 -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler3 +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) ucrtbase.__CxxDetectRethrow +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) ucrtbase.__CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler2 +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler3 @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) ucrtbase.__CxxLongjmpUnwind -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() ucrtbase.__CxxQueryExceptionSize +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() ucrtbase.__CxxQueryExceptionSize @ cdecl __CxxRegisterExceptionObject(ptr ptr) ucrtbase.__CxxRegisterExceptionObject @ cdecl __CxxUnregisterExceptionObject(ptr long) ucrtbase.__CxxUnregisterExceptionObject @ cdecl __DestructExceptionObject(ptr) ucrtbase.__DestructExceptionObject @@ -38,7 +38,7 @@ @ stub __dcrt_get_wide_environment_from_os @ stub __dcrt_initial_narrow_environment @ stub __intrinsic_abnormal_termination -@ cdecl -arch=i386,x86_64,arm -norelay __intrinsic_setjmp(ptr) ucrtbase.__intrinsic_setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __intrinsic_setjmp(ptr) ucrtbase.__intrinsic_setjmp @ stub __intrinsic_setjmpex @ stub __processing_throw @ stub __report_gsfailure @@ -1151,7 +1151,7 @@ @ cdecl _set_purecall_handler(ptr) ucrtbase._set_purecall_handler @ cdecl _set_se_translator(ptr) ucrtbase._set_se_translator @ cdecl -arch=i386 -norelay _setjmp3(ptr long) ucrtbase._setjmp3 -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) ucrtbase.longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) ucrtbase.longjmp @ cdecl memchr(ptr long long) ucrtbase.memchr @ cdecl memcmp(ptr ptr long) ucrtbase.memcmp @ cdecl memcpy(ptr ptr long) ucrtbase.memcpy diff --git a/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec b/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec index e9382cd39da..caf01938c24 100644 --- a/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec +++ b/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec @@ -36,7 +36,7 @@ @ cdecl _errno() ucrtbase._errno @ cdecl _execute_onexit_table(ptr) ucrtbase._execute_onexit_table @ cdecl _exit(long) ucrtbase._exit -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) ucrtbase._fpieee_flt +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) ucrtbase._fpieee_flt @ cdecl _fpreset() ucrtbase._fpreset @ cdecl _get_doserrno(ptr) ucrtbase._get_doserrno @ cdecl _get_errno(ptr) ucrtbase._get_errno @@ -63,7 +63,7 @@ @ cdecl _register_onexit_function(ptr ptr) ucrtbase._register_onexit_function @ stub _register_thread_local_exe_atexit_callback @ cdecl _resetstkoflw() ucrtbase._resetstkoflw -@ cdecl -arch=i386,x86_64,arm _seh_filter_dll(long ptr) ucrtbase._seh_filter_dll +@ cdecl -arch=i386,x86_64,arm,arm64 _seh_filter_dll(long ptr) ucrtbase._seh_filter_dll @ cdecl _seh_filter_exe(long ptr) ucrtbase._seh_filter_exe @ cdecl _set_abort_behavior(long long) ucrtbase._set_abort_behavior @ cdecl _set_app_type(long) ucrtbase._set_app_type diff --git a/dlls/crtdll/crtdll.spec b/dlls/crtdll/crtdll.spec index aecb3b4c36a..f8210b01108 100644 --- a/dlls/crtdll/crtdll.spec +++ b/dlls/crtdll/crtdll.spec @@ -108,7 +108,7 @@ @ cdecl _flushall() msvcrt._flushall @ extern _fmode_dll msvcrt._fmode @ cdecl _fpclass(double) msvcrt._fpclass -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt @ cdecl _fpreset() msvcrt._fpreset @ cdecl _fputchar(long) msvcrt._fputchar @ cdecl _fputwchar(long) msvcrt._fputwchar @@ -266,7 +266,7 @@ @ cdecl _scalb(double long) msvcrt._scalb @ cdecl _searchenv(str str ptr) msvcrt._searchenv @ cdecl _seterrormode(long) msvcrt._seterrormode -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcrt._setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) msvcrt._setjmp @ cdecl _setmode(long long) msvcrt._setmode @ cdecl _setsystime(ptr long) msvcrt._setsystime @ cdecl _sleep(long) msvcrt._sleep @@ -427,7 +427,7 @@ @ cdecl localtime(ptr) msvcrt.localtime @ cdecl log(double) msvcrt.log @ cdecl log10(double) msvcrt.log10 -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcrt.longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) msvcrt.longjmp @ cdecl malloc(long) msvcrt.malloc @ cdecl mblen(ptr long) msvcrt.mblen @ cdecl mbstowcs(ptr str long) msvcrt.mbstowcs diff --git a/dlls/msvcr100/Makefile.in b/dlls/msvcr100/Makefile.in index e8ab3e88e37..07a3ece3cbb 100644 --- a/dlls/msvcr100/Makefile.in +++ b/dlls/msvcr100/Makefile.in @@ -14,6 +14,7 @@ C_SRCS = \ errno.c \ except.c \ except_arm.c \ + except_arm64.c \ except_i386.c \ except_x86_64.c \ exit.c \ diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index f9f432fc936..a8c7862ceb7 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -542,18 +542,18 @@ @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CppXcptFilter(long ptr) @ stub __CxxCallUnwindDelDtor @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindStdDelDtor @ stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() @ cdecl __CxxRegisterExceptionObject(ptr ptr) @ cdecl __CxxUnregisterExceptionObject(ptr long) @ cdecl __DestructExceptionObject(ptr) @@ -825,7 +825,7 @@ @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass # stub -arch=x86_64 _fpclassf -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ stub _fprintf_l @ stub _fprintf_p @@ -1284,7 +1284,7 @@ @ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output @ cdecl _set_purecall_handler(ptr) @ cdecl _seterrormode(long) -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) MSVCRT__setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 @ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) MSVCRT__setjmpex @ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio @@ -1739,7 +1739,7 @@ @ cdecl -arch=arm,x86_64,arm64 logf(float) MSVCRT_logf @ cdecl log10(double) MSVCRT_log10 @ cdecl -arch=arm,x86_64,arm64 log10f(float) MSVCRT_log10f -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) MSVCRT_longjmp @ cdecl malloc(long) MSVCRT_malloc @ cdecl mblen(ptr long) MSVCRT_mblen @ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen diff --git a/dlls/msvcr110/Makefile.in b/dlls/msvcr110/Makefile.in index 2e9b51cadf4..056eb3989f1 100644 --- a/dlls/msvcr110/Makefile.in +++ b/dlls/msvcr110/Makefile.in @@ -14,6 +14,7 @@ C_SRCS = \ errno.c \ except.c \ except_arm.c \ + except_arm64.c \ except_i386.c \ except_x86_64.c \ exit.c \ diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 01793c77b4f..5f4c497d715 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -873,14 +873,14 @@ @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 __CppXcptFilter(long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() @ cdecl __CxxRegisterExceptionObject(ptr ptr) @ cdecl __CxxUnregisterExceptionObject(ptr long) @ cdecl __DestructExceptionObject(ptr) @@ -1172,7 +1172,7 @@ @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass # stub -arch=x86_64 _fpclassf -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ stub _fprintf_l @ stub _fprintf_p @@ -1641,7 +1641,7 @@ @ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output @ cdecl _set_purecall_handler(ptr) @ cdecl _seterrormode(long) -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) MSVCRT__setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 @ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) MSVCRT__setjmpex @ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio @@ -2097,7 +2097,7 @@ @ cdecl -arch=arm,x86_64,arm64 logf(float) MSVCRT_logf @ cdecl log10(double) MSVCRT_log10 @ cdecl -arch=arm,x86_64,arm64 log10f(float) MSVCRT_log10f -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) MSVCRT_longjmp @ cdecl malloc(long) MSVCRT_malloc @ cdecl mblen(ptr long) MSVCRT_mblen @ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen diff --git a/dlls/msvcr120/Makefile.in b/dlls/msvcr120/Makefile.in index bcfb226073d..1ee05d9a1be 100644 --- a/dlls/msvcr120/Makefile.in +++ b/dlls/msvcr120/Makefile.in @@ -14,6 +14,7 @@ C_SRCS = \ errno.c \ except.c \ except_arm.c \ + except_arm64.c \ except_i386.c \ except_x86_64.c \ exit.c \ diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index a6a08ad418d..75f0428343f 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -857,14 +857,14 @@ @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 __CppXcptFilter(long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() @ cdecl __CxxRegisterExceptionObject(ptr ptr) @ cdecl __CxxUnregisterExceptionObject(ptr long) @ cdecl __DestructExceptionObject(ptr) @@ -1172,7 +1172,7 @@ @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass # stub -arch=x86_64 _fpclassf -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ stub _fprintf_l @ stub _fprintf_p @@ -1652,7 +1652,7 @@ @ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output @ cdecl _set_purecall_handler(ptr) @ cdecl _seterrormode(long) -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) MSVCRT__setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 @ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) MSVCRT__setjmpex @ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio @@ -2268,7 +2268,7 @@ @ stub logb @ stub logbf @ stub logbl -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) MSVCRT_longjmp @ cdecl lrint(double) MSVCR120_lrint @ cdecl lrintf(float) MSVCR120_lrintf @ cdecl lrintl(double) MSVCR120_lrintl diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 98678d19dcd..cd9c44dd91e 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -851,14 +851,14 @@ @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) msvcr120.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) msvcr120.__CppXcptFilter -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) msvcr120.__CxxDetectRethrow -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) msvcr120.__CxxExceptionFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcr120.__CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) msvcr120.__CxxFrameHandler2 -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) msvcr120.__CxxFrameHandler3 +@ cdecl -arch=i386,x86_64,arm,arm64 __CppXcptFilter(long ptr) msvcr120.__CppXcptFilter +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) msvcr120.__CxxDetectRethrow +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) msvcr120.__CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcr120.__CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) msvcr120.__CxxFrameHandler2 +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) msvcr120.__CxxFrameHandler3 @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) msvcr120.__CxxLongjmpUnwind -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() msvcr120.__CxxQueryExceptionSize +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() msvcr120.__CxxQueryExceptionSize @ cdecl __CxxRegisterExceptionObject(ptr ptr) msvcr120.__CxxRegisterExceptionObject @ cdecl __CxxUnregisterExceptionObject(ptr long) msvcr120.__CxxUnregisterExceptionObject @ cdecl __DestructExceptionObject(ptr) msvcr120.__DestructExceptionObject @@ -1100,7 +1100,7 @@ @ extern _fmode msvcr120._fmode @ cdecl _fpclass(double) msvcr120._fpclass # stub -arch=x86_64 _fpclassf -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) msvcr120._fpieee_flt +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) msvcr120._fpieee_flt @ cdecl _fpreset() msvcr120._fpreset @ stub _fprintf_l @ stub _fprintf_p @@ -1373,7 +1373,7 @@ @ cdecl _set_output_format(long) msvcr120._set_output_format @ cdecl _set_printf_count_output(long) msvcr120._set_printf_count_output @ cdecl _set_purecall_handler(ptr) msvcr120._set_purecall_handler -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcr120._setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) msvcr120._setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcr120._setjmp3 @ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) msvcr120._setjmpex @ cdecl _setmaxstdio(long) msvcr120._setmaxstdio @@ -1931,7 +1931,7 @@ @ stub logb @ stub logbf @ stub logbl -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcr120.longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) msvcr120.longjmp @ cdecl lrint(double) msvcr120.lrint @ cdecl lrintf(float) msvcr120.lrintf @ cdecl lrintl(double) msvcr120.lrintl diff --git a/dlls/msvcr70/Makefile.in b/dlls/msvcr70/Makefile.in index f7b0910b54e..e068b13c235 100644 --- a/dlls/msvcr70/Makefile.in +++ b/dlls/msvcr70/Makefile.in @@ -14,6 +14,7 @@ C_SRCS = \ errno.c \ except.c \ except_arm.c \ + except_arm64.c \ except_i386.c \ except_x86_64.c \ exit.c \ diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec index fb5aa9d791a..9816067fc41 100644 --- a/dlls/msvcr70/msvcr70.spec +++ b/dlls/msvcr70/msvcr70.spec @@ -118,11 +118,11 @@ @ cdecl _XcptFilter(long ptr) @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() @ cdecl __CxxRegisterExceptionObject(ptr ptr) @ cdecl __CxxUnregisterExceptionObject(ptr long) @ cdecl __DestructExceptionObject(ptr) @@ -313,7 +313,7 @@ @ cdecl _flushall() MSVCRT__flushall @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ cdecl _fputchar(long) MSVCRT__fputchar @ cdecl _fputwchar(long) MSVCRT__fputwchar @@ -518,7 +518,7 @@ @ cdecl _set_sbh_threshold(long) @ cdecl _set_security_error_handler(ptr) @ cdecl _seterrormode(long) -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) MSVCRT__setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 @ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio @ cdecl _setmbcp(long) @@ -771,7 +771,7 @@ @ cdecl localtime(ptr) MSVCRT_localtime @ cdecl log(double) MSVCRT_log @ cdecl log10(double) MSVCRT_log10 -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) MSVCRT_longjmp @ cdecl malloc(long) MSVCRT_malloc @ cdecl mblen(ptr long) MSVCRT_mblen @ cdecl mbstowcs(ptr str long) MSVCRT_mbstowcs diff --git a/dlls/msvcr71/Makefile.in b/dlls/msvcr71/Makefile.in index a62630e5bf5..58563b7f5cb 100644 --- a/dlls/msvcr71/Makefile.in +++ b/dlls/msvcr71/Makefile.in @@ -14,6 +14,7 @@ C_SRCS = \ errno.c \ except.c \ except_arm.c \ + except_arm64.c \ except_i386.c \ except_x86_64.c \ exit.c \ diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec index b7acbfbcfb3..90516b7f1b6 100644 --- a/dlls/msvcr71/msvcr71.spec +++ b/dlls/msvcr71/msvcr71.spec @@ -110,14 +110,14 @@ @ extern _HUGE MSVCRT__HUGE @ cdecl _Strftime(ptr long str ptr ptr) @ cdecl _XcptFilter(long ptr) -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CppXcptFilter(long ptr) @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() @ cdecl __CxxRegisterExceptionObject(ptr ptr) @ cdecl __CxxUnregisterExceptionObject(ptr long) @ cdecl __DestructExceptionObject(ptr) @@ -307,7 +307,7 @@ @ cdecl _flushall() MSVCRT__flushall @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ cdecl _fputchar(long) MSVCRT__fputchar @ cdecl _fputwchar(long) MSVCRT__fputwchar @@ -514,7 +514,7 @@ @ cdecl _set_sbh_threshold(long) @ cdecl _set_security_error_handler(ptr) @ cdecl _seterrormode(long) -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) MSVCRT__setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 @ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio @ cdecl _setmbcp(long) @@ -767,7 +767,7 @@ @ cdecl localtime(ptr) MSVCRT_localtime @ cdecl log(double) MSVCRT_log @ cdecl log10(double) MSVCRT_log10 -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) MSVCRT_longjmp @ cdecl malloc(long) MSVCRT_malloc @ cdecl mblen(ptr long) MSVCRT_mblen @ cdecl mbstowcs(ptr str long) MSVCRT_mbstowcs diff --git a/dlls/msvcr80/Makefile.in b/dlls/msvcr80/Makefile.in index e17b7ac7e53..05b7a5b5af2 100644 --- a/dlls/msvcr80/Makefile.in +++ b/dlls/msvcr80/Makefile.in @@ -14,6 +14,7 @@ C_SRCS = \ errno.c \ except.c \ except_arm.c \ + except_arm64.c \ except_i386.c \ except_x86_64.c \ exit.c \ diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index fdc0667f455..5cc86918504 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -176,18 +176,18 @@ @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CppXcptFilter(long ptr) @ stub __CxxCallUnwindDelDtor @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindStdDelDtor @ stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() @ cdecl __CxxRegisterExceptionObject(ptr ptr) @ cdecl __CxxUnregisterExceptionObject(ptr long) @ cdecl __DestructExceptionObject(ptr) @@ -491,7 +491,7 @@ @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass # stub -arch=x86_64 _fpclassf -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ stub _fprintf_l @ stub _fprintf_p @@ -964,7 +964,7 @@ @ cdecl _set_purecall_handler(ptr) @ cdecl _set_sbh_threshold(long) @ cdecl _seterrormode(long) -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) MSVCRT__setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 @ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) MSVCRT__setjmpex @ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio @@ -1419,7 +1419,7 @@ @ cdecl -arch=arm,x86_64,arm64 logf(float) MSVCRT_logf @ cdecl log10(double) MSVCRT_log10 @ cdecl -arch=arm,x86_64,arm64 log10f(float) MSVCRT_log10f -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) MSVCRT_longjmp @ cdecl malloc(long) MSVCRT_malloc @ cdecl mblen(ptr long) MSVCRT_mblen @ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen diff --git a/dlls/msvcr90/Makefile.in b/dlls/msvcr90/Makefile.in index d409039f680..590b4b87075 100644 --- a/dlls/msvcr90/Makefile.in +++ b/dlls/msvcr90/Makefile.in @@ -14,6 +14,7 @@ C_SRCS = \ errno.c \ except.c \ except_arm.c \ + except_arm64.c \ except_i386.c \ except_x86_64.c \ exit.c \ diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index cb8344cdc7d..57a4741c2eb 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -167,18 +167,18 @@ @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CppXcptFilter(long ptr) @ stub __CxxCallUnwindDelDtor @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindStdDelDtor @ stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() @ cdecl __CxxRegisterExceptionObject(ptr ptr) @ cdecl __CxxUnregisterExceptionObject(ptr long) @ cdecl __DestructExceptionObject(ptr) @@ -474,7 +474,7 @@ @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass # stub -arch=win64 _fpclassf(float) -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ stub _fprintf_l @ stub _fprintf_p @@ -940,7 +940,7 @@ @ cdecl _set_purecall_handler(ptr) @ cdecl _set_sbh_threshold(long) @ cdecl _seterrormode(long) -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) MSVCRT__setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 @ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio @ cdecl _setmbcp(long) @@ -1392,7 +1392,7 @@ @ cdecl log10(double) MSVCRT_log10 @ cdecl -arch=arm,x86_64,arm64 log10f(float) MSVCRT_log10f @ cdecl -arch=arm,x86_64,arm64 logf(float) MSVCRT_logf -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) MSVCRT_longjmp @ cdecl malloc(long) MSVCRT_malloc @ cdecl mblen(ptr long) MSVCRT_mblen @ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen diff --git a/dlls/msvcrt/Makefile.in b/dlls/msvcrt/Makefile.in index 06b4cccb611..ad6864a028a 100644 --- a/dlls/msvcrt/Makefile.in +++ b/dlls/msvcrt/Makefile.in @@ -13,6 +13,7 @@ C_SRCS = \ errno.c \ except.c \ except_arm.c \ + except_arm64.c \ except_i386.c \ except_x86_64.c \ exit.c \ diff --git a/dlls/msvcrt/except_arm64.c b/dlls/msvcrt/except_arm64.c new file mode 100644 index 00000000000..b024d497adf --- /dev/null +++ b/dlls/msvcrt/except_arm64.c @@ -0,0 +1,237 @@ +/* + * msvcrt C++ exception handling + * + * Copyright 2011 Alexandre Julliard + * Copyright 2013 André Hentschel + * Copyright 2017 Martin Storsjo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#ifdef __aarch64__ + +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winternl.h" +#include "msvcrt.h" +#include "wine/exception.h" +#include "excpt.h" +#include "wine/debug.h" + +#include "cppexcept.h" + +WINE_DEFAULT_DEBUG_CHANNEL(seh); + +struct _DISPATCHER_CONTEXT; + +typedef LONG (WINAPI *PC_LANGUAGE_EXCEPTION_HANDLER)( EXCEPTION_POINTERS *ptrs, ULONG64 frame ); +typedef EXCEPTION_DISPOSITION (WINAPI *PEXCEPTION_ROUTINE)( EXCEPTION_RECORD *rec, + ULONG64 frame, + CONTEXT *context, + struct _DISPATCHER_CONTEXT *dispatch ); + +typedef struct _DISPATCHER_CONTEXT +{ + DWORD64 ControlPc; + DWORD64 ImageBase; + PRUNTIME_FUNCTION FunctionEntry; + DWORD64 EstablisherFrame; + DWORD64 TargetPc; + PCONTEXT ContextRecord; + PEXCEPTION_ROUTINE LanguageHandler; + PVOID HandlerData; + PUNWIND_HISTORY_TABLE HistoryTable; + DWORD ScopeIndex; + BOOLEAN ControlPcIsUnwound; + PBYTE NonVolatileRegisters; +} DISPATCHER_CONTEXT; + +/********************************************************************* + * __CxxExceptionFilter (MSVCRT.@) + */ +int CDECL __CxxExceptionFilter( PEXCEPTION_POINTERS ptrs, + const type_info *ti, int flags, void **copy ) +{ + FIXME( "%p %p %x %p: not implemented\n", ptrs, ti, flags, copy ); + return EXCEPTION_CONTINUE_SEARCH; +} + +/********************************************************************* + * __CxxFrameHandler (MSVCRT.@) + */ +EXCEPTION_DISPOSITION CDECL __CxxFrameHandler(EXCEPTION_RECORD *rec, DWORD frame, CONTEXT *context, + DISPATCHER_CONTEXT *dispatch) +{ + FIXME("%p %x %p %p: not implemented\n", rec, frame, context, dispatch); + return ExceptionContinueSearch; +} + + +/********************************************************************* + * __CppXcptFilter (MSVCRT.@) + */ +int CDECL __CppXcptFilter(NTSTATUS ex, PEXCEPTION_POINTERS ptr) +{ + /* only filter c++ exceptions */ + if (ex != CXX_EXCEPTION) return EXCEPTION_CONTINUE_SEARCH; + return _XcptFilter(ex, ptr); +} + + +/********************************************************************* + * __CxxDetectRethrow (MSVCRT.@) + */ +BOOL CDECL __CxxDetectRethrow(PEXCEPTION_POINTERS ptrs) +{ + PEXCEPTION_RECORD rec; + + if (!ptrs) + return FALSE; + + rec = ptrs->ExceptionRecord; + + if (rec->ExceptionCode == CXX_EXCEPTION && + rec->NumberParameters == 3 && + rec->ExceptionInformation[0] == CXX_FRAME_MAGIC_VC6 && + rec->ExceptionInformation[2]) + { + ptrs->ExceptionRecord = msvcrt_get_thread_data()->exc_record; + return TRUE; + } + return (msvcrt_get_thread_data()->exc_record == rec); +} + + +/********************************************************************* + * __CxxQueryExceptionSize (MSVCRT.@) + */ +unsigned int CDECL __CxxQueryExceptionSize(void) +{ + return sizeof(cxx_exception_type); +} + + +/******************************************************************* + * _setjmp (MSVCRT.@) + */ +__ASM_GLOBAL_FUNC(MSVCRT__setjmp, + "mov x1, #0\n\t" /* frame */ + "b " __ASM_NAME("MSVCRT__setjmpex")); + +/******************************************************************* + * _setjmpex (MSVCRT.@) + */ +__ASM_GLOBAL_FUNC(MSVCRT__setjmpex, + "str x1, [x0]\n\t" /* jmp_buf->Frame */ + "str x19, [x0, #0x10]\n\t" /* jmp_buf->X19 */ + "str x20, [x0, #0x18]\n\t" /* jmp_buf->X20 */ + "str x21, [x0, #0x20]\n\t" /* jmp_buf->X21 */ + "str x22, [x0, #0x28]\n\t" /* jmp_buf->X22 */ + "str x23, [x0, #0x30]\n\t" /* jmp_buf->X23 */ + "str x24, [x0, #0x38]\n\t" /* jmp_buf->X24 */ + "str x25, [x0, #0x40]\n\t" /* jmp_buf->X25 */ + "str x26, [x0, #0x48]\n\t" /* jmp_buf->X26 */ + "str x26, [x0, #0x50]\n\t" /* jmp_buf->X27 */ + "str x28, [x0, #0x58]\n\t" /* jmp_buf->X28 */ + "str x29, [x0, #0x60]\n\t" /* jmp_buf->Fp */ + "str x30, [x0, #0x68]\n\t" /* jmp_buf->Lr */ + "mov x2, sp\n\t" + "str x2, [x0, #0x70]\n\t" /* jmp_buf->Sp */ + "mrs x2, fpcr\n\t" + "str w2, [x0, #0x78]\n\t" /* jmp_buf->Fpcr */ + "mrs x2, fpsr\n\t" + "str w2, [x0, #0x7c]\n\t" /* jmp_buf->Fpsr */ + "str d8, [x0, #0x80]\n\t" /* jmp_buf->D[0] */ + "str d9, [x0, #0x88]\n\t" /* jmp_buf->D[1] */ + "str d10, [x0, #0x90]\n\t" /* jmp_buf->D[2] */ + "str d11, [x0, #0x98]\n\t" /* jmp_buf->D[3] */ + "str d12, [x0, #0xa0]\n\t" /* jmp_buf->D[4] */ + "str d13, [x0, #0xa8]\n\t" /* jmp_buf->D[5] */ + "str d14, [x0, #0xb0]\n\t" /* jmp_buf->D[6] */ + "str d15, [x0, #0xb8]\n\t" /* jmp_buf->D[7] */ + "mov x0, #0\n\t" + "ret"); + + +extern void DECLSPEC_NORETURN CDECL longjmp_set_regs(struct MSVCRT___JUMP_BUFFER *jmp, int retval); +__ASM_GLOBAL_FUNC(longjmp_set_regs, + "ldr x19, [x0, #0x10]\n\t" /* jmp_buf->X19 */ + "ldr x20, [x0, #0x18]\n\t" /* jmp_buf->X20 */ + "ldr x21, [x0, #0x20]\n\t" /* jmp_buf->X21 */ + "ldr x22, [x0, #0x28]\n\t" /* jmp_buf->X22 */ + "ldr x23, [x0, #0x30]\n\t" /* jmp_buf->X23 */ + "ldr x24, [x0, #0x38]\n\t" /* jmp_buf->X24 */ + "ldr x25, [x0, #0x40]\n\t" /* jmp_buf->X25 */ + "ldr x26, [x0, #0x48]\n\t" /* jmp_buf->X26 */ + "ldr x26, [x0, #0x50]\n\t" /* jmp_buf->X27 */ + "ldr x28, [x0, #0x58]\n\t" /* jmp_buf->X28 */ + "ldr x29, [x0, #0x60]\n\t" /* jmp_buf->Fp */ + "ldr x30, [x0, #0x68]\n\t" /* jmp_buf->Lr */ + "ldr x2, [x0, #0x70]\n\t" /* jmp_buf->Sp */ + "mov sp, x2\n\t" + "ldr w2, [x0, #0x78]\n\t" /* jmp_buf->Fpcr */ + "msr fpcr, x2\n\t" + "ldr w2, [x0, #0x7c]\n\t" /* jmp_buf->Fpsr */ + "msr fpsr, x2\n\t" + "ldr d8, [x0, #0x80]\n\t" /* jmp_buf->D[0] */ + "ldr d9, [x0, #0x88]\n\t" /* jmp_buf->D[1] */ + "ldr d10, [x0, #0x90]\n\t" /* jmp_buf->D[2] */ + "ldr d11, [x0, #0x98]\n\t" /* jmp_buf->D[3] */ + "ldr d12, [x0, #0xa0]\n\t" /* jmp_buf->D[4] */ + "ldr d13, [x0, #0xa8]\n\t" /* jmp_buf->D[5] */ + "ldr d14, [x0, #0xb0]\n\t" /* jmp_buf->D[6] */ + "ldr d15, [x0, #0xb8]\n\t" /* jmp_buf->D[7] */ + "mov x0, x1\n\t" /* retval */ + "ret"); + +/******************************************************************* + * longjmp (MSVCRT.@) + */ +void __cdecl MSVCRT_longjmp(struct MSVCRT___JUMP_BUFFER *jmp, int retval) +{ + EXCEPTION_RECORD rec; + + if (!retval) retval = 1; + if (jmp->Frame) + { + rec.ExceptionCode = STATUS_LONGJUMP; + rec.ExceptionFlags = 0; + rec.ExceptionRecord = NULL; + rec.ExceptionAddress = NULL; + rec.NumberParameters = 1; + rec.ExceptionInformation[0] = (DWORD_PTR)jmp; + RtlUnwind((void *)jmp->Frame, (void *)jmp->Lr, &rec, IntToPtr(retval)); + } + longjmp_set_regs(jmp, retval); +} + +/********************************************************************* + * _fpieee_flt (MSVCRT.@) + */ +int __cdecl _fpieee_flt(ULONG exception_code, EXCEPTION_POINTERS *ep, + int (__cdecl *handler)(_FPIEEE_RECORD*)) +{ + FIXME("(%x %p %p)\n", exception_code, ep, handler); + return EXCEPTION_CONTINUE_SEARCH; +} + +#endif /* __aarch64__ */ diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index c39becaeab1..be0c1a264bb 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -539,6 +539,28 @@ struct MSVCRT___JUMP_BUFFER unsigned long Fpscr; unsigned long long D[8]; }; +#elif defined(__aarch64__) +struct MSVCRT___JUMP_BUFFER +{ + unsigned __int64 Frame; + unsigned __int64 Reserved; + unsigned __int64 X19; + unsigned __int64 X20; + unsigned __int64 X21; + unsigned __int64 X22; + unsigned __int64 X23; + unsigned __int64 X24; + unsigned __int64 X25; + unsigned __int64 X26; + unsigned __int64 X27; + unsigned __int64 X28; + unsigned __int64 Fp; + unsigned __int64 Lr; + unsigned __int64 Sp; + unsigned long Fpcr; + unsigned long Fpsr; + double D[8]; +}; #endif /* __i386__ */ struct MSVCRT__diskfree_t { diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index ee59ae6aef9..1e2b0434a73 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -173,17 +173,17 @@ @ cdecl _Strftime(ptr long str ptr ptr) @ cdecl _XcptFilter(long ptr) @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CppXcptFilter(long ptr) # stub __CxxCallUnwindDelDtor # stub __CxxCallUnwindDtor # stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() @ cdecl __CxxRegisterExceptionObject(ptr ptr) @ cdecl __CxxUnregisterExceptionObject(ptr long) @ cdecl __DestructExceptionObject(ptr) @@ -457,7 +457,7 @@ @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass # stub -arch=win64 _fpclassf(float) -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() # stub _fprintf_l(ptr str ptr) # stub _fprintf_p(ptr str) @@ -901,7 +901,7 @@ @ cdecl _set_output_format(long) MSVCRT__set_output_format @ cdecl _set_sbh_threshold(long) @ cdecl _seterrormode(long) -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) MSVCRT__setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 @ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) MSVCRT__setjmpex @ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio @@ -1358,7 +1358,7 @@ @ cdecl log10(double) MSVCRT_log10 @ cdecl -arch=arm,x86_64,arm64 logf(float) MSVCRT_logf @ cdecl -arch=arm,x86_64,arm64 log10f(float) MSVCRT_log10f -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) MSVCRT_longjmp @ cdecl malloc(long) MSVCRT_malloc @ cdecl mblen(ptr long) MSVCRT_mblen @ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen diff --git a/dlls/msvcrt20/msvcrt20.spec b/dlls/msvcrt20/msvcrt20.spec index c95ba174a2f..b77b2f38a1b 100644 --- a/dlls/msvcrt20/msvcrt20.spec +++ b/dlls/msvcrt20/msvcrt20.spec @@ -793,7 +793,7 @@ @ stdcall _CxxThrowException(ptr ptr) msvcrt._CxxThrowException @ extern _HUGE msvcrt._HUGE @ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind @ cdecl __STRINGTOLD(ptr ptr str long) msvcrt.__STRINGTOLD @ extern __argc msvcrt.__argc @@ -926,7 +926,7 @@ @ cdecl _flushall() msvcrt._flushall @ extern _fmode msvcrt._fmode @ cdecl _fpclass(double) msvcrt._fpclass -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt @ cdecl _fpreset() msvcrt._fpreset @ cdecl _fputchar(long) msvcrt._fputchar @ cdecl _fputwchar(long) msvcrt._fputwchar @@ -1103,7 +1103,7 @@ @ cdecl _searchenv(str str ptr) msvcrt._searchenv @ stdcall -arch=i386 __seh_longjmp_unwind@4(ptr) msvcrt._seh_longjmp_unwind @ cdecl _seterrormode(long) msvcrt._seterrormode -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcrt._setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) msvcrt._setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3 @ cdecl _setmbcp(long) msvcrt._setmbcp @ cdecl _setmode(long long) msvcrt._setmode @@ -1359,7 +1359,7 @@ @ cdecl localtime(ptr) msvcrt.localtime @ cdecl log(double) msvcrt.log @ cdecl log10(double) msvcrt.log10 -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcrt.longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) msvcrt.longjmp @ cdecl malloc(long) msvcrt.malloc @ cdecl mblen(ptr long) msvcrt.mblen @ cdecl mbstowcs(ptr str long) msvcrt.mbstowcs diff --git a/dlls/msvcrt40/msvcrt40.spec b/dlls/msvcrt40/msvcrt40.spec index 1a5fb3986e0..5c10e67d999 100644 --- a/dlls/msvcrt40/msvcrt40.spec +++ b/dlls/msvcrt40/msvcrt40.spec @@ -868,7 +868,7 @@ @ cdecl -arch=i386 -norelay _EH_prolog() msvcrt._EH_prolog @ extern _HUGE msvcrt._HUGE @ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind @ cdecl __RTCastToVoid(ptr) msvcrt.__RTCastToVoid @ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcrt.__RTDynamicCast @@ -1012,7 +1012,7 @@ @ cdecl _flushall() msvcrt._flushall @ extern _fmode msvcrt._fmode @ cdecl _fpclass(double) msvcrt._fpclass -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt @ cdecl _fpreset() msvcrt._fpreset @ cdecl _fputchar(long) msvcrt._fputchar @ cdecl _fputwchar(long) msvcrt._fputwchar @@ -1198,7 +1198,7 @@ @ stdcall -arch=i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind @ cdecl _set_error_mode(long) msvcrt._set_error_mode @ cdecl _seterrormode(long) msvcrt._seterrormode -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcrt._setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) msvcrt._setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3 @ cdecl _setmaxstdio(long) msvcrt._setmaxstdio @ cdecl _setmbcp(long) msvcrt._setmbcp @@ -1427,7 +1427,7 @@ @ cdecl localtime(ptr) msvcrt.localtime @ cdecl log(double) msvcrt.log @ cdecl log10(double) msvcrt.log10 -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcrt.longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) msvcrt.longjmp @ cdecl malloc(long) msvcrt.malloc @ cdecl mblen(ptr long) msvcrt.mblen @ cdecl mbstowcs(ptr str long) msvcrt.mbstowcs diff --git a/dlls/msvcrtd/msvcrtd.spec b/dlls/msvcrtd/msvcrtd.spec index 87a39c4665a..43b34c4c38f 100644 --- a/dlls/msvcrtd/msvcrtd.spec +++ b/dlls/msvcrtd/msvcrtd.spec @@ -124,7 +124,7 @@ @ extern _HUGE msvcrt._HUGE @ cdecl _Strftime(ptr long str ptr ptr) msvcrt._Strftime @ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind @ cdecl __RTCastToVoid(ptr) msvcrt.__RTCastToVoid @ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcrt.__RTDynamicCast @@ -294,7 +294,7 @@ @ cdecl _flushall() msvcrt._flushall @ extern _fmode msvcrt._fmode @ cdecl _fpclass(double) msvcrt._fpclass -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt @ cdecl _fpreset() msvcrt._fpreset @ cdecl _fputchar(long) msvcrt._fputchar @ cdecl _fputwchar(long) msvcrt._fputwchar @@ -490,7 +490,7 @@ @ cdecl _set_error_mode(long) msvcrt._set_error_mode @ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold @ cdecl _seterrormode(long) msvcrt._seterrormode -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcrt._setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay _setjmp(ptr) msvcrt._setjmp @ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3 @ cdecl _setmaxstdio(long) msvcrt._setmaxstdio @ cdecl _setmbcp(long) msvcrt._setmbcp @@ -723,7 +723,7 @@ @ cdecl localtime(ptr) msvcrt.localtime @ cdecl log(double) msvcrt.log @ cdecl log10(double) msvcrt.log10 -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcrt.longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) msvcrt.longjmp @ cdecl malloc(long) msvcrt.malloc @ cdecl mblen(ptr long) msvcrt.mblen @ cdecl mbstowcs(ptr str long) msvcrt.mbstowcs diff --git a/dlls/ucrtbase/Makefile.in b/dlls/ucrtbase/Makefile.in index e5d95f8f5f8..d44b17a2dd9 100644 --- a/dlls/ucrtbase/Makefile.in +++ b/dlls/ucrtbase/Makefile.in @@ -14,6 +14,7 @@ C_SRCS = \ errno.c \ except.c \ except_arm.c \ + except_arm64.c \ except_i386.c \ except_x86_64.c \ exit.c \ diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 90ee5b6fb5b..e48c2edd5ed 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -49,13 +49,13 @@ @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() @ cdecl __CxxRegisterExceptionObject(ptr ptr) @ cdecl __CxxUnregisterExceptionObject(ptr long) @ cdecl __DestructExceptionObject(ptr) @@ -93,7 +93,7 @@ @ cdecl __fpecode() @ cdecl __initialize_lconv_for_unsigned_char() __lconv_init @ stub __intrinsic_abnormal_termination -@ cdecl -arch=i386,x86_64,arm -norelay __intrinsic_setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __intrinsic_setjmp(ptr) MSVCRT__setjmp @ stub __intrinsic_setjmpex @ cdecl __isascii(long) MSVCRT___isascii @ cdecl __iscsym(long) MSVCRT___iscsym @@ -325,7 +325,7 @@ @ cdecl _flushall() MSVCRT__flushall @ cdecl _fpclass(double) MSVCRT__fpclass @ stub _fpclassf -@ cdecl -arch=i386,x86_64,arm _fpieee_flt(long ptr ptr) +@ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _fputchar(long) MSVCRT__fputchar @@ -1874,7 +1874,7 @@ @ cdecl -arch=x86_64 _scalbf(float long) MSVCRT__scalbf @ cdecl _searchenv(str str ptr) MSVCRT__searchenv @ cdecl _searchenv_s(str str ptr long) MSVCRT__searchenv_s -@ cdecl -arch=i386,x86_64,arm _seh_filter_dll(long ptr) __CppXcptFilter +@ cdecl -arch=i386,x86_64,arm,arm64 _seh_filter_dll(long ptr) __CppXcptFilter @ cdecl _seh_filter_exe(long ptr) _XcptFilter @ cdecl -arch=win64 _set_FMA3_enable(long) MSVCRT__set_FMA3_enable @ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) @@ -2402,7 +2402,7 @@ @ stub logbf @ stub logbl @ cdecl -arch=arm,x86_64,arm64 logf(float) MSVCRT_logf -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) MSVCRT_longjmp @ cdecl lrint(double) MSVCR120_lrint @ cdecl lrintf(float) MSVCR120_lrintf @ cdecl lrintl(double) MSVCR120_lrintl diff --git a/dlls/vcruntime140/vcruntime140.spec b/dlls/vcruntime140/vcruntime140.spec index fe8ae7568bc..7dbc8cab574 100644 --- a/dlls/vcruntime140/vcruntime140.spec +++ b/dlls/vcruntime140/vcruntime140.spec @@ -12,13 +12,13 @@ @ stub __BuildCatchObjectHelper @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ucrtbase.__C_specific_handler @ stub __C_specific_handler_noexcept -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) ucrtbase.__CxxDetectRethrow -@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) ucrtbase.__CxxExceptionFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler2 -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler3 +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) ucrtbase.__CxxDetectRethrow +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) ucrtbase.__CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler2 +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler3 @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) ucrtbase.__CxxLongjmpUnwind -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() ucrtbase.__CxxQueryExceptionSize +@ cdecl -arch=i386,x86_64,arm,arm64 __CxxQueryExceptionSize() ucrtbase.__CxxQueryExceptionSize @ cdecl __CxxRegisterExceptionObject(ptr ptr) ucrtbase.__CxxRegisterExceptionObject @ cdecl __CxxUnregisterExceptionObject(ptr long) ucrtbase.__CxxUnregisterExceptionObject @ cdecl __DestructExceptionObject(ptr) ucrtbase.__DestructExceptionObject @@ -32,7 +32,7 @@ @ stub __TypeMatch @ stub __current_exception @ stub __current_exception_context -@ cdecl -arch=i386,x86_64,arm -norelay __intrinsic_setjmp(ptr) ucrtbase.__intrinsic_setjmp +@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __intrinsic_setjmp(ptr) ucrtbase.__intrinsic_setjmp @ stub __intrinsic_setjmpex @ stub __processing_throw @ stub __report_gsfailure @@ -71,7 +71,7 @@ @ cdecl _set_purecall_handler(ptr) ucrtbase._set_purecall_handler @ cdecl _set_se_translator(ptr) ucrtbase._set_se_translator @ cdecl -arch=i386 -norelay _setjmp3(ptr long) ucrtbase._setjmp3 -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) ucrtbase.longjmp +@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) ucrtbase.longjmp @ cdecl memchr(ptr long long) ucrtbase.memchr @ cdecl memcmp(ptr ptr long) ucrtbase.memcmp @ cdecl memcpy(ptr ptr long) ucrtbase.memcpy diff --git a/include/msvcrt/setjmp.h b/include/msvcrt/setjmp.h index 3c8b9fdc750..4038cbd50a1 100644 --- a/include/msvcrt/setjmp.h +++ b/include/msvcrt/setjmp.h @@ -103,6 +103,33 @@ typedef struct _JUMP_BUFFER #define _JBLEN 28 #define _JBTYPE int +#elif defined(__aarch64__) + +typedef struct _JUMP_BUFFER +{ + unsigned __int64 Frame; + unsigned __int64 Reserved; + unsigned __int64 X19; + unsigned __int64 X20; + unsigned __int64 X21; + unsigned __int64 X22; + unsigned __int64 X23; + unsigned __int64 X24; + unsigned __int64 X25; + unsigned __int64 X26; + unsigned __int64 X27; + unsigned __int64 X28; + unsigned __int64 Fp; + unsigned __int64 Lr; + unsigned __int64 Sp; + unsigned long Fpcr; + unsigned long Fpsr; + double D[8]; +} _JUMP_BUFFER; + +#define _JBLEN 24 +#define _JBTYPE unsigned __int64 + #else #define _JBLEN 1 diff --git a/include/winnt.h b/include/winnt.h index c328cbf622b..25fdab4942d 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -1756,6 +1756,45 @@ PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry(ULONG_PTR,DWORD*,UNWIND_HISTORY_ #define EXCEPTION_WRITE_FAULT 1 #define EXCEPTION_EXECUTE_FAULT 8 +typedef struct _RUNTIME_FUNCTION +{ + DWORD BeginAddress; + union + { + DWORD UnwindData; + struct + { + DWORD Flag : 2; + DWORD FunctionLength : 11; + DWORD RegF : 3; + DWORD RegI : 4; + DWORD H : 1; + DWORD CR : 2; + DWORD FrameSize : 9; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; +} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION; + +#define UNWIND_HISTORY_TABLE_SIZE 12 + +typedef struct _UNWIND_HISTORY_TABLE_ENTRY +{ + DWORD64 ImageBase; + PRUNTIME_FUNCTION FunctionEntry; +} UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY; + +typedef struct _UNWIND_HISTORY_TABLE +{ + DWORD Count; + BYTE LocalHint; + BYTE GlobalHint; + BYTE Search; + BYTE Once; + DWORD64 LowAddress; + DWORD64 HighAddress; + UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE]; +} UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE; + typedef struct _CONTEXT { ULONG ContextFlags; ULONG Cpsr;