[BACK]Return to brk.S CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / arch / powerpc64 / sys

File: [cvs.NetBSD.org] / src / lib / libc / arch / powerpc64 / sys / brk.S (download)

Revision 1.4, Sat Oct 29 16:03:33 2011 UTC (10 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, agc-symver-base, agc-symver
Branch point for: netbsd-7
Changes since 1.3: +3 -2 lines

Everything else uses PIC branches to __cerror except those two...

/*	$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)

WEAK_ALIAS(brk, _brk)

	.macro  LdAddr  r,sym
	.pushsection    ".toc","aw"
100:	.tc \sym[TC],\sym
	ld      \r,100b@toc(2)

	.long   _C_LABEL(_end)      

	LdAddr	%r5,_end
	cmpld	%r5,%r3			# if (&_end <= r3)
	bgt	0f
	mr	%r5,%r3			# r5 = r3
	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

	b	PIC_PLT(_C_LABEL(__cerror))