2ronwalf/** @file
2ronwalf Definition of Extended SAL Boot Service Protocol
2ronwalf
2ronwalf The Extended SAL Boot Service Protocol provides a mechanisms for platform specific
2ronwalf drivers to update the SAL System Table and register Extended SAL Procedures that are
2ronwalf callable in physical or virtual mode using the SAL calling convention.
2ronwalf
2ronwalf Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
2ronwalf This program and the accompanying materials
2ronwalf are licensed and made available under the terms and conditions of the BSD License
2ronwalf which accompanies this distribution. The full text of the license may be found at
2ronwalf http://opensource.org/licenses/bsd-license.php
2ronwalf
2ronwalf THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
2ronwalf WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
2ronwalf
2ronwalf**/
2ronwalf
2ronwalf#ifndef _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL_H_
2ronwalf#define _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL_H_
2ronwalf
2ronwalf#include <IndustryStandard/Sal.h>
2ronwalf
2ronwalf#define EXTENDED_SAL_BOOT_SERVICE_PROTOCOL_GUID \
2ronwalf { 0xde0ee9a4, 0x3c7a, 0x44f2, {0xb7, 0x8b, 0xe3, 0xcc, 0xd6, 0x9c, 0x3a, 0xf7 } }
2ronwalf
2ronwalftypedef struct _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL EXTENDED_SAL_BOOT_SERVICE_PROTOCOL;
2ronwalf
2ronwalf/**
2ronwalf Adds platform specific information to the to the header of the SAL System Table.
2ronwalf
2ronwalf @param This A pointer to the EXTENDED_SAL_BOOT_SERVICE_PROTOCOL instance.
2ronwalf @param SalAVersion Version of recovery SAL PEIM(s) in BCD format. Higher byte contains
2ronwalf the major revision and the lower byte contains the minor revision.
2ronwalf @param SalBVersion Version of DXE SAL Driver in BCD format. Higher byte contains
2ronwalf the major revision and the lower byte contains the minor revision.
2ronwalf @param OemId A pointer to a Null-terminated ASCII string that contains OEM unique string.
2ronwalf The string cannot be longer than 32 bytes in total length
2ronwalf @param ProductId A pointer to a Null-terminated ASCII string that uniquely identifies a family of
2ronwalf compatible products. The string cannot be longer than 32 bytes in total length.
3daenzerorama
3daenzerorama @retval EFI_SUCCESS The SAL System Table header was updated successfully.
2ronwalf @retval EFI_INVALID_PARAMETER OemId is NULL.
2ronwalf @retval EFI_INVALID_PARAMETER ProductId is NULL.
2ronwalf @retval EFI_INVALID_PARAMETER The length of OemId is greater than 32 characters.
2ronwalf @retval EFI_INVALID_PARAMETER The length of ProductId is greater than 32 characters.
2ronwalf
2ronwalf**/
2ronwalftypedef
2ronwalfEFI_STATUS
2ronwalf(EFIAPI *EXTENDED_SAL_ADD_SST_INFO)(
2ronwalf IN EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *This,
2ronwalf IN UINT16 SalAVersion,
2ronwalf IN UINT16 SalBVersion,
2ronwalf IN CHAR8 *OemId,
2ronwalf IN CHAR8 *ProductId
2ronwalf );
2ronwalf
2ronwalf/**
2ronwalf Adds an entry to the SAL System Table.
2ronwalf
2ronwalf This function adds the SAL System Table Entry specified by TableEntry and EntrySize
2ronwalf to the SAL System Table.
2ronwalf
2ronwalf @param This A pointer to the EXTENDED_SAL_BOOT_SERVICE_PROTOCOL instance.
2ronwalf @param TableEntry Pointer to a buffer containing a SAL System Table entry that is EntrySize bytes
2ronwalf in length. The first byte of the TableEntry describes the type of entry.
2ronwalf @param EntrySize The size, in bytes, of TableEntry.
2ronwalf
2ronwalf @retval EFI_SUCCESSThe SAL System Table was updated successfully.
2ronwalf @retval EFI_INVALID_PARAMETER TableEntry is NULL.
2ronwalf @retval EFI_INVALID_PARAMETER TableEntry specifies an invalid entry type.
2ronwalf @retval EFI_INVALID_PARAMETER EntrySize is not valid for this type of entry.
3daenzerorama
3daenzerorama**/
3daenzeroramatypedef
3daenzeroramaEFI_STATUS
3daenzerorama(EFIAPI *EXTENDED_SAL_ADD_SST_ENTRY)(
3daenzerorama IN EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *This,
3daenzerorama IN UINT8 *TableEntry,
3daenzerorama IN UINTN EntrySize
3daenzerorama );
3daenzerorama
3daenzerorama/**
2ronwalf Internal ESAL procedures.
3daenzerorama
3daenzerorama This is prototype of internal Extended SAL procedures, which is registerd by
3daenzerorama EXTENDED_SAL_REGISTER_INTERNAL_PROC service.
3daenzerorama
3daenzerorama @param FunctionId The Function ID associated with this Extended SAL Procedure.
3daenzerorama @param Arg2 Second argument to the Extended SAL procedure.
3daenzerorama @param Arg3 Third argument to the Extended SAL procedure.
3daenzerorama @param Arg4 Fourth argument to the Extended SAL procedure.
3daenzerorama @param Arg5 Fifth argument to the Extended SAL procedure.
3daenzerorama @param Arg6 Sixth argument to the Extended SAL procedure.
3daenzerorama @param Arg7 Seventh argument to the Extended SAL procedure.
3daenzerorama @param Arg8 Eighth argument to the Extended SAL procedure.
3daenzerorama @param VirtualMode TRUE if the Extended SAL Procedure is being invoked in virtual mode.
3daenzerorama FALSE if the Extended SAL Procedure is being invoked in physical mode.
3daenzerorama @param ModuleGlobal A pointer to the global context associated with this Extended SAL Procedure.
3daenzerorama
3daenzerorama @return The result returned from the specified Extended SAL Procedure
3daenzerorama
3daenzerorama**/
3daenzeroramatypedef
3daenzeroramaSAL_RETURN_REGS
3daenzerorama(EFIAPI *SAL_INTERNAL_EXTENDED_SAL_PROC)(
3daenzerorama IN UINT64 FunctionId,
3daenzerorama IN UINT64 Arg2,
3daenzerorama IN UINT64 Arg3,
3daenzerorama IN UINT64 Arg4,
3daenzerorama IN UINT64 Arg5,
3daenzerorama IN UINT64 Arg6,
3daenzerorama IN UINT64 Arg7,
3daenzerorama IN UINT64 Arg8,
3daenzerorama IN BOOLEAN VirtualMode,
3daenzerorama IN VOID *ModuleGlobal OPTIONAL
3daenzerorama );
3daenzerorama
3daenzerorama/**
3daenzerorama Registers an Extended SAL Procedure.
3daenzerorama
3daenzerorama The Extended SAL Procedure specified by InternalSalProc and named by ClassGuidLo,
3daenzerorama ClassGuidHi, and FunctionId is added to the set of available Extended SAL Procedures.
3daenzerorama
3daenzerorama @param This A pointer to the EXTENDED_SAL_BOOT_SERVICE_PROTOCOL instance.
3daenzerorama @param ClassGuidLo The lower 64-bits of the class GUID for the Extended SAL Procedure being added.
3daenzerorama Each class GUID contains one or more functions specified by a Function ID.
3daenzerorama @param ClassGuidHi The upper 64-bits of the class GUID for the Extended SAL Procedure being added.
3daenzerorama Each class GUID contains one or more functions specified by a Function ID.
3daenzerorama @param FunctionId The Function ID for the Extended SAL Procedure that is being added. This Function
3daenzerorama ID is a member of the Extended SAL Procedure class specified by ClassGuidLo
3daenzerorama and ClassGuidHi.
3daenzerorama @param InternalSalProc A pointer to the Extended SAL Procedure being added.
3daenzerorama @param PhysicalModuleGlobal Pointer to a module global structure. This is a physical mode pointer.
3daenzerorama This pointer is passed to the Extended SAL Procedure specified by ClassGuidLo,
2ronwalf ClassGuidHi, FunctionId, and InternalSalProc. If the system is in physical mode,
2ronwalf then this pointer is passed unmodified to InternalSalProc. If the system is in
2ronwalf virtual mode, then the virtual address associated with this pointer is passed to
2ronwalf InternalSalProc.
2ronwalf
2ronwalf @retval EFI_SUCCESS The Extended SAL Procedure was added.
2ronwalf @retval EFI_OUT_OF_RESOURCES There are not enough resources available to add the Extended SAL Procedure.
2ronwalf
2ronwalf**/
2ronwalftypedef
3daenzeroramaEFI_STATUS
2ronwalf(EFIAPI *EXTENDED_SAL_REGISTER_INTERNAL_PROC)(
2ronwalf IN EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *This,
2ronwalf IN UINT64 ClassGuidLo,
2ronwalf IN UINT64 ClassGuidHi,
2ronwalf IN UINT64 FunctionId,
2ronwalf IN SAL_INTERNAL_EXTENDED_SAL_PROC InternalSalProc,
2ronwalf IN VOID *PhysicalModuleGlobal OPTIONAL
2ronwalf );
2ronwalf
2ronwalf/**
2ronwalf Calls a previously registered Extended SAL Procedure.
2ronwalf
2ronwalf This function calls the Extended SAL Procedure specified by ClassGuidLo, ClassGuidHi,
2ronwalf and FunctionId. The set of previously registered Extended SAL Procedures is searched for a
2ronwalf matching ClassGuidLo, ClassGuidHi, and FunctionId. If a match is not found, then
2ronwalf EFI_SAL_NOT_IMPLEMENTED is returned.
2ronwalf
2ronwalf @param ClassGuidLo The lower 64-bits of the class GUID for the Extended SAL Procedure
2ronwalf that is being called.
2ronwalf @param ClassGuidHi The upper 64-bits of the class GUID for the Extended SAL Procedure
2ronwalf that is being called.
2ronwalf @param FunctionId Function ID for the Extended SAL Procedure being called.
2ronwalf @param Arg2 Second argument to the Extended SAL procedure.
2ronwalf @param Arg3 Third argument to the Extended SAL procedure.
2ronwalf @param Arg4 Fourth argument to the Extended SAL procedure.
2ronwalf @param Arg5 Fifth argument to the Extended SAL procedure.
2ronwalf @param Arg6 Sixth argument to the Extended SAL procedure.
2ronwalf @param Arg7 Seventh argument to the Extended SAL procedure.
2ronwalf @param Arg8 Eighth argument to the Extended SAL procedure.
2ronwalf
2ronwalf @retval EFI_SAL_NOT_IMPLEMENTED The Extended SAL Procedure specified by ClassGuidLo,
2ronwalf ClassGuidHi, and FunctionId has not been registered.
2ronwalf @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before virtual mappings
2ronwalf for the specified Extended SAL Procedure are available.
2ronwalf @retval Other The result returned from the specified Extended SAL Procedure
2ronwalf
2ronwalf**/
2ronwalftypedef
2ronwalfSAL_RETURN_REGS
2ronwalf(EFIAPI *EXTENDED_SAL_PROC)(
2ronwalf IN UINT64 ClassGuidLo,
2ronwalf IN UINT64 ClassGuidHi,
2ronwalf IN UINT64 FunctionId,
2ronwalf IN UINT64 Arg2,
2ronwalf IN UINT64 Arg3,
2ronwalf IN UINT64 Arg4,
2ronwalf IN UINT64 Arg5,
2ronwalf IN UINT64 Arg6,
2ronwalf IN UINT64 Arg7,
2ronwalf IN UINT64 Arg8
2ronwalf );
2ronwalf
2ronwalf///
2ronwalf/// The EXTENDED_SAL_BOOT_SERVICE_PROTOCOL provides a mechanisms for platform specific
2ronwalf/// drivers to update the SAL System Table and register Extended SAL Procedures that are
2ronwalf/// callable in physical or virtual mode using the SAL calling convention.
2ronwalf///
2ronwalfstruct _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL {
2ronwalf EXTENDED_SAL_ADD_SST_INFO AddSalSystemTableInfo;
2ronwalf EXTENDED_SAL_ADD_SST_ENTRY AddSalSystemTableEntry;
2ronwalf EXTENDED_SAL_REGISTER_INTERNAL_PROC RegisterExtendedSalProc;
2ronwalf EXTENDED_SAL_PROC ExtendedSalProc;
2ronwalf};
2ronwalf
2ronwalfextern EFI_GUID gEfiExtendedSalBootServiceProtocolGuid;
2ronwalf
2ronwalf#endif
2ronwalf