1: /*
   2:  * Copyright (c) 1987 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifdef SYSLIBC_SCCS
   8: _sccsid: <@(#)sbrk.s	2.6 (2.11BSD GTE) 1995/05/08\0>
   9:         .even
  10: #endif SYSLIBC_SCCS
  11: 
  12: /*
  13:  * XXX - this routine can't use SYSCALL!!!
  14:  */
  15: #include "SYS.h"
  16: 
  17: .data
  18: .globl  _end
  19: .globl  curbrk, minbrk
  20: 
  21: curbrk: _end
  22: minbrk: _end
  23: .text
  24: 
  25: ENTRY(sbrk)
  26:         mov     2(sp),r0        / grab increment
  27:         beq     1f              / (bop out early if zero)
  28:         add     curbrk,r0       / calculate and pass break address
  29:         mov     r0,-(sp)
  30:         tst     -(sp)           / simulate return address stack spacing
  31:         SYS(sbrk)
      /
      /   trap 69 -> [kernel] -> syscall() -> via sysent[] -> handler: sbrk
      /
  32:         bes     2f
  33:         cmp     (sp)+,(sp)+     / (clean up stack)
  34: 1:
  35:         mov     curbrk,r0       / return old break address and add
  36:         add     2(sp),curbrk    /   increment to curbrk
  37:         rts     pc
  38: 2:
  39:         cmp     (sp)+,(sp)+     / (clean up stack)
  40:         jmp     x_error

Defined functions

_sbrk defined in line 25; used 120 times
_sccsid defined in line 8; never used

Defined variables

curbrk declared in line 19; defined in line 21; used 6 times
minbrk declared in line 19; defined in line 22; used 4 times
Last modified: 1995-05-09
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2591
Valid CSS Valid XHTML 1.0 Strict