saldriverlib.h

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

H
1,455
字号
/*++

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

⌨️ 快捷键说明

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