Re: problem in IST event getting signalled by the OS

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Where is the g_DeviceISTData defined? Global context?
On stack?

I'm not sure how do you trap the "IRQHandler", but
can you confirm that "OEMInterruptHandler" returns
the correct sysintr value?

Also what happens with the rest of the system?
Does it function properly?


"jukeboxjunky" <nimish.h@xxxxxxxxx> wrote in message news:1145353266.790581.198140@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

we are trying to write an I2C driver which needs receive interrupt to
be enabled.
we are using the Arm Xscale core (PXA27x) thus there is only one
interrupt handler(IRQHandler).
we are able to trap the interrupt within the IRQHandler and a proper
SYSIntr (as decided by us) is also returned to the kernel, which we
have been able to validate.

we then create an IST, create an event, call InitializeInterrupt, and
wait on the event created as per the pedagogy.
the problem right now is that the wait never yeilds, albeit to say that
event is never signalled by the OS. Any pointers on the above problem
would be appreciated. the code snippet of the IST is as below:

-----------------------------------------------------------

Global................................................................................

#define SYSINTR_I2C 30
typedef struct ISTData // Declare the Structure to pass to IST
{
HANDLE hThread; // IST Handle
DWORD sysIntr; // Logical ID
HANDLE hEvent; // handle to the IST event
volatile BOOL abort; // flag to test to exit the IST
DWORD Priority;
}ISTData;


Driver
Initialisation..................................................................

ISTData g_DeviceISTData;// Create event to link to IST
g_DeviceISTData.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if(g_DeviceISTData.hEvent != NULL)
{
InterruptInitialize(SYSINTR_I2C, g_DeviceISTData.hEvent, 0, 0);
}
g_DeviceISTData.sysIntr = SYSINTR_I2C;
g_DeviceISTData.Priority = 250;
g_DeviceISTData.hThread = CreateThread(NULL,0, &DeviceIST,
&g_DeviceISTData, 0, NULL);


Thread................................................................................

DWORD DeviceIST(void *dat)
{
ISTData* pData= (ISTData*)dat;
CeSetThreadPriority(GetCurrentThread(), pData->Priority);
while(!pData->abort)
{
// wait for the interrupt event...
WaitForSingleObject(pData->hEvent, INFINITE)

//Our code is here

//Done the interrupt job
InterruptDone(pData->sysIntr);
}
return 0;

}

-------------------------------------------------------------



.



Relevant Pages

  • Kernel trap 9 [FreeBSD 4.9]
    ... %Kernel trap 9 with interrupts disabled ... Fatal trap 9: general protection fault while in kernel mode ... processor eflags = interrupt enabled, ...
    (freebsd-hackers)
  • [PATCH 7/7] lguest documentation:Chapter VII
    ... * Host can send more. ... * Guest, but the Guest needs the interrupts atomically disabled for an ... * interrupt gate. ... It can do this by pointing the trap gate at instructions ...
    (Linux-Kernel)
  • [PATCH 7/7] lguest: documentation pt VII: FIXMEs
    ... * Host can send more. ... * Guest, but the Guest needs the interrupts atomically disabled for an ... * interrupt gate. ... It can do this by pointing the trap gate at instructions ...
    (Linux-Kernel)
  • Re: whats the meaning of plain text files executable attribute
    ... G>>> to link the applications with the operating system. ... G> But this is exactly what an INT instruction does;-) ... This is in fact the main function of a trap ... interrupt vectors to someplace inside of itself, ...
    (comp.os.linux.misc)
  • problem in IST event getting signalled by the OS
    ... we are using the Arm Xscale core (PXA27x) thus there is only one ... interrupt handler. ... the code snippet of the IST is as below: ... typedef struct ISTData // Declare the Structure to pass to IST ...
    (microsoft.public.windowsce.platbuilder)