Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
dd77c32f
Commit
dd77c32f
authored
Nov 14, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecrt0: Implement setjmp/longjmp for ARM64EC.
parent
7c879431
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
1 deletion
+53
-1
exception.c
dlls/winecrt0/exception.c
+1
-1
setjmp.c
dlls/winecrt0/setjmp.c
+52
-0
No files found.
dlls/winecrt0/exception.c
View file @
dd77c32f
...
...
@@ -41,7 +41,7 @@ __ASM_GLOBAL_FUNC( __wine_rtl_unwind,
"call "
__ASM_STDCALL
(
"RtlUnwind"
,
16
)
"
\n\t
"
"call *16(%ebp)"
)
#elif defined(__x86_64__)
#elif defined(__x86_64__)
&& !defined(__arm64ec__)
__ASM_GLOBAL_FUNC
(
__wine_rtl_unwind
,
"pushq %rbp
\n\t
"
...
...
dlls/winecrt0/setjmp.c
View file @
dd77c32f
...
...
@@ -50,6 +50,58 @@ __ASM_GLOBAL_FUNC( __wine_longjmp,
"addl $4,%esp
\n\t
"
/* get rid of return address */
"jmp *20(%ecx)
\n\t
"
/* jmp_buf.Eip */
)
#elif defined(__arm64ec__)
int
__cdecl
__attribute__
((
naked
))
__wine_setjmpex
(
__wine_jmp_buf
*
buf
,
EXCEPTION_REGISTRATION_RECORD
*
frame
)
{
asm
(
"stp x29, x30, [sp, #-16]!
\n\t
"
"stp x1, x27, [x0]
\n\t
"
/* jmp_buf->Frame,Rbx */
"add x1, sp, #16
\n\t
"
"stp x1, x29, [x0, #0x10]
\n\t
"
/* jmp_buf->Rsp,Rbp */
"mov x29, sp
\n\t
"
"stp x25, x26, [x0, #0x20]
\n\t
"
/* jmp_buf->Rsi,Rdi */
"stp x19, x20, [x0, #0x30]
\n\t
"
/* jmp_buf->R12,R13 */
"stp x21, x22, [x0, #0x40]
\n\t
"
/* jmp_buf->R14,R15 */
"str x30, [x0, #0x50]
\n\t
"
/* jmp_buf->Rip */
"stp d8, d9, [x0, #0x80]
\n\t
"
/* jmp_buf->Xmm8,Xmm9 */
"stp d10, d11, [x0, #0xa0]
\n\t
"
/* jmp_buf->Xmm10,Xmm11 */
"stp d12, d13, [x0, #0xc0]
\n\t
"
/* jmp_buf->Xmm12,Xmm13 */
"stp d14, d15, [x0, #0xe0]
\n\t
"
/* jmp_buf->Xmm14,Xmm15 */
"adrp x8, "
__ASM_NAME
(
"__os_arm64x_get_x64_information"
)
"
\n\t
"
"ldr x8, [x8, :lo12:"
__ASM_NAME
(
"__os_arm64x_get_x64_information"
)
"]
\n\t
"
"add x1, x0, #0x58
\n\t
"
/* jmp_buf->Mxcsr */
"mov x0, #0
\n\t
"
"blr x8
\n\t
"
"mov x0, #0
\n\t
"
"ldp x29, x30, [sp], #16
\n\t
"
"ret"
);
}
void
__cdecl
__attribute__
((
naked
))
__wine_longjmp
(
__wine_jmp_buf
*
buf
,
int
retval
)
{
asm
(
"mov x19, x0
\n\t
"
"mov x20, x1
\n\t
"
"adrp x8, "
__ASM_NAME
(
"__os_arm64x_set_x64_information"
)
"
\n\t
"
"ldr x8, [x8, :lo12:"
__ASM_NAME
(
"__os_arm64x_set_x64_information"
)
"]
\n\t
"
"ldr w1, [x0, #0x58]
\n\t
"
/* jmp_buf->Mxcsr */
"mov x0, #0
\n\t
"
"blr x8
\n\t
"
"mov x1, x19
\n\t
"
/* jmp_buf */
"mov x0, x20
\n\t
"
/* retval */
"ldr x27, [x1, #0x08]
\n\t
"
/* jmp_buf->Rbx */
"ldp x2, x29, [x1, #0x10]
\n\t
"
/* jmp_buf->Rsp,Rbp */
"ldp x25, x26, [x1, #0x20]
\n\t
"
/* jmp_buf->Rsi,Rdi */
"ldp x19, x20, [x1, #0x30]
\n\t
"
/* jmp_buf->R12,R13 */
"ldp x21, x22, [x1, #0x40]
\n\t
"
/* jmp_buf->R14,R15 */
"ldr x30, [x1, #0x50]
\n\t
"
/* jmp_buf->Rip */
"ldp d8, d9, [x1, #0x80]
\n\t
"
/* jmp_buf->Xmm8,Xmm9 */
"ldp d10, d11, [x1, #0x90]
\n\t
"
/* jmp_buf->Xmm10,Xmm11 */
"ldp d12, d13, [x1, #0xa0]
\n\t
"
/* jmp_buf->Xmm12,Xmm13 */
"ldp d14, d15, [x1, #0xb0]
\n\t
"
/* jmp_buf->Xmm14,Xmm15 */
"mov sp, x2
\n\t
"
"ret"
);
}
#elif defined(__x86_64__)
__ASM_GLOBAL_FUNC
(
__wine_setjmpex
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment