ack/mach/vax4/libbsd4_2/brk.s

30 lines
353 B
ArmAsm
Raw Normal View History

1987-02-23 18:58:58 +00:00
#include "syscall.h"
1990-01-11 16:00:19 +00:00
.extern _end
1987-02-23 18:58:58 +00:00
DEFINE(_brk)
1990-01-11 16:00:19 +00:00
cmpl 4(ap),Imin
bgeq Iok
movl Imin,4(ap)
Iok:
1987-02-23 18:58:58 +00:00
chmk $17
1990-01-11 16:00:19 +00:00
bcs Ierr
movl 4(ap),Icur
1987-02-23 18:58:58 +00:00
clrl r0
ret
1990-01-11 16:00:19 +00:00
Ierr:
1987-02-23 18:58:58 +00:00
jmp cerror
DEFINE(_sbrk)
1990-01-12 10:11:44 +00:00
addl3 Icur,4(ap),-(sp)
1990-01-11 16:00:19 +00:00
bcs Ierr
1987-02-23 18:58:58 +00:00
pushl $1
movl ap,r3
movl sp,ap
chmk $17
1990-01-11 16:00:19 +00:00
bcs Ierr
movl Icur,r0
addl2 4(r3),Icur
1987-02-23 18:58:58 +00:00
ret
1990-01-11 16:00:19 +00:00
.sect .data
Imin: .data4 _end
Icur: .data4 _end