context switch and interrupts

Gedare Bloom gedare at gwu.edu
Mon Jan 4 22:41:23 UTC 2010


Hi,

I'm working on a port of RTEMS to the Sparc 64 (with Eugen) using the
existing SPARC port as a basis. Our port is "working", but I have
found that when any RTEMS application begins to run, interrupts are
disabled. After some initial debugging, it appears that interrupts are
turned off explicitly by boot_card and do not appear to be explicitly
turned on.

Looking at the BSP guide, I noticed this in section 7.3.2 about
boot_card: "RTEMS will context switch to the first application task.
As a side-effect of this context switch, processor interrupts will be
enabled."

Does this mean that _CPU_Context_switch in cpu_asm.S should always
turn interrupts on, regardless of the processor's state?

Or is it just that the first context pointed to by Context_Control
*heir on the first context switch has the appropriate processor state
for interrupts to be enabled?  If so, where is that context
initialized so that I can make sure it is correct? The obvious
candidate seems to be _CPU_Context_Initialize, but it only seems to
set an interrupt masking level, not actually change whether interrupts
are enabled or disabled.

Thanks,
Gedare



More information about the users mailing list