__getCFS

Microsoft Specific

Gets the current frame state.

unsigned __int64 __getCFS(void);

Return Value

Returns the first 18 bits of the current frame marker (CFM).

Requirements

Intrinsic

Architecture

__getCFS

IPF

Header file <intrin.h>

Remarks

Bits 0 to 6 give the size of the current stack frame. Bits 7 to 13 give the size of the locals portion of the stack frame. Bits 14 to 17 give the size of the rotating portion of the stack frame.

This routine is only available as an intrinsic.

Example

// getCFS.c
// processor: IPF
#include <stdio.h>
#include <intrin.h>

#pragma intrinsic (__getCFS)

#define SIZE_OF_FRAME_MASK 127
#define SIZE_OF_LOCALS_MASK 16256
#define SIZE_OF_ROT_MASK 245760

int main()
{
    int size_of_frame, size_of_locals, size_of_rot;
    unsigned __int64 cfs;

    cfs = __getCFS();
    printf_s("Current Frame State: 0x%x\n", cfs);

    size_of_frame = cfs & SIZE_OF_FRAME_MASK;
    size_of_locals = (cfs & SIZE_OF_LOCALS_MASK) >> 7;
    size_of_rot = (cfs & SIZE_OF_ROT_MASK) >> 13;
    printf_s("Size of current stack frame: %d\n",
             size_of_frame);
    printf_s("Size of locals portion of current stack frame: %d\n",
             size_of_locals);
    printf_s("Size of rotating portion of current stack frame: %d\n",
             size_of_rot);
   return 0;
}

Current Frame State: 0x185
Size of current stack frame: 5
Size of locals portion of current stack frame: 3
Size of rotating portion of current stack frame: 0

See Also

Concepts

Compiler Intrinsics