summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-05-23 05:53:20 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-05-23 06:12:41 -0700
commit70c161f555c0400ecc606829a0cf6ef1816a5037 (patch)
tree15c7dce86e82423430ea141c68295e287deed2f9 /sysdeps
parent3d8fdb9d1097a9683a16846ea00e337607982e15 (diff)
downloadglibc-70c161f555c0400ecc606829a0cf6ef1816a5037.tar.gz
Fix x32 sched_getcpu.S error code
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S12
1 files changed, 8 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S b/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S
index f3ba9f1c9f..789552ebbb 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S
@@ -33,14 +33,18 @@ ENTRY (sched_getcpu)
call __getcpu
+ /* Local variable is result if the call is successful. */
+ mov (%rsp), %edx
+ /* Restore stack pointer before we might jump to
+ SYSCALL_ERROR_LABEL which returns to the caller. */
+ add $0x8, %esp
+ cfi_adjust_cfa_offset(-8)
+
cmp $-4095, %eax
jae SYSCALL_ERROR_LABEL
- mov (%rsp), %eax
-
+ mov %edx, %eax
L(pseudo_end):
- add $0x8, %esp
- cfi_adjust_cfa_offset(-8)
ret
PSEUDO_END(sched_getcpu)
#endif