1 1.3 ws /* $NetBSD: sbrk.S,v 1.3 1998/05/25 15:35:06 ws Exp $ */ 2 1.1 thorpej 3 1.1 thorpej #include "SYS.h" 4 1.1 thorpej 5 1.3 ws .globl _C_LABEL(end) 6 1.3 ws .globl _ASM_LABEL(curbrk) 7 1.1 thorpej 8 1.1 thorpej .data 9 1.3 ws _ASM_LABEL(curbrk): 10 1.3 ws .long _C_LABEL(end) 11 1.1 thorpej .text 12 1.1 thorpej 13 1.1 thorpej ENTRY(sbrk) 14 1.1 thorpej #ifdef PIC 15 1.1 thorpej XXX 16 1.1 thorpej #else 17 1.3 ws lis 5,_ASM_LABEL(curbrk)@ha 18 1.3 ws lwz 6,_ASM_LABEL(curbrk)@l(5) # r6 = old break 19 1.1 thorpej add 3,3,6 20 1.1 thorpej mr 7,3 # r7 = new break 21 1.1 thorpej li 0,SYS_break 22 1.1 thorpej sc # break(new_break) 23 1.1 thorpej bso 1f 24 1.1 thorpej mr 3,6 # set return value 25 1.3 ws stw 7,_ASM_LABEL(curbrk)@l(5) # record new break 26 1.1 thorpej blr 27 1.1 thorpej 1: 28 1.3 ws b _ASM_LABEL(cerror) 29 1.1 thorpej #endif 30