forked from Imagelibrary/rtems
The work areas (RTEMS work space and C program heap) will be initialized now in a separate step and are no longer part of rtems_initialize_data_structures(). Initialization is performed with tables of Heap_Area entries. This allows usage of scattered memory areas present on various small scale micro-controllers. The sbrk() support API changes also. The bsp_sbrk_init() must now deal with a minimum size for the first memory chunk to take the configured work space size into account.
34 lines
628 B
C
34 lines
628 B
C
/*
|
|
* RTEMS Malloc Get Status Information
|
|
*
|
|
*
|
|
* COPYRIGHT (c) 1989-2007.
|
|
* On-Line Applications Research Corporation (OAR).
|
|
*
|
|
* The license and distribution terms for this file may be
|
|
* found in the file LICENSE in this distribution or at
|
|
* http://www.rtems.com/license/LICENSE.
|
|
*/
|
|
|
|
#if HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include <rtems/malloc.h>
|
|
#include <rtems/score/protectedheap.h>
|
|
|
|
/*
|
|
* Find amount of free heap remaining
|
|
*/
|
|
|
|
int malloc_info(
|
|
Heap_Information_block *the_info
|
|
)
|
|
{
|
|
if ( !the_info )
|
|
return -1;
|
|
|
|
_Protected_heap_Get_information( RTEMS_Malloc_Heap, the_info );
|
|
return 0;
|
|
}
|