Nesting interrupts with ARM core
From: Jeo (jeo_at_ky___BIG-FISH-LITTLE-FISH___bert.com)
Date: 02/24/05
- Next message: johna_at_m: "Small size SBCs with PCMCIA"
- Previous message: Michael J. Salamone: "Re: Question about WaitForSingleObject() ?"
- Next in thread: Steve Maillet \(eMVP\): "Re: Nesting interrupts with ARM core"
- Reply: Steve Maillet \(eMVP\): "Re: Nesting interrupts with ARM core"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Feb 2005 11:58:13 -0000
Hi,
i've read another recent post regarding nesting interrupts, but im not at
the same point, so ive started a new thread.
I am trying to enable an interrupt thread that is signalled when i receive
EINT0 interrupt. The arm core only has one IRQ.
Im lost in how i should do this. I've read the help files, but cant work out
what to do!
In my thread startup code, i do this (eror checking removed for simplisity):
-----------------------------------------------------------
m_hevInterrupt = CreateEvent(NULL, FALSE, FALSE, NULL); // auto-reseting
event object
KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, 1 /*IRQ*/, sizeof(DWORD),
&g_dwSysIntr_Btn, sizeof(DWORD), NULL);
InterruptInitialize(g_dwSysIntr_Btn, m_hevInterrupt, NULL, 0);
CeSetThreadPriority(GetCurrentThread(), (int)dwPriority);
ISRThreadLoop();
-----------------------------------------------------------
Then i have a Isr loop so service the interrupts:
-----------------------------------------------------------
IST loop:
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
m_bIsrThreadRunning = TRUE;
v_pInterruptReg->INTMSK &= (0x1 << 0); // unmask interrupt (enable
interrupt)
v_pInterruptReg->SRCPND &= ~(0x1 << 0); // clear interrupt pending flag
InterruptDone( g_dwSysIntr_Btn ); // forget the first one (if there is
one) becuase were still booting eeeeyyye!
for(;;)
{
if(WaitForSingleObject(m_hevInterrupt, INFINITE) == WAIT_OBJECT_0)
{
// check that the interrupt was for us (interrupt is unmasked
(enabled) and interrupt is pending):
if(((v_pInterruptReg->SRCPND & (0x1<<0))!=(0x1<<0)) ||
((v_pInterruptReg->INTMSK & (0x1<<0))!=0x0)) // see data*** page 14-7
{
InterruptDone(SYSINTR_CHAIN); // not for us
continue;
}
// process interrupt here
:
:
:
v_pInterruptReg->SRCPND &= ~(0x1 << 0); // clear interrupt
pending flag
InterruptDone( g_dwSysIntr_Btn ); // signal to OS that we have
finished
}
}
return TRUE;
-----------------------------------------------------------
Problem is i receive a signalled condition when a keyboard button is
pressed, and the InterruptDone(SYSINTR_CHAIN); doesn't seem to pass the
interrupt to the keyboard handler!
What am i doing wrong?
Joe
- Next message: johna_at_m: "Small size SBCs with PCMCIA"
- Previous message: Michael J. Salamone: "Re: Question about WaitForSingleObject() ?"
- Next in thread: Steve Maillet \(eMVP\): "Re: Nesting interrupts with ARM core"
- Reply: Steve Maillet \(eMVP\): "Re: Nesting interrupts with ARM core"
- Messages sorted by: [ date ] [ thread ]