3.2.3. Initialization, finalization, and state macros

To help you to write new ARMulator models, the following six macros are provided in minperip.h:

Use the following to define an initialization function for your model:

BEGIN_INIT(your_model)
{
    /*
     * (your initialization code here)
    */
}
END_INIT(your_model)

Use the following to define a finalization function for your model:

BEGIN_EXIT(your_model)
{
    /*
     * (your finalization code here)
    */
}
END_EXIT(your_model)

The BEGIN_INIT() macro defines a structure to hold any private data used by your model, and the END_EXIT() macro frees it. Declare the data structure using:

BEGIN_STATE_DECL(your_model)
    /*
     * (your private data here)
    */
END_STATE_DECL(your_model)
Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI0058D
Non-Confidential