From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- EDK/Foundation/Library/Dxe/Include/Ipf/CpuFuncs.h | 93 ++ .../Library/Dxe/Include/Ipf/EsalRuntimeLib.h | 1305 ++++++++++++++++++ EDK/Foundation/Library/Dxe/Include/Ipf/ProcDep.h | 119 ++ .../Library/Dxe/Include/Ipf/SalDriverLib.h | 1454 ++++++++++++++++++++ 4 files changed, 2971 insertions(+) create mode 100644 EDK/Foundation/Library/Dxe/Include/Ipf/CpuFuncs.h create mode 100644 EDK/Foundation/Library/Dxe/Include/Ipf/EsalRuntimeLib.h create mode 100644 EDK/Foundation/Library/Dxe/Include/Ipf/ProcDep.h create mode 100644 EDK/Foundation/Library/Dxe/Include/Ipf/SalDriverLib.h (limited to 'EDK/Foundation/Library/Dxe/Include/Ipf') diff --git a/EDK/Foundation/Library/Dxe/Include/Ipf/CpuFuncs.h b/EDK/Foundation/Library/Dxe/Include/Ipf/CpuFuncs.h new file mode 100644 index 0000000..3818170 --- /dev/null +++ b/EDK/Foundation/Library/Dxe/Include/Ipf/CpuFuncs.h @@ -0,0 +1,93 @@ +/*++ + +Copyright (c) 2004, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + CpuFuncs.h + +Abstract: + +--*/ + +#ifndef _CPU_FUNCS_H +#define _CPU_FUNCS_H + +#define EFI_CPUID_SIGNATURE 0x0 +#define EFI_CPUID_VERSION_INFO 0x1 +#define EFI_CPUID_CACHE_INFO 0x2 +#define EFI_CPUID_SERIAL_NUMBER 0x3 +#define EFI_CPUID_EXTENDED_FUNCTION 0x80000000 +#define EFI_CPUID_EXTENDED_CPU_SIG 0x80000001 +#define EFI_CPUID_BRAND_STRING1 0x80000002 +#define EFI_CPUID_BRAND_STRING2 0x80000003 +#define EFI_CPUID_BRAND_STRING3 0x80000004 + +#define EFI_MSR_IA32_APIC_BASE 0x1B +#define EFI_MSR_EBC_HARD_POWERON 0x2A +#define EFI_MSR_EBC_SOFT_POWERON 0x2B +#define EFI_MSR_EBC_FREQUENCY_ID 0x2C +#define EFI_MSR_IA32_BIOS_UPDT_TRIG 0x79 +#define EFI_MSR_IA32_BIOS_SIGN_ID 0x8B +#define EFI_APIC_GLOBAL_ENABLE 0x800 + +#define EFI_CACHE_VARIABLE_MTRR_BASE 0x200 +#define EFI_CACHE_VARIABLE_MTRR_END 0x20F +#define EFI_CACHE_IA32_MTRR_DEF_TYPE 0x2FF +#define EFI_CACHE_VALID_ADDRESS 0xFFFFFF000 +#define EFI_CACHE_MTRR_VALID 0x800 +#define EFI_CACHE_FIXED_MTRR_VALID 0x400 +#define EFI_MSR_VALID_MASK 0xFFFFFFFFF + +#define EFI_IA32_MTRR_FIX64K_00000 0x250 +#define EFI_IA32_MTRR_FIX16K_80000 0x258 +#define EFI_IA32_MTRR_FIX16K_A0000 0x259 +#define EFI_IA32_MTRR_FIX4K_C0000 0x268 +#define EFI_IA32_MTRR_FIX4K_C8000 0x269 +#define EFI_IA32_MTRR_FIX4K_D0000 0x26A +#define EFI_IA32_MTRR_FIX4K_D8000 0x26B +#define EFI_IA32_MTRR_FIX4K_E0000 0x26C +#define EFI_IA32_MTRR_FIX4K_E8000 0x26D +#define EFI_IA32_MTRR_FIX4K_F0000 0x26E +#define EFI_IA32_MTRR_FIX4K_F8000 0x26F + +#define EFI_IA32_MCG_CAP 0x179 +#define EFI_IA32_MCG_CTL 0x17B +#define EFI_IA32_MC0_CTL 0x400 +#define EFI_IA32_MC0_STATUS 0x401 + +#define EFI_CACHE_UNCACHEABLE 0 +#define EFI_CACHE_WRITECOMBINING 1 +#define EFI_CACHE_WRITETHROUGH 4 +#define EFI_CACHE_WRITEPROTECTED 5 +#define EFI_CACHE_WRITEBACK 6 + +UINT64 +EfiReadTsc ( + VOID + ) +/*++ + +Routine Description: + + Read Time stamp. + +Arguments: + + None + +Returns: + + Return the read data + +--*/ +; + +#endif diff --git a/EDK/Foundation/Library/Dxe/Include/Ipf/EsalRuntimeLib.h b/EDK/Foundation/Library/Dxe/Include/Ipf/EsalRuntimeLib.h new file mode 100644 index 0000000..7f29acf --- /dev/null +++ b/EDK/Foundation/Library/Dxe/Include/Ipf/EsalRuntimeLib.h @@ -0,0 +1,1305 @@ +/*++ + +Copyright (c) 2004, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + EsalRuntimeLib.h + +Abstract: + + SAL Driver Lib + +Revision History + +--*/ + +#ifndef _ESAL_RUNTIME_LIB_H_ +#define _ESAL_RUNTIME_LIB_H_ + +#include "SalApi.h" +#include "EfiFirmwareVolumeHeader.h" + +#include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService) +#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid) +#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock) + +VOID +EsalRuntimeLibVirtualNotify ( + VOID + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + None + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +EsalInitializeRuntimeDriverLib ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + ImageHandle - Image Handle + SystemTable - the System Table + +Returns: + + TODO: add return values + +--*/ +; +SAL_RETURN_REGS +CallEsalService ( + IN EFI_GUID *ClassGuid, + IN UINT64 FunctionId, + IN UINT64 Arg2, + IN UINT64 Arg3, + IN UINT64 Arg4, + IN UINT64 Arg5, + IN UINT64 Arg6, + IN UINT64 Arg7, + IN UINT64 Arg8 + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + ClassGuid - TODO: add argument description + FunctionId - TODO: add argument description + Arg2 - TODO: add argument description + Arg3 - TODO: add argument description + Arg4 - TODO: add argument description + Arg5 - TODO: add argument description + Arg6 - TODO: add argument description + Arg7 - TODO: add argument description + Arg8 - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +// +// Assembly Functions +// + +SAL_RETURN_REGS +EsalGetEntryPoint ( + VOID + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + None + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +EsalSetPhysicalEntryPoint ( + IN UINT64 EntryPoint, + IN UINT64 Gp + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + EntryPoint - TODO: add argument description + Gp - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +EsalSetVirtualEntryPoint ( + IN UINT64 EntryPoint, + IN UINT64 Gp + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + EntryPoint - TODO: add argument description + Gp - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +EsalSetPhysicalModuleGlobal ( + IN VOID *Global + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Global - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +EsalSetVirtualModuleGlobal ( + IN VOID *Global + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Global - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +EsalGetModuleGlobal ( + VOID + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + None + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +GetIrrData ( + VOID + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + None + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +GetPsrData ( + VOID + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + None + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +GetProcIdData ( + VOID + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + None + +Returns: + + TODO: add return values + +--*/ +; + +VOID +SwitchCpuStack ( + IN UINT64 NewBsp, + IN UINT64 OldBsp + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + NewBsp - TODO: add argument description + OldBsp - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +// +// PAL PROC Class +// + +SAL_RETURN_REGS +SalPalProc ( + IN UINT64 Arg1, + IN UINT64 Arg2, + IN UINT64 Arg3, + IN UINT64 Arg4 + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Arg1 - TODO: add argument description + Arg2 - TODO: add argument description + Arg3 - TODO: add argument description + Arg4 - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +SalRegisterNewPalEntry ( + IN BOOLEAN PhysicalPalAddress, + IN EFI_PHYSICAL_ADDRESS NewPalAddress + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + PhysicalPalAddress - TODO: add argument description + NewPalAddress - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +SalGetPalEntryPointer ( + IN BOOLEAN PhysicalPalAddress + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + PhysicalPalAddress - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +// +// SAL BASE Class +// + +SAL_RETURN_REGS +SalProcSetVectors ( + IN UINT64 SalVectorType, + IN UINT64 PhyAddr1, + IN UINT64 Gp1, + IN UINT64 LengthCs1, + IN UINT64 PhyAddr2, + IN UINT64 Gp2, + IN UINT64 LengthCs2 + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + SalVectorType - TODO: add argument description + PhyAddr1 - TODO: add argument description + Gp1 - TODO: add argument description + LengthCs1 - TODO: add argument description + PhyAddr2 - TODO: add argument description + Gp2 - TODO: add argument description + LengthCs2 - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +SalProcMcRendez ( + VOID + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + None + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +SalProcMcSetParams ( + IN UINT64 ParamType, + IN UINT64 IntOrMem, + IN UINT64 IntOrMemVal, + IN UINT64 Timeout, + IN UINT64 McaOpt + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + ParamType - TODO: add argument description + IntOrMem - TODO: add argument description + IntOrMemVal - TODO: add argument description + Timeout - TODO: add argument description + McaOpt - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +EsalProcGetVectors ( + IN UINT64 VectorType + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + VectorType - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +EsalProcMcGetParams ( + IN UINT64 ParamInfoType + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + ParamInfoType - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +EsalProcMcGetMcParams ( + VOID + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + None + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +EsalProcGetMcCheckinFlags ( + IN UINT64 ProcessorUnit + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + ProcessorUnit - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +// +// Sal Base Class enums +// + +typedef enum { + McaVector, + BspInitVector, + BootRendezVector, + ApInitVector +} ESAL_GET_VECTOR_TYPE; + +SAL_RETURN_REGS +SalInitializeThreshold ( + IN VOID *ThresholdStruct, + IN UINT64 Count, + IN UINT64 Duration + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + ThresholdStruct - TODO: add argument description + Count - TODO: add argument description + Duration - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +SalBumpThresholdCount ( + IN VOID *ThresholdStruct, + IN UINT64 Count, + IN UINT64 Duration + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + ThresholdStruct - TODO: add argument description + Count - TODO: add argument description + Duration - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +SalGetThresholdCount ( + IN VOID *ThresholdStruct, + IN UINT64 Count, + IN UINT64 Duration + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + ThresholdStruct - TODO: add argument description + Count - TODO: add argument description + Duration - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +// +// Common Lib Function +// + +EFI_STATUS +RegisterEsalFunction ( + IN UINT64 FunctionId, + IN EFI_GUID *ClassGuid, + IN SAL_INTERNAL_EXTENDED_SAL_PROC Function, + IN VOID *ModuleGlobal + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + FunctionId - TODO: add argument description + ClassGuid - TODO: add argument description + Function - TODO: add argument description + ModuleGlobal - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +RegisterEsalClass ( + IN EFI_GUID *ClassGuid, + IN VOID *ModuleGlobal, + ... + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + ClassGuid - TODO: add argument description + ModuleGlobal - TODO: add argument description + ... - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +// +// MP Class Functions +// +SAL_RETURN_REGS +LibMpAddCpuData ( + IN UINT64 CpuGlobalId, + IN BOOLEAN Enabled, + IN UINT64 PalCompatability + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + CpuGlobalId - TODO: add argument description + Enabled - TODO: add argument description + PalCompatability - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +LibMpRemoveCpuData ( + IN UINT64 CpuGlobalId + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + CpuGlobalId - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +LibMpModifyCpuData ( + IN UINT64 CpuGlobalId, + IN BOOLEAN Enabled, + IN UINT64 PalCompatability + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + CpuGlobalId - TODO: add argument description + Enabled - TODO: add argument description + PalCompatability - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +LibMpGetCpuDataByID ( + IN UINT64 CpuGlobalId, + IN BOOLEAN IndexByEnabledCpu + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + CpuGlobalId - TODO: add argument description + IndexByEnabledCpu - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +LibMpGetCpuDataByIndex ( + IN UINT64 Index, + IN BOOLEAN IndexByEnabledCpu + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Index - TODO: add argument description + IndexByEnabledCpu - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +LibMpSendIpi ( + IN UINT64 ProcessorNumber, + IN UINT64 VectorNumber, + IN EFI_DELIVERY_MODE DeliveryMode, + IN BOOLEAN IRFlag + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + ProcessorNumber - TODO: add argument description + VectorNumber - TODO: add argument description + DeliveryMode - TODO: add argument description + IRFlag - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +LibMpCurrentProcessor ( + IN BOOLEAN IndexByEnabledCpu + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + IndexByEnabledCpu - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +LibGetNumProcessors ( + VOID + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + None + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +LibMpSaveMinStatePointer ( + IN UINT64 CpuGlobalId, + IN EFI_PHYSICAL_ADDRESS MinStatePointer + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + CpuGlobalId - TODO: add argument description + MinStatePointer - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +SAL_RETURN_REGS +LibMpRestoreMinStatePointer ( + IN UINT64 CpuGlobalId + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + CpuGlobalId - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +// +// MCA Class Functions +// + +EFI_STATUS +LibMcaGetStateInfo ( + IN UINT64 CpuId, + OUT EFI_PHYSICAL_ADDRESS *StateBufferPointer, + OUT UINT64 *RequiredStateBufferSize + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + CpuId - TODO: add argument description + StateBufferPointer - TODO: add argument description + RequiredStateBufferSize - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +LibMcaRegisterCpu ( + IN UINT64 CpuId, + IN EFI_PHYSICAL_ADDRESS StateBufferAddress + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + CpuId - TODO: add argument description + StateBufferAddress - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +// +// FVB Variables Class +// +EFI_STATUS +EsalReadBlock ( + IN UINTN Instance, + IN EFI_LBA Lba, + IN UINTN Offset, + IN OUT UINTN *NumBytes, + IN UINT8 *Buffer + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Instance - TODO: add argument description + Lba - TODO: add argument description + Offset - TODO: add argument description + NumBytes - TODO: add argument description + Buffer - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +EsalWriteBlock ( + IN UINTN Instance, + IN EFI_LBA Lba, + IN UINTN Offset, + IN OUT UINTN *NumBytes, + IN UINT8 *Buffer + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Instance - TODO: add argument description + Lba - TODO: add argument description + Offset - TODO: add argument description + NumBytes - TODO: add argument description + Buffer - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +EsalEraseBlock ( + IN UINTN Instance, + IN UINTN Lba + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Instance - TODO: add argument description + Lba - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +EsalGetVolumeAttributes ( + IN UINTN Instance, + OUT EFI_FVB_ATTRIBUTES *Attributes + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Instance - TODO: add argument description + Attributes - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +EsalSetVolumeAttributes ( + IN UINTN Instance, + IN EFI_FVB_ATTRIBUTES Attributes + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Instance - TODO: add argument description + Attributes - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +EsalGetPhysicalAddress ( + IN UINTN Instance, + OUT EFI_PHYSICAL_ADDRESS *Address + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Instance - TODO: add argument description + Address - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +EsalGetBlockSize ( + IN UINTN Instance, + IN EFI_LBA Lba, + OUT UINTN *BlockSize, + OUT UINTN *NumOfBlocks + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + Instance - TODO: add argument description + Lba - TODO: add argument description + BlockSize - TODO: add argument description + NumOfBlocks - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +// +// SAL ELOG Functions +// +EFI_STATUS +LibSalGetStateInfo ( + IN UINT64 McaType, + IN UINT8 *McaBuffer, + OUT UINTN *Size + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + McaType - TODO: add argument description + McaBuffer - TODO: add argument description + Size - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +LibSalGetStateInfoSize ( + IN UINT64 McaType, + OUT UINTN *Size + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + McaType - TODO: add argument description + Size - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +LibSalClearStateInfo ( + IN UINT64 McaType + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + McaType - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +LibEsalGetStateBuffer ( + IN UINT64 McaType, + OUT UINT8 **McaBuffer, + OUT UINTN *Index + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + McaType - TODO: add argument description + McaBuffer - TODO: add argument description + Index - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +EFI_STATUS +LibEsalSaveStateBuffer ( + IN UINT64 McaType + ) +/*++ + +Routine Description: + + TODO: Add function description + +Arguments: + + McaType - TODO: add argument description + +Returns: + + TODO: add return values + +--*/ +; + +#endif diff --git a/EDK/Foundation/Library/Dxe/Include/Ipf/ProcDep.h b/EDK/Foundation/Library/Dxe/Include/Ipf/ProcDep.h new file mode 100644 index 0000000..2df940f --- /dev/null +++ b/EDK/Foundation/Library/Dxe/Include/Ipf/ProcDep.h @@ -0,0 +1,119 @@ +/*++ + +Copyright (c) 2004, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + ProcDep.h + +Abstract: + + IPF specific Runtime Lib code. IPF has a SAL API that does not + exit on IA-32. Thus + +--*/ + +#ifndef _PROC_DEP_H_ +#define _PROC_DEP_H_ + +#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid) +#include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService) +#include "SalApi.h" + +EFI_STATUS +RegisterEsalFunction ( + IN UINT64 FunctionId, + IN EFI_GUID *ClassGuid, + IN SAL_INTERNAL_EXTENDED_SAL_PROC Function, + IN VOID *ModuleGlobal + ) +/*++ + +Routine Description: + + Register ESAL Class Function and it's asociated global. + This function is boot service only! + +Arguments: + FunctionId - ID of function to register + ClassGuid - GUID of function class + Function - Function to register under ClassGuid/FunctionId pair + ModuleGlobal - Module global for Function. + +Returns: + EFI_SUCCESS - If ClassGuid/FunctionId Function was registered. + +--*/ +; + +EFI_STATUS +RegisterEsalClass ( + IN EFI_GUID *ClassGuid, + IN VOID *ModuleGlobal, + ... + ) +/*++ + +Routine Description: + + Register ESAL Class and it's asociated global. + This function is boot service only! + +Arguments: + ClassGuid - GUID of function class + ModuleGlobal - Module global for Function. + .. - SAL_INTERNAL_EXTENDED_SAL_PROC and FunctionId pairs. NULL + indicates the end of the list. + +Returns: + EFI_SUCCESS - All members of ClassGuid registered + +--*/ +; + +SAL_RETURN_REGS +EfiCallEsalService ( + IN EFI_GUID *ClassGuid, + IN UINT64 FunctionId, + IN UINT64 Arg2, + IN UINT64 Arg3, + IN UINT64 Arg4, + IN UINT64 Arg5, + IN UINT64 Arg6, + IN UINT64 Arg7, + IN UINT64 Arg8 + ) +/*++ + +Routine Description: + + Call module that is not linked direclty to this module. This code is IP + relative and hides the binding issues of virtual or physical calling. The + function that gets dispatched has extra arguments that include the registered + module global and a boolean flag to indicate if the system is in virutal mode. + +Arguments: + ClassGuid - GUID of function + FunctionId - Function in ClassGuid to call + Arg2 - Argument 2 ClassGuid/FunctionId defined + Arg3 - Argument 3 ClassGuid/FunctionId defined + Arg4 - Argument 4 ClassGuid/FunctionId defined + Arg5 - Argument 5 ClassGuid/FunctionId defined + Arg6 - Argument 6 ClassGuid/FunctionId defined + Arg7 - Argument 7 ClassGuid/FunctionId defined + Arg8 - Argument 8 ClassGuid/FunctionId defined + +Returns: + Status of ClassGuid/FuncitonId + +--*/ +; + +#endif diff --git a/EDK/Foundation/Library/Dxe/Include/Ipf/SalDriverLib.h b/EDK/Foundation/Library/Dxe/Include/Ipf/SalDriverLib.h new file mode 100644 index 0000000..c294706 --- /dev/null +++ b/EDK/Foundation/Library/Dxe/Include/Ipf/SalDriverLib.h @@ -0,0 +1,1454 @@ +/*++ + +Copyright (c) 2004, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + SalDriverLib.h + +Abstract: + + SAL Driver Lib + +Revision History + +--*/ + +#ifndef _SAL_DRIVER_LIB_H_ +#define _SAL_DRIVER_LIB_H_ + +#include "Tiano.h" +#include "EfiDriverLib.h" +#include "SalApi.h" + +#include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService) +#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid) + +// +// Assembly Functions +// +SAL_RETURN_REGS +LibGetEsalPhyData ( + VOID + ) +/*++ + +Routine Description: + + Get Esal global data in physical mode. + +Arguments: + + None + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibGetEsalVirtData ( + VOID + ) +/*++ + +Routine Description: + + Get Esal global data in virtual mode. + +Arguments: + + None + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibSetEsalPhyData ( + IN VOID *Ptr, + IN UINT64 GP + ) +/*++ + +Routine Description: + + Set Esal global data in physical mode. + +Arguments: + + Ptr - Pointer to the data + GP - Global pointer + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibSetEsalVirtData ( + IN VOID *Ptr, + IN UINT64 GP + ) +/*++ + +Routine Description: + + Set Esal global data in virtual mode. + +Arguments: + + Ptr - Pointer to the data + GP - Global pointer + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibGetGlobalPhyData ( + VOID + ) +/*++ + +Routine Description: + + Get Esal global data in physical mode. + +Arguments: + + None + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibGetGlobalVirtData ( + VOID + ) +/*++ + +Routine Description: + + Get Esal global data in virtual mode. + +Arguments: + + None + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibSetGlobalPhyData ( + IN VOID *Ptr, + IN UINT64 GP + ) +/*++ + +Routine Description: + + Set Esal global data in physical mode. + +Arguments: + + Ptr - Pointer to the data + GP - Global pointer + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibSetGlobalVirtData ( + IN VOID *Ptr, + IN UINT64 GP + ) +/*++ + +Routine Description: + + Set Esal global data in virtual mode. + +Arguments: + + Ptr - Pointer to the data + GP - Global pointer + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +GetIrrData ( + VOID + ) +/*++ + +Routine Description: + + Get interrupt request register. + +Arguments: + + None + +Returns: + + Output regs + +--*/ +; + +VOID +PrepareApsForHandOverToOS ( + VOID + ) +/*++ + +Routine Description: + + Prepare AP info for hand over to OS. + +Arguments: + + None + +Returns: + + None + +--*/ +; + +VOID +HandOverApsToOS ( + IN UINT64 a1, + IN UINT64 a2, + IN UINT64 a3 + ) +/*++ + +Routine Description: + + Hand over AP info to OS. + +Arguments: + + a1 - Address to call into + + a2 - GP + + a3 - Undefined + +Returns: + + None + +--*/ +; + +SAL_RETURN_REGS +GetPsrData ( + VOID + ) +/*++ + +Routine Description: + + Get PSR register. + +Arguments: + + None + +Returns: + + Output regs. + +--*/ +; + +SAL_RETURN_REGS +GetProcIdData ( + VOID + ) +/*++ + +Routine Description: + + Get LID + +Arguments: + + None + +Returns: + + Output regs + +--*/ +; + +VOID +SwitchCpuStack ( + IN UINT64 NewBsp, + IN UINT64 OldBsp + ) +/*++ + +Routine Description: + + Switch BSP + +Arguments: + + NewBsp - New BSP index + OldBsp - Old BSP index + +Returns: + + None + +--*/ +; + +// +// SAL Reset Class +// +VOID +SalResetSystem ( + IN EFI_RESET_TYPE ResetType, + IN EFI_STATUS ResetStatus, + IN UINTN DataSize, + IN CHAR16 *ResetData + ) +/*++ + +Routine Description: + + Reset system + +Arguments: + + ResetType - Reset type + ResetStatus - Reset status + DataSize - Size of ResetData + ResetData - Description string + +Returns: + + None + +--*/ +; + +// +// PAL PROC Class +// +SAL_RETURN_REGS +SalPalProc ( + IN UINT64 Arg1, + IN UINT64 Arg2, + IN UINT64 Arg3, + IN UINT64 Arg4 + ) +/*++ + +Routine Description: + + Call pal proc. + +Arguments: + + Arg1 - Pal call index + Arg2 - First arg + Arg3 - Second arg + Arg4 - Third arg + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +SalRegisterNewPalEntry ( + IN BOOLEAN PhysicalPalAddress, + IN EFI_PHYSICAL_ADDRESS NewPalAddress + ) +/*++ + +Routine Description: + + Register Pal entry. + +Arguments: + + PhysicalPalAddress - The address is physical or virtual + NewPalAddress - New Pal entry address + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +SalGetPalEntryPointer ( + IN BOOLEAN PhysicalPalAddress + ) +/*++ + +Routine Description: + + Get Pal entry. + +Arguments: + + PhysicalPalAddress - The address is physical or virtual + +Returns: + + Output regs + +--*/ +; + +// +// SAL MTC Class +// +EFI_STATUS +SalGetNextHighMonotonicCount ( + OUT UINT32 *HighCount + ) +/*++ + +Routine Description: + + Get next high 32 bits of monotonic count. + +Arguments: + + HighCount - High 32 bits of monotonic count. + +Returns: + + Status code + +--*/ +; + +// +// SAL BASE Class +// +SAL_RETURN_REGS +SalProcSetVectors ( + IN UINT64 SalVectorType, + IN UINT64 PhyAddr1, + IN UINT64 Gp1, + IN UINT64 LengthCs1, + IN UINT64 PhyAddr2, + IN UINT64 Gp2, + IN UINT64 LengthCs2 + ) +/*++ + +Routine Description: + + Set vectors. + +Arguments: + + SalVectorType - Vector type + PhyAddr1 - OS MCA entry point + Gp1 - GP for OS MCA entry + LengthCs1 - Length of OS MCA + PhyAddr2 - OS INIT entry point + Gp2 - GP for OS Init entry + LengthCs2 - Length of OS INIT + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +SalProcMcRendez ( + VOID + ) +/*++ + +Routine Description: + + Mc rendezvous function. + +Arguments: + + None + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +SalProcMcSetParams ( + IN UINT64 ParamType, + IN UINT64 IntOrMem, + IN UINT64 IntOrMemVal, + IN UINT64 Timeout, + IN UINT64 McaOpt + ) +/*++ + +Routine Description: + + Set MCA parameters. + +Arguments: + + ParamType - Parameter type + IntOrMem - Interrupt or memory address + IntOrMemVal - Interrupt number or memory address value + Timeout - Time out value + McaOpt - Option for MCA + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +EsalProcGetVectors ( + IN UINT64 VectorType + ) +/*++ + +Routine Description: + + Get OS MCA vector. + +Arguments: + + VectorType - Vector type + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +EsalProcMcGetParams ( + IN UINT64 ParamInfoType + ) +/*++ + +Routine Description: + + Get MCA parameter. + +Arguments: + + ParamInfoType - Parameter info type + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +EsalProcMcGetMcParams ( + VOID + ) +/*++ + +Routine Description: + + Get MCA parameter. + +Arguments: + + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +EsalProcGetMcCheckinFlags ( + IN UINT64 ProcessorUnit + ) +/*++ + +Routine Description: + + Get process status. + +Arguments: + + ProcessorUnit - Processor Index + +Returns: + + Output regs + +--*/ +; + +// +// Sal Base Class enums +// +typedef enum { + McaVector, + BspInitVector, + BootRendezVector, + ApInitVector +} ESAL_GET_VECTOR_TYPE; + +// +// Sal RTC Class +// +EFI_STATUS +SalGetTime ( + OUT EFI_TIME *Time, + OUT EFI_TIME_CAPABILITIES *Capabilities + ) +/*++ + +Routine Description: + + Returns the current time and date information, and the time-keeping + capabilities of the hardware platform. + +Arguments: + + Time - A pointer to storage to receive a snapshot of the current time. + Capabilities - An optional pointer to a buffer to receive the real time clock device¡¯s + capabilities. + +Returns: + + Status code + +--*/ +; + +EFI_STATUS +SalSetTime ( + OUT EFI_TIME *Time + ) +/*++ + +Routine Description: + + Sets the current local time and date information. + +Arguments: + + Time - A pointer to the current time. + +Returns: + + Status code + +--*/ +; + +EFI_STATUS +SalGetWakeupTime ( + OUT BOOLEAN *Enabled, + OUT BOOLEAN *Pending, + OUT EFI_TIME *Time + ) +/*++ + +Routine Description: + + Returns the current wakeup alarm clock setting. + +Arguments: + + Enabled - Indicates if the alarm is currently enabled or disabled. + Pending - Indicates if the alarm signal is pending and requires acknowledgement. + Time - The current alarm setting. + +Returns: + + Status code + +--*/ +; + +EFI_STATUS +SalSetWakeupTime ( + IN BOOLEAN Enable, + IN EFI_TIME *Time + ) +/*++ + +Routine Description: + + Sets the system wakeup alarm clock time. + +Arguments: + + Enable - Enable or disable the wakeup alarm. + Time - If Enable is TRUE, the time to set the wakeup alarm for. + If Enable is FALSE, then this parameter is optional, and may be NULL. + +Returns: + + Status code + +--*/ +; + +SAL_RETURN_REGS +SalInitializeThreshold ( + IN VOID *ThresholdStruct, + IN UINT64 Count, + IN UINT64 Duration + ) +/*++ + +Routine Description: + + Init threshold structure. + +Arguments: + + ThresholdStruct - Threshold structure + Count - Threshold count + Duration - Duration + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +SalBumpThresholdCount ( + IN VOID *ThresholdStruct, + IN UINT64 Count, + IN UINT64 Duration + ) +/*++ + +Routine Description: + + Bump threshold count. + +Arguments: + + ThresholdStruct - Threshold structure + Count - Threshold count + Duration - Duration + +Returns: + + Output regs + +--*/ +; + +SAL_RETURN_REGS +SalGetThresholdCount ( + IN VOID *ThresholdStruct, + IN UINT64 Count, + IN UINT64 Duration + ) +/*++ + +Routine Description: + + Get threshold structure. + +Arguments: + + ThresholdStruct - Threshold structure + Count - Threshold count + Duration - Duration + +Returns: + + Output regs + +--*/ +; + +// +// Common Lib Function +// +EFI_STATUS +RegisterEsalFunction ( + IN UINT64 FunctionId, + IN EFI_GUID *ClassGuid, + IN SAL_INTERNAL_EXTENDED_SAL_PROC Function, + IN VOID *ModuleGlobal + ) +/*++ + +Routine Description: + + Register ESAL Class Function and it's asociated global. + This function is boot service only! + +Arguments: + FunctionId - ID of function to register + ClassGuid - GUID of function class + Function - Function to register under ClassGuid/FunctionId pair + ModuleGlobal - Module global for Function. + +Returns: + EFI_SUCCESS - If ClassGuid/FunctionId Function was registered. + +--*/ +; + +EFI_STATUS +EfiInitializeSalDriverLib ( + IN BOOLEAN Runtime + ) +/*++ + +Routine Description: + + Initialize Sal driver lib. + +Arguments: + Runtime - At runtime or not? + +Returns: + Status code + +--*/ +; + +// +// MCA PMI INIT Registeration Functions. +// +EFI_STATUS +LibRegisterMcaFunction ( + IN EFI_SAL_MCA_HANDLER McaHandler, + IN VOID *ModuleGlobal, + IN BOOLEAN MakeFirst, + IN BOOLEAN MakeLast + ) +/*++ + +Routine Description: + + Register MCA handler. + +Arguments: + McaHandler - MCA handler + ModuleGlobal - Module global for function + MakeFirst - Make it as first? + MakeLast - Make it as last? + +Returns: + Status code + +--*/ +; + +EFI_STATUS +LibRegisterPmiFunction ( + IN EFI_SAL_PMI_HANDLER PmiHandler, + IN VOID *ModuleGlobal, + IN BOOLEAN MakeFirst, + IN BOOLEAN MakeLast + ) +/*++ + +Routine Description: + + Register PMI handler. + +Arguments: + PmiHandler - PMI handler + ModuleGlobal - Module global for function + MakeFirst - Make it as first? + MakeLast - Make it as last? + +Returns: + Status code + +--*/ +; + +EFI_STATUS +LibRegisterInitFunction ( + IN EFI_SAL_INIT_HANDLER InitHandler, + IN VOID *ModuleGlobal, + IN BOOLEAN MakeFirst, + IN BOOLEAN MakeLast + ) +/*++ + +Routine Description: + + Register INIT handler. + +Arguments: + InitHandler - INIT handler + ModuleGlobal - Module global for function + MakeFirst - Make it as first? + MakeLast - Make it as last? + +Returns: + Status code + +--*/ +; + +// +// Base IO Class Functions +// +EFI_STATUS +ESalIoRead ( + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ) +/*++ + +Routine Description: + + Io read operation. + +Arguments: + + Width - Width of read operation + Address - Start IO address to read + Count - Read count + Buffer - Buffer to store result + +Returns: + + Status code + +--*/ +; + +EFI_STATUS +ESalIoWrite ( + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ) +/*++ + +Routine Description: + + Io write operation. + +Arguments: + + Width - Width of write operation + Address - Start IO address to write + Count - Write count + Buffer - Buffer to write to the address + +Returns: + + Status code + +--*/ +; + +EFI_STATUS +ESalMemRead ( + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ) +/*++ + +Routine Description: + Perform a Memory mapped IO read into Buffer. + +Arguments: + Width - Width of each read transaction. + Address - Memory mapped IO address to read + Count - Number of Width quanta to read + Buffer - Buffer to read data into. size is Width * Count + +Returns: + Status code + +--*/ +; + +EFI_STATUS +ESalMemWrite ( + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ) +/*++ + +Routine Description: + Perform a memory mapped IO write into Buffer. + +Arguments: + Width - Width of write transaction, and repeat operation to use + Address - IO address to write + Count - Number of times to write the IO address. + Buffer - Buffer to write data from. size is Width * Count + +Returns: + Status code + +--*/ +; + +// +// PCI Class Functions +// +SAL_RETURN_REGS +SalPCIConfigRead ( + IN UINT64 Address, + IN UINT64 Size + ) +/*++ + +Routine Description: + Pci config space read. + +Arguments: + Address - PCI address to read + Size - Size to read + +Returns: + Output regs + +--*/ +; + +SAL_RETURN_REGS +SalPCIConfigWrite ( + IN UINT64 Address, + IN UINT64 Size, + IN UINT64 Value + ) +/*++ + +Routine Description: + Pci config space write. + +Arguments: + Address - PCI address to write + Size - Size to write + Value - Value to write + +Returns: + Output regs + +--*/ +; + +// +// MP Class Functions +// +SAL_RETURN_REGS +LibMPAddCpuData ( + IN UINT64 CpuGlobalId, + IN BOOLEAN Enabled, + IN UINT64 PalCompatability + ) +/*++ + +Routine Description: + Add CPU data. + +Arguments: + CpuGlobalId - CPU ID + Enabled - Enabled or not + PalCompatability - Pal compatability + +Returns: + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibMPRemoveCpuData ( + IN UINT64 CpuGlobalId + ) +/*++ + +Routine Description: + Remove CPU data. + +Arguments: + CpuGlobalId - CPU ID + +Returns: + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibMPModifyCpuData ( + IN UINT64 CpuGlobalId, + IN BOOLEAN Enabled, + IN UINT64 PalCompatability + ) +/*++ + +Routine Description: + Modify CPU data. + +Arguments: + CpuGlobalId - CPU ID + Enabled - Enabled or not + PalCompatability - Pal compatability + +Returns: + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibMPGetCpuDataByID ( + IN UINT64 CpuGlobalId, + IN BOOLEAN IndexByEnabledCpu + ) +/*++ + +Routine Description: + Get CPU data. + +Arguments: + CpuGlobalId - CPU ID + IndexByEnabledCpu - Whether indexed by enabled CPU + +Returns: + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibMPGetCpuDataByIndex ( + IN UINT64 Index, + IN BOOLEAN IndexByEnabledCpu + ) +/*++ + +Routine Description: + Get CPU data. + +Arguments: + Index - CPU index + IndexByEnabledCpu - Whether indexed by enabled CPU + +Returns: + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibMPSendIpi ( + IN UINT64 ProcessorNumber, + IN UINT64 VectorNumber, + IN EFI_DELIVERY_MODE DeliveryMode, + IN BOOLEAN IRFlag + ) +/*++ + +Routine Description: + Send IPI. + +Arguments: + ProcessorNumber - Processor number + VectorNumber - Vector number + DeliveryMode - Delivery mode + IRFlag - Interrupt Redirection flag + +Returns: + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibMpCurrentProcessor ( + IN BOOLEAN IndexByEnabledCpu + ) +/*++ + +Routine Description: + Get current processor index. + +Arguments: + IndexByEnabledCpu - Whether indexed by enabled CPU + +Returns: + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibGetNumProcessors ( + VOID + ) +/*++ + +Routine Description: + Get number of processors. + +Arguments: + None + +Returns: + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibMpSaveMinStatePointer ( + IN UINT64 CpuGlobalId, + IN EFI_PHYSICAL_ADDRESS MinStatePointer + ) +/*++ + +Routine Description: + Register pointer to save min state. + +Arguments: + CpuGlobalId - CPU global ID + MinStatePointer - Pointer to save min state + +Returns: + Output regs + +--*/ +; + +SAL_RETURN_REGS +LibMpRestoreMinStatePointer ( + IN UINT64 CpuGlobalId + ) +/*++ + +Routine Description: + Restore pointer to save min state. + +Arguments: + CpuGlobalId - CPU global ID + +Returns: + Output regs + +--*/ +; + +// +// MCA Class Functions +// +EFI_STATUS +LibMcaGetStateInfo ( + IN UINT64 CpuId, + OUT EFI_PHYSICAL_ADDRESS *StateBufferPointer, + OUT UINT64 *RequiredStateBufferSize + ) +/*++ + +Routine Description: + MCA get state info. + +Arguments: + CpuId - CPU ID + StateBufferPointer - Pointer of state buffer + RequiredStateBufferSize - Size of required state buffer + +Returns: + Status code + +--*/ +; + +EFI_STATUS +LibMcaRegisterCpu ( + IN UINT64 CpuId, + IN EFI_PHYSICAL_ADDRESS StateBufferAddress + ) +/*++ + +Routine Description: + MCA register CPU state info. + +Arguments: + CpuId - CPU ID + StateBufferAddress - Pointer of state buffer + +Returns: + Status code + +--*/ +; + +// +// SAL ELOG Functions +// +EFI_STATUS +LibSalGetStateInfo ( + IN UINT64 McaType, + IN UINT8 *McaBuffer, + OUT UINTN *Size + ) +/*++ + +Routine Description: + Get state info. + +Arguments: + McaType - MCA type + McaBuffer - Info buffer provided by caller + Size - Size of info + +Returns: + Status code + +--*/ +; + +EFI_STATUS +LibSalGetStateInfoSize ( + IN UINT64 McaType, + OUT UINTN *Size + ) +/*++ + +Routine Description: + Get state info size. + +Arguments: + McaType - MCA type + Size - Size required + +Returns: + Status code + +--*/ +; + +EFI_STATUS +LibSalClearStateInfo ( + IN UINT64 McaType + ) +/*++ + +Routine Description: + Clear state info. + +Arguments: + McaType - MCA type + +Returns: + Status code + +--*/ +; + +EFI_STATUS +LibEsalGetStateBuffer ( + IN UINT64 McaType, + OUT UINT8 **McaBuffer, + OUT UINTN *Index + ) +/*++ + +Routine Description: + Get state buffer. + +Arguments: + McaType - MCA type + McaBuffer - MCA buffer + Index - CPU index + +Returns: + Status code + +--*/ +; + +EFI_STATUS +LibEsalSaveStateBuffer ( + IN UINT64 McaType + ) +/*++ + +Routine Description: + Save state buffer. + +Arguments: + McaType - MCA type + +Returns: + Status code + +--*/ +; + +#endif -- cgit v1.2.3