Keil™, An ARM® Company

RealView Compiler User's Guide

SYS_HEAPINFO (0x16)

A.3.9. SYS_HEAPINFO (0x16)

Returns the system stack and heap parameters. The values returned are typically those used by the C library during initialization. For RVISS, the values returned are those provided in peripherals.ami. For RealView ICE, the values returned are the image location and the top of memory.

The C library can override these values. See Tailoring storage management in the Libraries Guide for more information about memory management in the C library.

The host debugger determines the actual values to return by using the top_of_memory debugger variable.

Entry

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. See Example A.1 for the structure of the data block and return values.

Example A.1. 

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);

Note

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.

Return

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.

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0375A