1
0
원본 프로젝트 : xt-sys/exectos

Implement AcGetApicBase()

This commit is contained in:
Rafal Kupiec 2024-02-02 22:07:28 +01:00
부모 082568ae10
커밋 4fa5b8f2a5
로그인 계정: belliash
GPG 키 ID: 4E829243E0CFE6B4
2개의 변경된 파일43개의 추가작업 그리고 0개의 파일을 삭제

파일 보기

@ -48,6 +48,45 @@ AcGetAcpiDescriptionPointer(OUT PVOID *AcpiTable)
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
*

파일 보기

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