Implement AcGetApicBase()
Some checks failed
Builds / ExectOS (amd64) (push) Failing after 16s
Builds / ExectOS (i686) (push) Failing after 15s

This commit is contained in:
Rafal Kupiec 2024-02-02 22:07:28 +01:00
parent 082568ae10
commit 4fa5b8f2a5
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 43 additions and 0 deletions

View File

@ -48,6 +48,45 @@ AcGetAcpiDescriptionPointer(OUT PVOID *AcpiTable)
return STATUS_EFI_NOT_FOUND; return STATUS_EFI_NOT_FOUND;
} }
/**
* Gets the Advanced Programmable Interrupt Controller (APIC) base address.
*
* @param ApicBase
* Supplies a pointer to memory area where APIC base address will be stored.
*
* @return This routine returns an EFI status code.
*
* @since XT 1.0
*/
XTCDECL
EFI_STATUS
AcGetApicBase(OUT PVOID *ApicBase)
{
PCPUID_REGISTERS CpuRegisters = NULL;
/* Get CPU features list */
CpuRegisters->Leaf = CPUID_GET_CPU_FEATURES;
CpuRegisters->SubLeaf = 0;
CpuRegisters->Eax = 0;
CpuRegisters->Ebx = 0;
CpuRegisters->Ecx = 0;
CpuRegisters->Edx = 0;
ArCpuId(CpuRegisters);
/* Check if APIC present */
if((CpuRegisters->Edx & CPUID_FEATURES_EDX_APIC) == 0)
{
/* APIC is not supported by the CPU */
return STATUS_EFI_UNSUPPORTED;
}
/* Get APIC base address */
*ApicBase = (PVOID)((UINT_PTR)ArReadModelSpecificRegister(0x1B) & 0xFFFFF000);
/* Return success */
return STATUS_EFI_SUCCESS;
}
/** /**
* Gets RSDP (ACPI 1.0) from EFI system configuration * Gets RSDP (ACPI 1.0) from EFI system configuration
* *

View File

@ -18,6 +18,10 @@ XTCDECL
EFI_STATUS EFI_STATUS
AcGetAcpiDescriptionPointer(OUT PVOID *AcpiTable); AcGetAcpiDescriptionPointer(OUT PVOID *AcpiTable);
XTCDECL
EFI_STATUS
AcGetApicBase(OUT PVOID *ApicBase);
XTCDECL XTCDECL
EFI_STATUS EFI_STATUS
AcGetRsdpTable(OUT PVOID *AcpiTable); AcGetRsdpTable(OUT PVOID *AcpiTable);