Keil Logo


11.13 SYS_HEAPINFO (0x16)

Returns the system stack and heap parameters.

The values returned are typically those used by the C library during initialization. For a debug hardware unit, such as RVI or DSTREAM, the values returned are the image location and the top of memory.
The C library can override these values.
The host debugger determines the actual values to return by using the top_of_memory debugger variable.


On entry, R1 contains the address of a pointer to a four-word data block. The contents of the data block are filled by the function. The following example shows the structure of the data block and return values.
struct block {
    int heap_base;
    int heap_limit;
    int stack_base;
    int stack_limit;
struct block *mem_block, info;
mem_block = &info;
AngelSWI(SYS_HEAPINFO, (unsigned) &mem_block);


If word one of the data block has the value zero, the C library replaces the zero with Image$$ZI$$Limit. This value corresponds to the top of the data region in the memory map.


On exit, R1 contains the address of the pointer to the structure.
If one of the values in the structure is 0, the system was unable to calculate the real value.
Non-ConfidentialPDF file icon PDF versionARM DUI0375H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.