saldriverlib.h

来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· C头文件 代码 · 共 1,455 行 · 第 1/2 页

H
1,455
字号
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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?