Skip to content

Commit 098ac11

Browse files
Jongydpgeorge
authored andcommitted
lib/utils/gchelper_generic: Implement AArch64 support.
1 parent e196cb7 commit 098ac11

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

lib/utils/gchelper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ typedef uintptr_t gc_helper_regs_t[6];
3939
typedef uintptr_t gc_helper_regs_t[4];
4040
#elif defined(__thumb2__) || defined(__thumb__) || defined(__arm__)
4141
typedef uintptr_t gc_helper_regs_t[10];
42+
#elif defined(__aarch64__)
43+
typedef uintptr_t gc_helper_regs_t[11]; // x19-x29
4244
#endif
4345

4446
#endif

lib/utils/gchelper_generic.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,33 @@ STATIC void gc_helper_get_regs(gc_helper_regs_t arr) {
123123
arr[9] = r13;
124124
}
125125

126+
#elif defined(__aarch64__)
127+
128+
STATIC void gc_helper_get_regs(gc_helper_regs_t arr) {
129+
const register long x19 asm ("x19");
130+
const register long x20 asm ("x20");
131+
const register long x21 asm ("x21");
132+
const register long x22 asm ("x22");
133+
const register long x23 asm ("x23");
134+
const register long x24 asm ("x24");
135+
const register long x25 asm ("x25");
136+
const register long x26 asm ("x26");
137+
const register long x27 asm ("x27");
138+
const register long x28 asm ("x28");
139+
const register long x29 asm ("x29");
140+
arr[0] = x19;
141+
arr[1] = x20;
142+
arr[2] = x21;
143+
arr[3] = x22;
144+
arr[4] = x23;
145+
arr[5] = x24;
146+
arr[6] = x25;
147+
arr[7] = x26;
148+
arr[8] = x27;
149+
arr[9] = x28;
150+
arr[10] = x29;
151+
}
152+
126153
#else
127154

128155
#error "Architecture not supported for gc_helper_get_regs. Set MICROPY_GCREGS_SETJMP to use the fallback implementation."

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy