mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
powerpc: abort transaction in syscalls
Linux kernel powerpc documentation states issuing a syscall inside a transaction is not recommended and may lead to undefined behavior. It also states syscalls does not abort transactoin neither they run in transactional state. To avoid side-effects being visible outside transactions, GLIBC with lock elision enabled will issue a transaction abort instruction just before all syscalls if hardware supports hardware transactions.
This commit is contained in:
@ -194,6 +194,7 @@
|
||||
register long int r11 __asm__ ("r11"); \
|
||||
register long int r12 __asm__ ("r12"); \
|
||||
LOADARGS_##nr(name, args); \
|
||||
ABORT_TRANSACTION; \
|
||||
__asm__ __volatile__ \
|
||||
("sc \n\t" \
|
||||
"mfcr %0" \
|
||||
|
@ -201,6 +201,7 @@
|
||||
register long int r7 __asm__ ("r7"); \
|
||||
register long int r8 __asm__ ("r8"); \
|
||||
LOADARGS_##nr (name, ##args); \
|
||||
ABORT_TRANSACTION; \
|
||||
__asm__ __volatile__ \
|
||||
("sc\n\t" \
|
||||
"mfcr %0\n\t" \
|
||||
|
Reference in New Issue
Block a user