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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [RX600_RX62N-RDK_Renesas/] [RTOSDemo/] [Renesas-Files/] [sbrk.c] - Blame information for rev 585

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 585 jeremybenn
#include <stddef.h>
2
#include <stdio.h>
3
#define HEAPSIZE        0x400
4
signed char *sbrk( size_t size );
5
union HEAP_TYPE
6
{
7
        signed long dummy;
8
        signed char heap[HEAPSIZE];
9
};
10
static union HEAP_TYPE  heap_area;
11
 
12
/* End address allocated by sbrk */
13
static signed char              *brk = ( signed char * ) &heap_area;
14
signed char *sbrk( size_t size )
15
{
16
        signed char *p;
17
        if( brk + size > heap_area.heap + HEAPSIZE )
18
        {
19
                p = ( signed char * ) - 1;
20
        }
21
        else
22
        {
23
                p = brk;
24
                brk += size;
25
        }
26
 
27
        return p;
28
}

powered by: WebSVN 2.1.0

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