Files
Diddy-Kong-Racing/src/get_stack_pointer.c
T
UnnunuandGitHub 9c00d3f75b match func_80025510, partial match of other functions in tracks.c (#532)
* match func_80025510

* two function done

* update score

* some non matchings

* update score

* format and update score
2025-04-28 15:07:18 +03:00

22 lines
474 B
C

#include "memory.h"
#ifdef __sgi
/**
* Uses IDO specific -dollar compiler flag to get the current stack pointer.
* Official Name: diCpuTraceCurrentStack
*/
StackInfo *stack_pointer(void) {
return (StackInfo *) __$sp;
}
#else
/**
* Uses GCC specific code to get the current stack pointer.
* Official Name: diCpuTraceCurrentStack
*/
StackInfo *stack_pointer(void) {
register StackInfo *sp;
asm volatile("move %0, $sp\n" : "=r"(sp));
return sp;
}
#endif