Fix getStackPointer() to work in RISC-V and ARM mode (#2526)

This commit is contained in:
Maximilian Gerhardt 2024-10-06 18:44:30 +02:00 committed by GitHub
parent 2324d52023
commit 58c0d95114
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -289,7 +289,11 @@ public:
inline uint32_t getStackPointer() {
uint32_t *sp;
#if defined(__riscv)
asm volatile("mv %0, sp" : "=r"(sp));
#else
asm volatile("mov %0, sp" : "=r"(sp));
#endif
return (uint32_t)sp;
}