1 /* $NetBSD: brk.S,v 1.13 2013/09/12 15:36:15 joerg Exp $ */
5 #if defined(LIBC_SCCS) && !defined(lint)
6 __RCSID("$NetBSD: brk.S,v 1.13 2013/09/12 15:36:15 joerg Exp $")
7 #endif /* LIBC_SCCS && !lint */
9 .globl _C_LABEL(__curbrk)
10 .globl _C_LABEL(__minbrk)
19 .long _C_LABEL(_end) # XXX not used yet
27 lwz %r5,_C_LABEL(_end)@got(%r9)
29 lis %r5,_C_LABEL(_end)@ha # r5 = &_end
30 addi %r5,%r5,_C_LABEL(_end)@l
32 cmplw %r5,%r3 # if (&_end <= r3)
36 mr %r3,%r5 # new break value
37 _DOSYSCALL(break) # assume, that r5 is kept
40 lwz %r6,_C_LABEL(__curbrk)@got(%r9)
43 lis %r6,_C_LABEL(__curbrk)@ha # record new break
44 stw %r5,_C_LABEL(__curbrk)@l(%r6)