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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Source/] [portable/] [Softune/] [MB91460/] [__STD_LIB_sbrk.c] - Blame information for rev 792

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 572 jeremybenn
#include "FreeRTOSConfig.h"
2
#include <stdlib.h>
3
 
4
        static  long         brk_siz  =  0;
5
//      #if  configTOTAL_HEAP_SIZE != 0
6
        typedef int          _heep_t;
7
        #define ROUNDUP(s)   (((s)+sizeof(_heep_t)-1)&~(sizeof(_heep_t)-1))
8
        static  _heep_t      _heep[ROUNDUP(configTOTAL_HEAP_SIZE)/sizeof(_heep_t)];
9
        #define              _heep_size      ROUNDUP(configTOTAL_HEAP_SIZE)
10
/*      #else
11
        extern  char        *_heep;
12
        extern  long        _heep_size;
13
        #endif
14
*/
15
        extern  char  *sbrk(int  size)
16
        {
17
           if  (brk_siz  +  size  >  _heep_size  ||  brk_siz  +  size  <  0)
18
 
19
          return((char*)-1);
20
           brk_siz  +=  size;
21
           return(  (char*)_heep  +  brk_siz  -  size);
22
        }
23
 

powered by: WebSVN 2.1.0

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