reactos/ntoskrnl/include/internal
diff -u -r1.60 -r1.61
--- ke.h 30 Oct 2004 23:48:56 -0000 1.60
+++ ke.h 31 Oct 2004 13:20:57 -0000 1.61
@@ -40,6 +40,7 @@
struct _KTHREAD;
struct _KIRQ_TRAPFRAME;
+struct _KPCR;
VOID STDCALL
DbgBreakPointNoBugCheck(VOID);
@@ -100,7 +101,7 @@
VOID KeInitExceptions(VOID);
VOID KeInitInterrupts(VOID);
VOID KeInitTimer(VOID);
-VOID KeInitDpc(VOID);
+VOID KeInitDpc(struct _KPCR* Pcr);
VOID KeInitDispatcher(VOID);
VOID KeInitializeDispatcher(VOID);
VOID KeInitializeTimerImpl(VOID);
reactos/ntoskrnl/ke/i386
diff -u -r1.38 -r1.39
--- kernel.c 24 Oct 2004 11:58:55 -0000 1.38
+++ kernel.c 31 Oct 2004 13:20:58 -0000 1.39
@@ -35,7 +35,6 @@
ULONG KiPcrInitDone = 0;
static ULONG PcrsAllocated = 0;
-static PFN_TYPE PcrPages[MAXIMUM_PROCESSORS];
ULONG Ke386CpuidFlags, Ke386CpuidFlags2, Ke386CpuidExFlags;
ULONG Ke386Cpuid = 0x300;
ULONG Ke386CacheAlignment;
@@ -128,15 +127,42 @@
VOID INIT_FUNCTION
KePrepareForApplicationProcessorInit(ULONG Id)
{
- MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &PcrPages[Id]);
+ DPRINT("KePrepareForApplicationProcessorInit(Id %d)\n", Id);
+ PFN_TYPE PrcPfn;
+ PKPCR Pcr;
+
+ Pcr = (PKPCR)((ULONG_PTR)KPCR_BASE + Id * PAGE_SIZE);
+
+ MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &PrcPfn);
+ MmCreateVirtualMappingForKernel((PVOID)Pcr,
+ PAGE_READWRITE,
+ &PrcPfn,
+ 1);
+ /*
+ * Create a PCR for this processor
+ */
+ memset(Pcr, 0, PAGE_SIZE);
+ Pcr->ProcessorNumber = Id;
+ Pcr->Tib.Self = &Pcr->Tib;
+ Pcr->Self = Pcr;
+ Pcr->Irql = HIGH_LEVEL;
+
+ /* Mark the end of the exception handler list */
+ Pcr->Tib.ExceptionList = (PVOID)-1;
+
+ KeInitDpc(Pcr);
+
+
KiGdtPrepareForApplicationProcessorInit(Id);
}
VOID
KeApplicationProcessorInit(VOID)
{
- PKPCR KPCR;
ULONG Offset;
+ PKPCR Pcr;
+
+ DPRINT("KeApplicationProcessorInit()\n");
if (Ke386CpuidFlags & X86_FEATURE_PGE)
{
@@ -150,30 +176,14 @@
MiEnablePAE(NULL);
}
- /*
- * Create a PCR for this processor
- */
- Offset = InterlockedIncrement((LONG *)&PcrsAllocated) - 1;
- KPCR = (PKPCR)(KPCR_BASE + (Offset * PAGE_SIZE));
- MmCreateVirtualMappingForKernel((PVOID)KPCR,
- PAGE_READWRITE,
- &PcrPages[Offset],
- 1);
- memset(KPCR, 0, PAGE_SIZE);
- KPCR->ProcessorNumber = (UCHAR)Offset;
- KPCR->Tib.Self = &KPCR->Tib;
- KPCR->Self = KPCR;
- KPCR->Irql = HIGH_LEVEL;
-
- /* Mark the end of the exception handler list */
- KPCR->Tib.ExceptionList = (PVOID)-1;
+ Offset = InterlockedIncrement(&PcrsAllocated) - 1;
+ Pcr = (PKPCR)((ULONG_PTR)KPCR_BASE + Offset * PAGE_SIZE);
/*
* Initialize the GDT
*/
- KiInitializeGdt(KPCR);
-
- KeInitDpc();
+ KiInitializeGdt(Pcr);
+
/*
* It is now safe to process interrupts
@@ -228,6 +238,8 @@
KiPcrInitDone = 1;
PcrsAllocated++;
+ KeInitDpc(KPCR);
+
/* Mark the end of the exception handler list */
KPCR->Tib.ExceptionList = (PVOID)-1;
@@ -307,7 +319,6 @@
VOID INIT_FUNCTION
KeInit2(VOID)
{
- KeInitDpc();
KeInitializeBugCheck();
KeInitializeDispatcher();
KeInitializeTimerImpl();
reactos/ntoskrnl/ke
diff -u -r1.41 -r1.42
--- dpc.c 30 Oct 2004 23:48:56 -0000 1.41
+++ dpc.c 31 Oct 2004 13:20:58 -0000 1.42
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: dpc.c,v 1.41 2004/10/30 23:48:56 navaraf Exp $
+/* $Id: dpc.c,v 1.42 2004/10/31 13:20:58 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -288,13 +288,11 @@
}
VOID INIT_FUNCTION
-KeInitDpc(VOID)
+KeInitDpc(PKPCR Pcr)
/*
* FUNCTION: Initialize DPC handling
*/
{
- PKPCR Pcr;
- Pcr = KeGetCurrentKPCR();
InitializeListHead(&Pcr->PrcbData.DpcData[0].DpcListHead);
KeInitializeSpinLock(&Pcr->PrcbData.DpcData[0].DpcLock);
Pcr->PrcbData.MaximumDpcQueueDepth = 0;