include: Add SEH information to ARM64EC syscalls.
This commit is contained in:
parent
79b9b60914
commit
0abbb467af
3 changed files with 16 additions and 14 deletions
|
@ -48,7 +48,7 @@ ALL_SYSCALLS64
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SYSCALL_API __attribute__((naked))
|
#define SYSCALL_API __attribute__((naked))
|
||||||
#define SYSCALL_FUNC(name) __ASM_SYSCALL_FUNC( __id_##name )
|
#define SYSCALL_FUNC(name) __ASM_SYSCALL_FUNC( __id_##name, name )
|
||||||
|
|
||||||
NTSTATUS SYSCALL_API NtAcceptConnectPort( HANDLE *handle, ULONG id, LPC_MESSAGE *msg, BOOLEAN accept,
|
NTSTATUS SYSCALL_API NtAcceptConnectPort( HANDLE *handle, ULONG id, LPC_MESSAGE *msg, BOOLEAN accept,
|
||||||
LPC_SECTION_WRITE *write, LPC_SECTION_READ *read )
|
LPC_SECTION_WRITE *write, LPC_SECTION_READ *read )
|
||||||
|
@ -203,7 +203,7 @@ NTSTATUS SYSCALL_API NtConnectPort( HANDLE *handle, UNICODE_STRING *name, SECURI
|
||||||
|
|
||||||
static NTSTATUS SYSCALL_API syscall_NtContinue( ARM64_NT_CONTEXT *context, BOOLEAN alertable )
|
static NTSTATUS SYSCALL_API syscall_NtContinue( ARM64_NT_CONTEXT *context, BOOLEAN alertable )
|
||||||
{
|
{
|
||||||
__ASM_SYSCALL_FUNC( __id_NtContinue );
|
__ASM_SYSCALL_FUNC( __id_NtContinue, syscall_NtContinue );
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS WINAPI NtContinue( CONTEXT *context, BOOLEAN alertable )
|
NTSTATUS WINAPI NtContinue( CONTEXT *context, BOOLEAN alertable )
|
||||||
|
@ -502,7 +502,7 @@ NTSTATUS SYSCALL_API NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTI
|
||||||
|
|
||||||
static NTSTATUS SYSCALL_API syscall_NtGetContextThread( HANDLE handle, ARM64_NT_CONTEXT *context )
|
static NTSTATUS SYSCALL_API syscall_NtGetContextThread( HANDLE handle, ARM64_NT_CONTEXT *context )
|
||||||
{
|
{
|
||||||
__ASM_SYSCALL_FUNC( __id_NtGetContextThread );
|
__ASM_SYSCALL_FUNC( __id_NtGetContextThread, syscall_NtGetContextThread );
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
|
NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
|
||||||
|
@ -995,7 +995,7 @@ NTSTATUS SYSCALL_API NtQueueApcThread( HANDLE handle, PNTAPCFUNC func, ULONG_PTR
|
||||||
|
|
||||||
static NTSTATUS SYSCALL_API syscall_NtRaiseException( EXCEPTION_RECORD *rec, ARM64_NT_CONTEXT *context, BOOL first_chance )
|
static NTSTATUS SYSCALL_API syscall_NtRaiseException( EXCEPTION_RECORD *rec, ARM64_NT_CONTEXT *context, BOOL first_chance )
|
||||||
{
|
{
|
||||||
__ASM_SYSCALL_FUNC( __id_NtRaiseException );
|
__ASM_SYSCALL_FUNC( __id_NtRaiseException, syscall_NtRaiseException );
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance )
|
NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance )
|
||||||
|
@ -1137,7 +1137,7 @@ NTSTATUS SYSCALL_API NtSecureConnectPort( HANDLE *handle, UNICODE_STRING *name,
|
||||||
|
|
||||||
static NTSTATUS SYSCALL_API syscall_NtSetContextThread( HANDLE handle, const ARM64_NT_CONTEXT *context )
|
static NTSTATUS SYSCALL_API syscall_NtSetContextThread( HANDLE handle, const ARM64_NT_CONTEXT *context )
|
||||||
{
|
{
|
||||||
__ASM_SYSCALL_FUNC( __id_NtSetContextThread );
|
__ASM_SYSCALL_FUNC( __id_NtSetContextThread, syscall_NtSetContextThread );
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
|
NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
|
||||||
|
|
|
@ -46,7 +46,7 @@ ALL_SYSCALLS64
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SYSCALL_API __attribute__((naked))
|
#define SYSCALL_API __attribute__((naked))
|
||||||
#define SYSCALL_FUNC(name) __ASM_SYSCALL_FUNC( __id_##name )
|
#define SYSCALL_FUNC(name) __ASM_SYSCALL_FUNC( __id_##name, name )
|
||||||
|
|
||||||
INT SYSCALL_API NtGdiAbortDoc( HDC hdc )
|
INT SYSCALL_API NtGdiAbortDoc( HDC hdc )
|
||||||
{
|
{
|
||||||
|
|
|
@ -209,7 +209,7 @@
|
||||||
#elif defined __aarch64__
|
#elif defined __aarch64__
|
||||||
# define __ASM_SYSCALL_FUNC(id,name) \
|
# define __ASM_SYSCALL_FUNC(id,name) \
|
||||||
__ASM_GLOBAL_FUNC( name, \
|
__ASM_GLOBAL_FUNC( name, \
|
||||||
__ASM_SEH(".seh_endprologue\n\t") \
|
".seh_endprologue\n\t" \
|
||||||
"mov x8, #(" #id ")\n\t" \
|
"mov x8, #(" #id ")\n\t" \
|
||||||
"mov x9, x30\n\t" \
|
"mov x9, x30\n\t" \
|
||||||
"ldr x16, 1f\n\t" \
|
"ldr x16, 1f\n\t" \
|
||||||
|
@ -218,13 +218,16 @@
|
||||||
"ret\n" \
|
"ret\n" \
|
||||||
"1:\t.quad " __ASM_NAME("__wine_syscall_dispatcher") )
|
"1:\t.quad " __ASM_NAME("__wine_syscall_dispatcher") )
|
||||||
#elif defined __arm64ec__
|
#elif defined __arm64ec__
|
||||||
# define __ASM_SYSCALL_FUNC(id) \
|
# define __ASM_SYSCALL_FUNC(id,name) \
|
||||||
asm( "mov x8, #%0\n\t" \
|
asm( ".seh_proc " #name "\n\t" \
|
||||||
|
".seh_endprologue\n\t" \
|
||||||
|
"mov x8, #%0\n\t" \
|
||||||
"mov x9, x30\n\t" \
|
"mov x9, x30\n\t" \
|
||||||
"adr x16, " __ASM_NAME("__wine_syscall_dispatcher") "\n\t" \
|
"adrp x16, __wine_syscall_dispatcher\n\t" \
|
||||||
"ldr x16, [x16]\n\t" \
|
"ldr x16, [x16, :lo12:__wine_syscall_dispatcher]\n\t" \
|
||||||
"blr x16\n\t" \
|
"blr x16\n\t" \
|
||||||
"ret" :: "i" (id) )
|
"ret\n\t" \
|
||||||
|
".seh_endproc" :: "i" (id) )
|
||||||
#elif defined __x86_64__
|
#elif defined __x86_64__
|
||||||
/* Chromium depends on syscall thunks having the same form as on
|
/* Chromium depends on syscall thunks having the same form as on
|
||||||
* Windows. For 64-bit systems the only viable form we can emulate is
|
* Windows. For 64-bit systems the only viable form we can emulate is
|
||||||
|
@ -234,7 +237,7 @@
|
||||||
# ifdef __WINE_PE_BUILD
|
# ifdef __WINE_PE_BUILD
|
||||||
# define __ASM_SYSCALL_FUNC(id,name) \
|
# define __ASM_SYSCALL_FUNC(id,name) \
|
||||||
__ASM_GLOBAL_FUNC( name, \
|
__ASM_GLOBAL_FUNC( name, \
|
||||||
__ASM_SEH(".seh_endprologue\n\t") \
|
".seh_endprologue\n\t" \
|
||||||
".byte 0x4c,0x8b,0xd1\n\t" /* movq %rcx,%r10 */ \
|
".byte 0x4c,0x8b,0xd1\n\t" /* movq %rcx,%r10 */ \
|
||||||
".byte 0xb8\n\t" /* movl $i,%eax */ \
|
".byte 0xb8\n\t" /* movl $i,%eax */ \
|
||||||
".long (" #id ")\n\t" \
|
".long (" #id ")\n\t" \
|
||||||
|
@ -250,7 +253,6 @@
|
||||||
# else
|
# else
|
||||||
# define __ASM_SYSCALL_FUNC(id,name) \
|
# define __ASM_SYSCALL_FUNC(id,name) \
|
||||||
__ASM_GLOBAL_FUNC( name, \
|
__ASM_GLOBAL_FUNC( name, \
|
||||||
__ASM_SEH(".seh_endprologue\n\t") \
|
|
||||||
".byte 0x4c,0x8b,0xd1\n\t" /* movq %rcx,%r10 */ \
|
".byte 0x4c,0x8b,0xd1\n\t" /* movq %rcx,%r10 */ \
|
||||||
".byte 0xb8\n\t" /* movl $i,%eax */ \
|
".byte 0xb8\n\t" /* movl $i,%eax */ \
|
||||||
".long (" #id ")\n\t" \
|
".long (" #id ")\n\t" \
|
||||||
|
|
Loading…
Add table
Reference in a new issue