-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_stack_pointer.S
More file actions
33 lines (27 loc) · 1.08 KB
/
get_stack_pointer.S
File metadata and controls
33 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "asm_osx2linux.h"
.text
.globl _get_stack_pointer
_get_stack_pointer:
################################################################################
#if defined(__ppc__) || defined(__PPC__) || defined(__ppc64__)
################################################################################
addze r3, r1
blr
################################################################################
#elif __i386__
################################################################################
movl %esp, %eax
ret
################################################################################
#elif __x86_64__
################################################################################
movq %rsp, %rax
ret
################################################################################
#elif __arm__
################################################################################
mov r0, sp
bx lr
################################################################################
#endif // Architectures
################################################################################