BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
Prototypes for BSP430 system enhancements to newlib. More...
Go to the source code of this file.
Functions | |
void * | sbrk (intptr_t increment) |
void * | _bsp430_sbrk_fatal (ptrdiff_t increment) |
void * | _bsp430_sbrk_dynstack (ptrdiff_t increment) |
void * | _bsp430_sbrk_error (void *brk, ptrdiff_t current, ptrdiff_t increment) |
Variables | |
unsigned long | ulBSP430newlibNoSysInvoked |
Prototypes for BSP430 system enhancements to newlib.
void* _bsp430_sbrk_dynstack | ( | ptrdiff_t | increment | ) |
An sbrk() implementation that allows heap (growing up) and stack (growing down) to share a region of memory.
An error is indicated if the new break point would encroach into the current stack space.
void* _bsp430_sbrk_error | ( | void * | brk, |
ptrdiff_t | current, | ||
ptrdiff_t | increment | ||
) |
This function is invoked whenever _sbrk() runs out of memory.
libbsp430.a
provides a weak definition is that disables interrupts and enters an infinite loop, allowing diagnosis through a debugger. The application may provide an alternative implementation that is more diagnostic or that returns the responsibility of handling out-of-memory to the application (i.e. requires the application to check allocation return values).
brk | the current program break |
current | total number of bytes allocated by previous successful invocations of _sbrk() (i.e., allocated bytes preceding brk ) |
increment | the number of bytes in the request that _sbrk() cannot satisfy |
errno
to ENOMEM
and return (void*)-1
. void* _bsp430_sbrk_fatal | ( | ptrdiff_t | increment | ) |
An sbrk() implementation that rejects any attempt to allocate memory dynamically. It immediately invokes _bsp430_brk_error().
void* sbrk | ( | intptr_t | increment | ) |
The system function used to allocate memory for use by libc heap memory management.
Normally this is an alias for either _bsp430_sbrk_dynstack() (the default) or _bsp430_sbrk_fatal(). An alternative may be specified by defining a function with the same API and adding a alias definition such as:
increment | the number of bytes of additional memory that libc needs in order to perform additional allocations. |
(void*)-1
if no allocation can be performed. unsigned long ulBSP430newlibNoSysInvoked |
Variable used by default nosys implementations to record which system calls are invoked.
Stub routines in newlib/nosys
set bits in this variable when they are invoked. A non-zero value indicates that some stub system interface was invoked in the course of execution; further analysis can identify the functions and determine why they were invoked and whether supplying a non-stub implementation is worthwhile.
This is a diagnostic aid that may not be worth maintaining.