Fix pread consolidation on ports that require argument alignment
[glibc.git] / sysdeps / tile / stackguard-macros.h
blobf2e041b99bab2c02bbf23922c9c92eec3d92a01d
1 #include <bits/wordsize.h>
3 #ifdef __tilegx__
4 # if __WORDSIZE == 64
5 # define STACK_CHK_GUARD \
6 ({ uintptr_t x; asm ("addi %0, tp, -16; ld %0, %0" : "=r" (x)); x; })
7 # define POINTER_CHK_GUARD \
8 ({ uintptr_t x; asm ("addi %0, tp, -24; ld %0, %0" : "=r" (x)); x; })
9 # else
10 # define STACK_CHK_GUARD \
11 ({ uintptr_t x; asm ("addi %0, tp, -8; ld4s %0, %0" : "=r" (x)); x; })
12 # define POINTER_CHK_GUARD \
13 ({ uintptr_t x; asm ("addi %0, tp, -12; ld4s %0, %0" : "=r" (x)); x; })
14 # endif
15 #else
16 # define STACK_CHK_GUARD \
17 ({ uintptr_t x; asm ("addi %0, tp, -8; lw %0, %0" : "=r" (x)); x; })
18 # define POINTER_CHK_GUARD \
19 ({ uintptr_t x; asm ("addi %0, tp, -12; lw %0, %0" : "=r" (x)); x; })
20 #endif