mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +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
|
||||
* 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
|
||||
* FILE: ntoskrnl/ke/i386/irq.c
|
||||
|
@ -485,13 +485,6 @@ KiInterruptDispatch (ULONG irq, PKIRQ_TRAPFRAME Trapframe)
|
|||
return;
|
||||
}
|
||||
|
||||
CurrentThread = KeGetCurrentThread();
|
||||
if (NULL != CurrentThread && NULL == CurrentThread->TrapFrame)
|
||||
{
|
||||
OldTrapFrame = CurrentThread->TrapFrame;
|
||||
KeIRQTrapFrameToTrapFrame(Trapframe, &KernelTrapFrame);
|
||||
CurrentThread->TrapFrame = &KernelTrapFrame;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable interrupts
|
||||
|
@ -526,19 +519,33 @@ KiInterruptDispatch (ULONG irq, PKIRQ_TRAPFRAME Trapframe)
|
|||
__asm__("cli\n\t");
|
||||
HalEndSystemInterrupt (old_level, 0);
|
||||
|
||||
if (old_level==PASSIVE_LEVEL && CurrentThread!=NULL &&
|
||||
CurrentThread->Alerted[1] != 0 &&
|
||||
CurrentThread->TrapFrame->Cs != KERNEL_CS)
|
||||
if (old_level==PASSIVE_LEVEL && 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);
|
||||
if (NULL != CurrentThread && CurrentThread->TrapFrame == &KernelTrapFrame)
|
||||
if (CurrentThread->TrapFrame == &KernelTrapFrame)
|
||||
{
|
||||
KeTrapFrameToIRQTrapFrame(&KernelTrapFrame, Trapframe);
|
||||
CurrentThread->TrapFrame = OldTrapFrame;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* MP */
|
||||
|
|
Loading…
Reference in a new issue