diff --git a/base/applications/drwtsn32/main.cpp b/base/applications/drwtsn32/main.cpp index 277542153f2..683e1420a6d 100644 --- a/base/applications/drwtsn32/main.cpp +++ b/base/applications/drwtsn32/main.cpp @@ -71,6 +71,17 @@ static void PrintThread(FILE* output, DumpData& data, DWORD tid, ThreadData& thr ctx.R0, ctx.R1, ctx.R2, ctx.R3, ctx.R4, ctx.R5, ctx.R6); xfprintf(output, "r7:%p r8:%p r9:%p r10:%p r11:%p r12:%p" NEWLINE, ctx.R7, ctx.R8, ctx.R9, ctx.R10, ctx.R11, ctx.R12); +#elif defined(_M_ARM64) + xfprintf(output, "x0:%p x1:%p x2:%p x3:%p x4:%p x5:%p x6:%p" NEWLINE, + ctx.X0, ctx.X1, ctx.X2, ctx.X3, ctx.X4, ctx.X5, ctx.X6); + xfprintf(output, "x7:%p x8:%p x9:%p x10:%p x11:%p x12:%p" NEWLINE, + ctx.X7, ctx.X8, ctx.X9, ctx.X10, ctx.X11, ctx.X12); + xfprintf(output, "x13:%p x14:%p x15:%p x16:%p x17:%p x18:%p" NEWLINE, + ctx.X13, ctx.X14, ctx.X15, ctx.X16, ctx.X17, ctx.X18); + xfprintf(output, "x19:%p x20:%p x21:%p x22:%p x23:%p x24:%p" NEWLINE, + ctx.X19, ctx.X20, ctx.X21, ctx.X22, ctx.X23, ctx.X24); + xfprintf(output, "x25:%p x26:%p x27:%p x28:%p" NEWLINE, + ctx.X25, ctx.X26, ctx.X27, ctx.X28); #else #error Unknown architecture #endif @@ -87,6 +98,9 @@ static void PrintThread(FILE* output, DumpData& data, DWORD tid, ThreadData& thr #elif defined(_M_ARM) xfprintf(output, "sp:%p lr:%p pc:%p cpsr:%p" NEWLINE, ctx.Sp, ctx.Lr, ctx.Pc, ctx.Cpsr); +#elif defined(_M_ARM64) + xfprintf(output, "sp:%p pc:%p fpcr:%p fpsr:%p" NEWLINE, + ctx.Sp, ctx.Pc, ctx.Fpcr, ctx.Fpsr); #else #error Unknown architecture #endif @@ -107,6 +121,16 @@ static void PrintThread(FILE* output, DumpData& data, DWORD tid, ThreadData& thr xfprintf(output, "Wvr%d:%p%s", n, ctx.Wvr[n], ((n + 1) == ARM_MAX_WATCHPOINTS) ? NEWLINE : " "); for (int n = 0; n < ARM_MAX_WATCHPOINTS; ++n) xfprintf(output, "Wcr%d:%p%s", n, ctx.Wcr[n], ((n + 1) == ARM_MAX_WATCHPOINTS) ? NEWLINE : " "); +#elif defined(_M_ARM64) + for (int n = 0; n < ARM64_MAX_BREAKPOINTS; ++n) + xfprintf(output, "Bvr%d:%p%s", n, ctx.Bvr[n], ((n + 1) == ARM64_MAX_BREAKPOINTS) ? NEWLINE : " "); + for (int n = 0; n < ARM64_MAX_BREAKPOINTS; ++n) + xfprintf(output, "Bcr%d:%p%s", n, ctx.Bcr[n], ((n + 1) == ARM64_MAX_BREAKPOINTS) ? NEWLINE : " "); + + for (int n = 0; n < ARM64_MAX_WATCHPOINTS; ++n) + xfprintf(output, "Wvr%d:%p%s", n, ctx.Wvr[n], ((n + 1) == ARM64_MAX_WATCHPOINTS) ? NEWLINE : " "); + for (int n = 0; n < ARM64_MAX_WATCHPOINTS; ++n) + xfprintf(output, "Wcr%d:%p%s", n, ctx.Wcr[n], ((n + 1) == ARM64_MAX_WATCHPOINTS) ? NEWLINE : " "); #else #error Unknown architecture #endif diff --git a/base/applications/drwtsn32/stacktrace.cpp b/base/applications/drwtsn32/stacktrace.cpp index 4742349117b..3900a7e5f1f 100644 --- a/base/applications/drwtsn32/stacktrace.cpp +++ b/base/applications/drwtsn32/stacktrace.cpp @@ -64,7 +64,7 @@ void PrintStackBacktrace(FILE* output, DumpData& data, ThreadData& thread) MachineType = IMAGE_FILE_MACHINE_ARM64; StackFrame.AddrPC.Offset = thread.Context.Pc; StackFrame.AddrStack.Offset = thread.Context.Sp; - StackFrame.AddrFrame.Offset = thread.Context.u.s.Fp; + StackFrame.AddrFrame.Offset = thread.Context.Fp; #else #error "Unknown architecture" #endif diff --git a/dll/win32/msvcrt/msvcrt.spec b/dll/win32/msvcrt/msvcrt.spec index 9f2c5a55eb6..3087dc38ed2 100644 --- a/dll/win32/msvcrt/msvcrt.spec +++ b/dll/win32/msvcrt/msvcrt.spec @@ -230,7 +230,7 @@ @ extern _HUGE @ cdecl _Strftime(str long str ptr ptr) @ cdecl _XcptFilter(long ptr) -@ stdcall -arch=x86_64,arm __C_specific_handler(ptr long ptr ptr) +@ stdcall -arch=x86_64,arm,arm64 __C_specific_handler(ptr long ptr ptr) @ cdecl __CppXcptFilter(long ptr) @ stub -version=0x600+ -arch=i386 __CxxCallUnwindDelDtor @ stub -arch=i386 __CxxCallUnwindDtor @@ -240,7 +240,7 @@ @ cdecl -arch=i386,x86_64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ cdecl -arch=i386 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler @ cdecl -version=0x600+ -arch=x86_64 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler -@ cdecl -arch=arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) +@ cdecl -arch=arm,arm64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) @ cdecl -version=0x600+ -arch=i386 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) @ cdecl -version=0x600+ -arch=x86_64 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) diff --git a/sdk/lib/atl/atlwin.h b/sdk/lib/atl/atlwin.h index 19d438523cc..fe1fe3657df 100644 --- a/sdk/lib/atl/atlwin.h +++ b/sdk/lib/atl/atlwin.h @@ -224,6 +224,27 @@ struct thunkCode } }; #pragma pack(pop) +#elif defined(_M_ARM64) + +#pragma pack(push,4) +struct thunkCode +{ + DWORD64 m_mov_x0; /* mov r0, m_this */ + DWORD64 m_mov_pc; /* mov pc, m_proc */ + DWORD64 m_this; + DWORD64 m_proc; + + void + Init(WNDPROC proc, void *pThis) + { + m_mov_x0 = 0xE59F0000; + m_mov_pc = 0xE59FF000; + m_this = (DWORD64)pThis; + m_proc = (DWORD64)proc; + FlushInstructionCache(GetCurrentProcess(), this, sizeof(thunkCode)); + } +}; +#pragma pack(pop) #else #error ARCH not supported diff --git a/sdk/lib/crt/oldnames-msvcrt.S b/sdk/lib/crt/oldnames-msvcrt.S index 58d2f6e9491..8c3345d5fa6 100644 --- a/sdk/lib/crt/oldnames-msvcrt.S +++ b/sdk/lib/crt/oldnames-msvcrt.S @@ -47,7 +47,24 @@ ENDM CREATE_ALIAS2 $alias, $target IMPORT IMPSYM($alias), WEAK IMPSYM($target) MEND + MACRO + CREATE_ALIAS $alias, $target + CREATE_ALIAS1 $alias, $target + CREATE_ALIAS2 $alias, $target + MEND +#elif defined(_M_ARM64) + +#include + MACRO + CREATE_ALIAS1 $alias, $target + IMPORT SYM($alias), WEAK SYM($target) + MEND + + MACRO + CREATE_ALIAS2 $alias, $target + IMPORT IMPSYM($alias), WEAK IMPSYM($target) + MEND MACRO CREATE_ALIAS $alias, $target CREATE_ALIAS1 $alias, $target