1- #include "asm_trampoline_aarch64.h"
2-
31 .text
2+ #ifdef __x86_64__
43#if defined(__APPLE__)
54 .globl __Py_trampoline_func_start
6- #else
7- .globl _Py_trampoline_func_start
8- #endif
9- # The following assembly is equivalent to:
10- # PyObject *
11- # trampoline(PyThreadState *ts, _PyInterpreterFrame *f,
12- # int throwflag, py_evaluator evaluator)
13- # {
14- # return evaluator(ts, f, throwflag);
15- # }
16- #if defined(__APPLE__)
175__Py_trampoline_func_start:
186#else
7+ .globl _Py_trampoline_func_start
198_Py_trampoline_func_start:
209#endif
21- #ifdef __x86_64__
2210#if defined(__CET__) && (__CET__ & 1 )
2311 endbr64
2412#endif
@@ -27,26 +15,6 @@ _Py_trampoline_func_start:
2715 call *%rcx
2816 pop %rbp
2917 ret
30- #endif // __x86_64__
31- #if defined(__aarch64__) && defined(__AARCH64EL__) && !defined(__ILP32__)
32- // ARM64 little endian, 64bit ABI
33- // generate with aarch64-linux-gnu-gcc 12.1
34- SIGN_LR
35- stp x29, x30, [sp, -16]!
36- mov x29, sp
37- blr x3
38- ldp x29, x30, [sp], 16
39- VERIFY_LR
40- ret
41- #endif
42- #ifdef __riscv
43- addi sp,sp,-16
44- sd ra,8 (sp)
45- jalr a3
46- ld ra,8 (sp)
47- addi sp,sp,16
48- jr ra
49- #endif
5018#if defined(__APPLE__)
5119 .globl __Py_trampoline_func_end
5220__Py_trampoline_func_end:
@@ -56,7 +24,7 @@ _Py_trampoline_func_end:
5624 .section .note.GNU-stack,"",@progbits
5725#endif
5826# Note for indicating the assembly code supports CET
59- #if defined(__x86_64__) && defined( __CET__) && (__CET__ & 1 )
27+ #if defined(__CET__) && (__CET__ & 1 )
6028 .section .note.gnu.property,"a"
6129 .align 8
6230 .long 1f - 0f
@@ -73,4 +41,5 @@ _Py_trampoline_func_end:
73413:
7442 .align 8
75434:
44+ #endif
7645#endif // __x86_64__
0 commit comments