From 863be5d010636e1115cf2f7afe743999f194e3a1 Mon Sep 17 00:00:00 2001 From: mdkinney Date: Fri, 10 Jun 2011 18:58:08 +0000 Subject: Add ESAL support libraries to MdePkg git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11784 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/DxePalLibEsal/DxePalLibEsal.c | 73 ++++++++++++++++++++++++++ MdePkg/Library/DxePalLibEsal/DxePalLibEsal.inf | 39 ++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 MdePkg/Library/DxePalLibEsal/DxePalLibEsal.c create mode 100644 MdePkg/Library/DxePalLibEsal/DxePalLibEsal.inf (limited to 'MdePkg/Library/DxePalLibEsal') diff --git a/MdePkg/Library/DxePalLibEsal/DxePalLibEsal.c b/MdePkg/Library/DxePalLibEsal/DxePalLibEsal.c new file mode 100644 index 0000000000..6500320456 --- /dev/null +++ b/MdePkg/Library/DxePalLibEsal/DxePalLibEsal.c @@ -0,0 +1,73 @@ +/** @file + PAL Library Class implementation built upon Extended SAL Procedures. + + Copyright (c) 2007 - 2011, 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. + +**/ + +#include + +#include + +#include +#include + +/** + Makes a PAL procedure call. + + This is a wrapper function to make a PAL procedure call. Based on the Index value, + this API will make static or stacked PAL call. Architected procedures may be designated + as required or optional. If a PAL procedure is specified as optional, a unique return + code of 0xFFFFFFFFFFFFFFFF is returned in the Status field of the PAL_CALL_RETURN structure. + This indicates that the procedure is not present in this PAL implementation. It is the + caller's responsibility to check for this return code after calling any optional PAL + procedure. No parameter checking is performed on the 4 input parameters, but there are + some common rules that the caller should follow when making a PAL call. Any address + passed to PAL as buffers for return parameters must be 8-byte aligned. Unaligned addresses + may cause undefined results. For those parameters defined as reserved or some fields + defined as reserved must be zero filled or the invalid argument return value may be + returned or undefined result may occur during the execution of the procedure. + This function is only available on IPF. + + @param Index - The PAL procedure Index number. + @param Arg2 - The 2nd parameter for PAL procedure calls. + @param Arg3 - The 3rd parameter for PAL procedure calls. + @param Arg4 - The 4th parameter for PAL procedure calls. + + @return structure returned from the PAL Call procedure, including the status and return value. + +**/ +PAL_CALL_RETURN +EFIAPI +PalCall ( + IN UINT64 Index, + IN UINT64 Arg2, + IN UINT64 Arg3, + IN UINT64 Arg4 + ) +{ + SAL_RETURN_REGS SalReturn; + PAL_CALL_RETURN *PalReturn; + + SalReturn = EsalCall ( + EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO, + EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI, + PalProcFunctionId, + Index, + Arg2, + Arg3, + Arg4, + 0, + 0, + 0 + ); + PalReturn = (PAL_CALL_RETURN *) (UINTN) (&SalReturn); + return *PalReturn; +} diff --git a/MdePkg/Library/DxePalLibEsal/DxePalLibEsal.inf b/MdePkg/Library/DxePalLibEsal/DxePalLibEsal.inf new file mode 100644 index 0000000000..4c0abbc4d6 --- /dev/null +++ b/MdePkg/Library/DxePalLibEsal/DxePalLibEsal.inf @@ -0,0 +1,39 @@ +## @file +# Instance of PAL Library Class using Extended SAL functions +# +# Copyright (c) 2007 - 2011, 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. +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = DxePalLibEsal + FILE_GUID = 8BA65DE3-39E1-4afd-A8FE-7DD0BAFEFCC0 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = PalLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IPF +# + +[Sources.IPF] + DxePalLibEsal.c + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + ExtendedSalLib + +[Depex] + gEfiExtendedSalPalServicesProtocolGuid -- cgit v1.2.3