OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [libgloss/] [libnosys/] [sbrk.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1005 ivang
/*
2
 * Version of sbrk for no operating system.
3
 */
4
 
5
#include "config.h"
6
#include <_ansi.h>
7
#include <_syslist.h>
8
#include <sys/types.h>
9
#include <errno.h>
10
#undef errno
11
extern int errno;
12
 
13
caddr_t
14
_DEFUN (_sbrk, (incr),
15
        int incr)
16
{
17
   extern char end; /* set by linker */
18
   static char *heap_end;
19
   char *prev_heap_end;
20
 
21
   if (heap_end == 0) {
22
      heap_end = &end;
23
   }
24
   prev_heap_end = heap_end;
25
   heap_end += incr;
26
   return (caddr_t) prev_heap_end;
27
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.