Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 302 of file kiinit.c.
{ ULONG Cpu; PKTHREAD InitialThread; PKPROCESS InitialProcess; ARM_CONTROL_REGISTER ControlRegister; PKIPCR Pcr = (PKIPCR)KeGetPcr(); PKTHREAD Thread; /* Flush the TLB */ KeFlushTb(); /* Save the loader block and get the current CPU */ KeLoaderBlock = LoaderBlock; Cpu = KeNumberProcessors; /* Save the initial thread and process */ InitialThread = (PKTHREAD)LoaderBlock->Thread; InitialProcess = (PKPROCESS)LoaderBlock->Process; /* Clean the APC List Head */ InitializeListHead(&InitialThread->ApcState.ApcListHead[KernelMode]); /* Initialize the machine type */ KiInitializeMachineType(); /* Skip initial setup if this isn't the Boot CPU */ if (Cpu) goto AppCpuInit; /* Initialize the PCR */ RtlZeroMemory(Pcr, PAGE_SIZE); KiInitializePcr(Cpu, Pcr, InitialThread, (PVOID)LoaderBlock->u.Arm.PanicStack, (PVOID)LoaderBlock->u.Arm.InterruptStack); /* Now sweep caches */ HalSweepIcache(); HalSweepDcache(); /* Set us as the current process */ InitialThread->ApcState.Process = InitialProcess; AppCpuInit: /* Setup CPU-related fields */ Pcr->Number = Cpu; Pcr->SetMember = 1 << Cpu; Pcr->SetMemberCopy = 1 << Cpu; Pcr->PrcbData.SetMember = 1 << Cpu; /* Initialize the Processor with HAL */ HalInitializeProcessor(Cpu, KeLoaderBlock); /* Set active processors */ KeActiveProcessors |= Pcr->SetMember; KeNumberProcessors++; /* Check if this is the boot CPU */ if (!Cpu) { /* Initialize debugging system */ KdInitSystem(0, KeLoaderBlock); /* Check for break-in */ if (KdPollBreakIn()) DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C); } /* Raise to HIGH_LEVEL */ KfRaiseIrql(HIGH_LEVEL); /* Set the exception address to high */ ControlRegister = KeArmControlRegisterGet(); ControlRegister.HighVectors = TRUE; KeArmControlRegisterSet(ControlRegister); /* Setup the exception vector table */ RtlCopyMemory((PVOID)0xFFFF0000, &KiArmVectorTable, 14 * sizeof(PVOID)); /* Initialize the rest of the kernel now */ KiInitializeKernel((PKPROCESS)LoaderBlock->Process, (PKTHREAD)LoaderBlock->Thread, (PVOID)LoaderBlock->KernelStack, Pcr->Prcb, Pcr->Prcb->Number, KeLoaderBlock); /* Set the priority of this thread to 0 */ Thread = KeGetCurrentThread(); Thread->Priority = 0; /* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */ _enable(); KfLowerIrql(DISPATCH_LEVEL); /* Set the right wait IRQL */ Thread->WaitIrql = DISPATCH_LEVEL; /* Jump into the idle loop */ KiIdleLoop(); }