minix/lib/libc/arch/powerpc64/sys/brk.S
Lionel Sambuc e415d48872 Libc update to simplify merge.
Bumping libc files for unsupported architectures, to simplify merging.
A bunch of small fixes:
 * in libutil update
 * the macro in endian.h
 * some undefined types due to clear separation from host.
 * Fix a warning for cdbr.c

Some modification which were required for the new build system:
 * inclusion path for const.h in sconst, still hacky
 * Removed default malloc.c which conflicts on some occasions.
2012-11-15 16:07:29 +01:00

41 lines
682 B
ArmAsm

/* $NetBSD: brk.S,v 1.4 2011/10/29 16:03:33 christos Exp $ */
#include "SYS.h"
.globl _C_LABEL(__curbrk)
.globl _C_LABEL(__minbrk)
.globl _C_LABEL(_end)
#ifdef WEAK_ALIAS
WEAK_ALIAS(brk, _brk)
#endif
.macro LdAddr r,sym
.pushsection ".toc","aw"
100: .tc \sym[TC],\sym
.popsection
ld \r,100b@toc(2)
.endm
.data
_C_LABEL(__minbrk):
.long _C_LABEL(_end)
.text
ENTRY(_brk)
LdAddr %r5,_end
cmpld %r5,%r3 # if (&_end <= r3)
bgt 0f
mr %r5,%r3 # r5 = r3
0:
mr %r3,%r5 # new break value
li %r0,SYS_break
sc # assume, that r5 is kept
bso 1f
LdAddr %r6,__curbrk
std %r5,0(%r6)
blr # return 0
1:
b PIC_PLT(_C_LABEL(__cerror))