Fix getStackPointer() to work in RISC-V and ARM mode (#2526)
This commit is contained in:
parent
2324d52023
commit
58c0d95114
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue