Implement HlpGetCpuApicId() routine

此提交包含在:
2024-07-22 23:31:20 +02:00
父節點 2c5b680426
當前提交 2e7793dc2b
共有 3 個檔案被更改,包括 28 行新增0 行删除

查看文件

@@ -133,6 +133,26 @@ HlpCheckX2ApicSupport(VOID)
return TRUE;
}
/**
* Gets the local APIC ID of the current processor.
*
* @return This routine returns the current processor's local APIC ID.
*
* @since XT 1.0
*/
XTAPI
ULONG
HlpGetCpuApicId(VOID)
{
ULONG ApicId;
/* Read APIC ID register */
ApicId = HlReadApicRegister(APIC_ID);
/* Return logical CPU ID depending on current APIC mode */
return (HlpApicMode == APIC_MODE_COMPAT) ? ((ApicId & 0xFFFFFFFF) >> APIC_XAPIC_LDR_SHIFT) : ApicId;
}
/**
* Allows an APIC spurious interrupts to end up.
*