Usage Examples
DSP/BIOS for OMAP 2420
D-11
D.6.2
Installing and Enabling Multiple Level 2 Interrupts
This C code example plugs and enables level 2 interrupts numbers 10,
11, 12, and 13 and sets their priority levels to 0, 1, 2, 3 respectively (0 =
highest priority). The default interrupt nesting behavior (all other
interrupts enabled while l2FiqFunc is called) is configured.
/*
* ======== l2_example2.c ========
* DSP/BIOS Level 2 interrupt example
*/
#include <std.h>
#include <hwi.h>
#include <log.h>
#include <c55.h>
extern LOG_Obj trace;
void l2FiqFunc(Arg id)
{
LOG_printf(&trace, "l2_fiq %d\n", ArgToInt(id)%32);
}
Void main()
{
HWI_Attrs attrs;
attrs = HWI_ATTRS;
attrs.arg = (Arg)
C55_L2_INT10
;
HWI_dispatchPlug( C55_L2_INT10, (Fxn)l2FiqFunc, &attrs);
C55_l2SetIntPriority
( C55_L2_INT10, 0);
attrs.arg = (Arg)
C55_L2_INT11
;
HWI_dispatchPlug( C55_L2_INT11, (Fxn)l2FiqFunc, &attrs);
C55_l2SetIntPriority( C55_L2_INT11, 1);
attrs.arg = (Arg)
C55_L2_INT12
;
HWI_dispatchPlug( C55_L2_INT12, (Fxn)l2FiqFunc, &attrs);
C55_l2SetIntPriority( C55_L2_INT12, 2);
attrs.arg = (Arg)
C55_L2_INT13
;
HWI_dispatchPlug( C55_L2_INT13, (Fxn)l2FiqFunc, &attrs);
C55_l2SetIntPriority( C55_L2_INT13, 3);
C55_l2EnableMIR
(0x00003c00);
}