Remove building with NOCRYPTO option
[minix3.git] / lib / libc / arch / or1k / sys / brk.S
bloba7007b57fb3148e4f2a4f70895696ad9b1e15205
1 /*      $NetBSD: brk.S,v 1.1 2014/09/03 19:34:26 matt Exp $     */
3 #include "SYS.h"
5 #if defined(LIBC_SCCS) && !defined(lint)
6 __RCSID("$NetBSD: brk.S,v 1.1 2014/09/03 19:34:26 matt Exp $")
7 #endif /* LIBC_SCCS && !lint */
9         .hidden _C_LABEL(__curbrk)
10         .hidden _C_LABEL(__minbrk)
11         .globl  _C_LABEL(__curbrk)
12         .globl  _C_LABEL(__minbrk)
13         .globl  _C_LABEL(_end)
15 #ifdef WEAK_ALIAS
16 WEAK_ALIAS(brk, _brk)
17 #endif
18         .data
19         .p2align 2
20 _C_LABEL(__minbrk):
21         .long   _C_LABEL(_end)
22 _C_LABEL(__curbrk):
23         .long   _C_LABEL(_end)
25         .text
26 ENTRY(_brk)
27 #ifdef __PIC__
28         l.or    r8,r9,r0
29         PIC_GOTSETUP(r7)
30         l.or    r9,r8,r0
31         l.movhi r6,gotoffhi(_C_LABEL(__minbrk))
32         l.ori   r6,r6,gotofflo(_C_LABEL(__minbrk))
33         l.add   r6,r6,r7
34 #else
35         l.movhi r6,hi(_C_LABEL(__minbrk))
36         l.ori   r6,r6,lo(_C_LABEL(__minbrk))
37 #endif
38         l.lwz   r5,0(r6)                # r5 = __minbrk
39         l.sfgts r5,r3                   # if (__minbrk <= r3)
40         l.cmov  r5,r5,r3                # choose larger
41         l.or    r3,r5,r0                # new break value
42         _DOSYSCALL(break)               # assume, that r5 is kept
43         l.bf    _C_LABEL(__cerror)
44         l.nop
45         l.sw    __SIZEOF_POINTER__(r6),r5
46         l.xor   r11, r11, r11           # return 0
47         l.jr    lr                      # return 0
48         l.nop
49 END(_brk)