diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-05-21 00:07:00 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-05-21 00:07:00 +0000 |
commit | ae62f3fd1a00bd20907ca9416f1e4b84215f3958 (patch) | |
tree | d714467e059ffef83ad26c9eb379a76113921f60 /sysdeps/unix | |
parent | a53b62005c81f5a2337bf9960c5a46f67e32e420 (diff) |
Don't presume that the kernel will preserve non-call-saved registers;
save and restore a0 across the system call.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/brk.S | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/brk.S b/sysdeps/unix/sysv/linux/alpha/brk.S index f44686b9a4..74fef64f64 100644 --- a/sysdeps/unix/sysv/linux/alpha/brk.S +++ b/sysdeps/unix/sysv/linux/alpha/brk.S @@ -37,8 +37,9 @@ __curbrk: .skip 8 #endif .text -LEAF(__brk, 0) +LEAF(__brk, 8) ldgp gp, 0(t12) + subq sp, 8, sp #ifdef PROF .set noat lda AT, _mcount @@ -47,9 +48,14 @@ LEAF(__brk, 0) #endif .prologue 1 + /* Save the requested brk across the system call. */ + stq a0, 0(sp) + ldiq v0, __NR_brk call_pal PAL_callsys + ldq a0, 0(sp) + /* Be prepared for an OSF-style brk. */ bne a3, $err1 beq v0, $ok @@ -62,11 +68,13 @@ LEAF(__brk, 0) /* Update __curbrk and return cleanly. */ mov zero, v0 $ok: stq a0, __curbrk + addq sp, 8, sp ret /* What a horrible way to die. */ $err0: ldi v0, ENOMEM -$err1: jmp zero, __syscall_error +$err1: addq sp, 8, sp + jmp zero, __syscall_error END(__brk) |