tools/llvm: Do not build with symbols
[minix3.git] / lib / libc / arch / powerpc / sys / sbrk.S
blobcf23e810978ff1fce50788a918eda82acc6dafe6
1 /*      $NetBSD: sbrk.S,v 1.12 2013/09/12 15:36:15 joerg Exp $  */
3 #include "SYS.h"
5 #if defined(LIBC_SCCS) && !defined(lint)
6 __RCSID("$NetBSD: sbrk.S,v 1.12 2013/09/12 15:36:15 joerg Exp $")
7 #endif /* LIBC_SCCS && !lint */
9         .globl  _C_LABEL(__curbrk)
10         .globl  _C_LABEL(_end)
12 #ifdef WEAK_ALIAS
13 WEAK_ALIAS(sbrk, _sbrk)
14 #endif
16         .data
17 _C_LABEL(__curbrk):
18         .long   _C_LABEL(_end)
19         .text
21 ENTRY(_sbrk)
22 #ifdef __PIC__
23         mflr    %r10
24         PIC_GOTSETUP(%r5)
25         mtlr    %r10
26         lwz     %r5,_C_LABEL(__curbrk)@got(%r5)
27         lwz     %r6,0(%r5)
28 #else
29         lis     %r5,_C_LABEL(__curbrk)@ha
30         lwzu    %r6,_C_LABEL(__curbrk)@l(%r5)   # r6 = old break, r5 = &curbrk
31 #endif
32         add     %r3,%r3,%r6
33         mr      %r7,%r3                         # r7 = new break
34         _DOSYSCALL(break)                       # break(new_break)
35         bso     1f
36         mr      %r3,%r6                         # set return value
37         stw     %r7,0(%r5)                      # record new break
38         blr
40         b       _C_LABEL(__cerror)
41 END(_sbrk)