Implement HlpGetCpuApicId() routine
Some checks failed
Builds / ExectOS (amd64) (push) Failing after 27s
Builds / ExectOS (i686) (push) Failing after 27s

This commit is contained in:
Rafal Kupiec 2024-07-22 23:31:20 +02:00
parent 2c5b680426
commit 2e7793dc2b
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
3 changed files with 28 additions and 0 deletions

View File

@ -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.
*

View File

@ -34,6 +34,10 @@ XTAPI
BOOLEAN
HlpCheckX2ApicSupport(VOID);
XTAPI
ULONG
HlpGetCpuApicId(VOID);
XTCDECL
VOID
HlpHandleApicSpuriousService(VOID);

View File

@ -34,6 +34,10 @@ XTAPI
BOOLEAN
HlpCheckX2ApicSupport(VOID);
XTAPI
ULONG
HlpGetCpuApicId(VOID);
XTCDECL
VOID
HlpHandleApicSpuriousService(VOID);