mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:52:57 +00:00
- Check always the irq trapframe's cs before delivering an user mode apc.
- Copy the irq trap frame only for apc's. svn path=/trunk/; revision=5843
This commit is contained in:
parent
78b253a811
commit
d09b29c3e8
1 changed files with 26 additions and 19 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: irq.c,v 1.34 2003/07/20 12:14:46 dwelch Exp $
|
/* $Id: irq.c,v 1.35 2003/08/25 09:14:09 hbirr Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/ke/i386/irq.c
|
* FILE: ntoskrnl/ke/i386/irq.c
|
||||||
|
@ -485,13 +485,6 @@ KiInterruptDispatch (ULONG irq, PKIRQ_TRAPFRAME Trapframe)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentThread = KeGetCurrentThread();
|
|
||||||
if (NULL != CurrentThread && NULL == CurrentThread->TrapFrame)
|
|
||||||
{
|
|
||||||
OldTrapFrame = CurrentThread->TrapFrame;
|
|
||||||
KeIRQTrapFrameToTrapFrame(Trapframe, &KernelTrapFrame);
|
|
||||||
CurrentThread->TrapFrame = &KernelTrapFrame;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable interrupts
|
* Enable interrupts
|
||||||
|
@ -526,20 +519,34 @@ KiInterruptDispatch (ULONG irq, PKIRQ_TRAPFRAME Trapframe)
|
||||||
__asm__("cli\n\t");
|
__asm__("cli\n\t");
|
||||||
HalEndSystemInterrupt (old_level, 0);
|
HalEndSystemInterrupt (old_level, 0);
|
||||||
|
|
||||||
if (old_level==PASSIVE_LEVEL && CurrentThread!=NULL &&
|
if (old_level==PASSIVE_LEVEL && Trapframe->Cs != KERNEL_CS)
|
||||||
CurrentThread->Alerted[1] != 0 &&
|
|
||||||
CurrentThread->TrapFrame->Cs != KERNEL_CS)
|
|
||||||
{
|
{
|
||||||
KiDeliverNormalApc();
|
CurrentThread = KeGetCurrentThread();
|
||||||
|
if (CurrentThread!=NULL && CurrentThread->Alerted[1])
|
||||||
|
{
|
||||||
|
DPRINT("PID: %d, TID: %d CS %04x/%04x\n",
|
||||||
|
((PETHREAD)CurrentThread)->ThreadsProcess->UniqueProcessId,
|
||||||
|
((PETHREAD)CurrentThread)->Cid.UniqueThread,
|
||||||
|
Trapframe->Cs,
|
||||||
|
CurrentThread->TrapFrame ? CurrentThread->TrapFrame->Cs : 0);
|
||||||
|
if (CurrentThread->TrapFrame == NULL)
|
||||||
|
{
|
||||||
|
OldTrapFrame = CurrentThread->TrapFrame;
|
||||||
|
KeIRQTrapFrameToTrapFrame(Trapframe, &KernelTrapFrame);
|
||||||
|
CurrentThread->TrapFrame = &KernelTrapFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KiDeliverNormalApc();
|
||||||
|
|
||||||
assert(KeGetCurrentThread() == CurrentThread);
|
assert(KeGetCurrentThread() == CurrentThread);
|
||||||
if (NULL != CurrentThread && CurrentThread->TrapFrame == &KernelTrapFrame)
|
if (CurrentThread->TrapFrame == &KernelTrapFrame)
|
||||||
{
|
{
|
||||||
KeTrapFrameToIRQTrapFrame(&KernelTrapFrame, Trapframe);
|
KeTrapFrameToIRQTrapFrame(&KernelTrapFrame, Trapframe);
|
||||||
CurrentThread->TrapFrame = OldTrapFrame;
|
CurrentThread->TrapFrame = OldTrapFrame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* MP */
|
#endif /* MP */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue