1 /* $NetBSD: sbrk.S,v 1.13 2014/08/23 02:24:22 matt Exp $ */
5 #if defined(LIBC_SCCS) && !defined(lint)
6 __RCSID("$NetBSD: sbrk.S,v 1.13 2014/08/23 02:24:22 matt Exp $")
7 #endif /* LIBC_SCCS && !lint */
9 .hidden _C_LABEL(__curbrk)
10 .globl _C_LABEL(__curbrk)
13 WEAK_ALIAS(sbrk, _sbrk)
22 addis %r8,%r5,(_C_LABEL(__curbrk)-.LPIC0)@ha
23 ldptru %r6,(_C_LABEL(__curbrk)-.LPIC0)@l(%r8)
25 lis %r8,_C_LABEL(__curbrk)@ha
26 ldptru %r6,_C_LABEL(__curbrk)@l(%r8) # r6 = old break, r5 = &curbrk
29 mr %r7,%r3 # r7 = new break
30 _DOSYSCALL(break) # break(new_break)
32 mr %r3,%r6 # set return value
33 stptr %r7,0(%r8) # record new break