4.7.5. __builtin_frame_address

This builtin function returns the frame address of the current function. The frame address is usually the address of the first word the function pushes on to the stack.

Note

This builtin function is a GNU compiler extension that is supported by the ARM compiler.

Mode

Supported in GNU mode only.

Syntax

void *__builtin_frame_address(unsigned int val)

Where:

val

is an unsigned integer evaluating to zero.

Return value

__builtin_frame_address returns the address of the frame of the current function.

Example

void *frame_address(void)
{
    static void *frm_addr;

    frm_addr = __builtin_frame_address(0);  // return the sp
    return frm_addr;
}

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential