Start application processor
This commit is contained in:
@@ -45,3 +45,36 @@ HlInitializeProcessor(VOID)
|
||||
/* Set the APIC running level */
|
||||
HlSetRunLevel(KeGetCurrentProcessorBlock()->RunLevel);
|
||||
}
|
||||
|
||||
XTAPI
|
||||
XTSTATUS
|
||||
HlStartProcessor(IN ULONG CpuId,
|
||||
IN PHYSICAL_ADDRESS EntryPoint)
|
||||
{
|
||||
ULONG Attempt;
|
||||
|
||||
/* Wait until command register is clear */
|
||||
while((HlReadApicRegister(APIC_ICR0) & APIC_DELIVERY_PENDING) != 0);
|
||||
|
||||
/* Trigger INIT IPI and wait for delivery bit to be cleared */
|
||||
HlpSendIpi(CpuId, APIC_DM_INIT | APIC_DM_LEVEL | APIC_DM_ASSERT);
|
||||
while((HlReadApicRegister(APIC_ICR0) & APIC_DELIVERY_PENDING) != 0);
|
||||
|
||||
/* Deassert INIT IPI to take CPU out of reset and wait for delivery bit to be cleared */
|
||||
HlpSendIpi(CpuId, APIC_DM_INIT | APIC_DM_LEVEL);
|
||||
while((HlReadApicRegister(APIC_ICR0) & APIC_DELIVERY_PENDING) != 0);
|
||||
|
||||
/* Two attempts to send STARTUP IPI */
|
||||
for(Attempt = 0; Attempt < 2; Attempt++)
|
||||
{
|
||||
/* Trigger STARTUP IPI and wait for delivery bit to be cleared */
|
||||
HlpSendIpi(CpuId, APIC_DM_STARTUP | (EntryPoint.LowPart >> 12));
|
||||
while((HlReadApicRegister(APIC_ICR0) & APIC_DELIVERY_PENDING) != 0);
|
||||
}
|
||||
|
||||
/* Memory barrier */
|
||||
ArMemoryBarrier();
|
||||
|
||||
/* Return success */
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user