HOOK Module
Application Program Interface
2-139
HOOK Manager
Properties
There are no global properties for the HOOK manager. HOOK objects
are placed in the C Variables Section (.bss).
HOOK Object
Properties
The following properties can be set for a HOOK object in the DPI Object
Properties dialog of the DSP/BIOS Configuration Tool or in a Tconf script.
To create a HOOK object in a configuration script, use the following
syntax:
var myHook = bios.HOOK.create("myHook");
The Tconf examples that follow assume the object has been created as
shown.
❏
comment
. A comment to identify this HOOK object.
Tconf Name: comment
Type: String
Example:
myHook.comment = "HOOK funcs";
❏
Initialization function
. The name of a function to call during
program initialization. Such functions run during the BIOS_init portion
of application startup, which runs before the program’s main()
function. Initialization functions can call most functions that can be
called from the main() function. However, they should not call TSK
module functions, because the TSK module is initialized after
initialization functions run. In addition to code specific to the module
hook, this function should be used to record the object’s ID, if it is
needed in a subsequent hook function. This initialization function is
intended for use in setting up data structures used by other functions
of the same HOOK object. In contrast, the User Init Function property
of the GBL Module Properties runs early in the initialization process
and is intended to be used to perform hardware setup that needs to
run before DSP/BIOS is initialized.
Tconf Name: initFxn
Type: Extern
Example:
myHook.initFxn = prog.extern("myInit");
❏
Create function
. The name of a function to call when any task is
created. This includes tasks that are created statically and those
created dynamically using TSK_create. The TSK_create topic
describes the prototype required for the Create function. If this
function is written in C and you are using the DSP/BIOS
Configuration Tool, use a leading underscore before the C function
name. If you are using Tconf, do not add an underscore before the
function name; Tconf adds the underscore needed to call a C
function from assembly internally.
Tconf Name: createFxn
Type: Extern
Example:
myHook.createFxn =
prog.extern("myCreate");