From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: eric.jin@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Thu, 13 Jun 2019 01:05:08 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2019 01:05:05 -0700 X-ExtLoop1: 1 Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 13 Jun 2019 01:05:04 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 13 Jun 2019 01:05:04 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 13 Jun 2019 01:05:03 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.83]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.225]) with mapi id 14.03.0439.000; Thu, 13 Jun 2019 16:05:01 +0800 From: "Eric Jin" To: Supreeth Venkatesh , "devel@edk2.groups.io" CC: "Jin, Eric" Subject: Re: [edk2-test][PATCH v1 5/5] EasLib: Remove files required for building Ipf Thread-Topic: [edk2-test][PATCH v1 5/5] EasLib: Remove files required for building Ipf Thread-Index: AQHVIV5/7YlBTVw9B0yfyurZlvFJkqaZOMng Date: Thu, 13 Jun 2019 08:05:00 +0000 Message-ID: References: <20190612203541.2283-1-supreeth.venkatesh@arm.com> <20190612203541.2283-5-supreeth.venkatesh@arm.com> In-Reply-To: <20190612203541.2283-5-supreeth.venkatesh@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.jin@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Supreeth, The serial patch 1- 5 is good to me. Could you add one patch to remove source and header files required for buil= ding library from SctPkg/Library/SctLib/SctLib.inf ? [sources.ipf] Ipf/SctLibPlat.h Ipf/initplat.c Ipf/salpal.c Ipf/libsalpal.h Math.c Best Regards Eric -----Original Message----- From: Supreeth Venkatesh =20 Sent: Thursday, June 13, 2019 4:36 AM To: devel@edk2.groups.io Cc: Supreeth Venkatesh ; Jin, Eric Subject: [edk2-test][PATCH v1 5/5] EasLib: Remove files required for buildi= ng Ipf Remove all files required for building Ipf Eas library as edk2 (edk2-stable201905) has removed IPF support. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Supreeth Venkatesh --- .../Framework/ENTS/EasLib/Ipf/EntsLibPlat.h | 55 -- .../SCT/Framework/ENTS/EasLib/Ipf/InitPlat.c | 54 -- .../SCT/Framework/= ENTS/EasLib/Ipf/LibSalPal.h | 182 ----- .../SCT/Framework/ENTS/EasLib/Ipf/PalApi.h | 137 ---- .../SCT/Framework/ENTS/EasLib/Ipf/SalApi.h | 728 ------------------ .../SCT/Framework/ENTS/EasLib/Ipf/SalPal.c | 369 --------- 6 files changed, 1525 deletions(-) delete mode 100644 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/E= asLib/Ipf/EntsLibPlat.h delete mode 100644 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/E= asLib/Ipf/InitPlat.c delete mode 100644 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/E= asLib/Ipf/LibSalPal.h delete mode 100644 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/E= asLib/Ipf/PalApi.h delete mode 100644 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/E= asLib/Ipf/SalApi.h delete mode 100644 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/E= asLib/Ipf/SalPal.c diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/I= pf/EntsLibPlat.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/Ea= sLib/Ipf/EntsLibPlat.h deleted file mode 100644 index f0060614..00000000 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Ipf/Ents= LibPlat.h +++ /dev/null @@ -1,55 +0,0 @@ -/** @file - - Copyright 2006 - 2010 Unified EFI, Inc.
- Copyright (c) 2010, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ -/*++ - -Module Name: - - EntsLibPlat.h - -Abstract: - - IPF specific defines - ---*/ - -#ifndef _EFI_LIB_PLAT_H -#define _EFI_LIB_PLAT_H - -#define MIN_ALIGNMENT_SIZE 8 - -VOID -EntsInitializeLibPlatform ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -/*++ - -Routine Description: - - Initialize platform. - -Arguments: - - ImageHandle - The image handle. - SystemTable - The system table. - -Returns: - - None. - ---*/ -; - -#endif diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/I= pf/InitPlat.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLi= b/Ipf/InitPlat.c deleted file mode 100644 index f8888d62..00000000 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Ipf/Init= Plat.c +++ /dev/null @@ -1,54 +0,0 @@ -/** @file - - Copyright 2006 - 2010 Unified EFI, Inc.
- Copyright (c) 2010, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ -/*++ - -Module Name: - - InitPlat.c - -Abstract: - - Functions to make SAL and PAL proc calls - ---*/ - -#include "Efi.h" -#include "EntsLibPlat.h" -#include "LibSalPal.h" - -VOID -EntsInitializeLibPlatform ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -/*++ - -Routine Description: - - Initialize platform. - -Arguments: - - ImageHandle - The image handle. - SystemTable - The system table. - -Returns: - - None. - ---*/ -{ - LibInitSalAndPalProc (); -} diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/I= pf/LibSalPal.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasL= ib/Ipf/LibSalPal.h deleted file mode 100644 index 78d96d59..00000000 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Ipf/LibS= alPal.h +++ /dev/null @@ -1,182 +0,0 @@ -/** @file - - Copyright 2006 - 2010 Unified EFI, Inc.
- Copyright (c) 2010, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ -/*++ - -Module Name: - - LibSalPal.h - -Abstract: - - Function prototype definitions. - ---*/ - -#ifndef _EFI_LIB_SAL_PAL_H_ -#define _EFI_LIB_SAL_PAL_H_ - -#include "PalApi.h" -#include "SalApi.h" - -typedef PAL_RETURN_REGS (EFIAPI *PAL_PROC) (IN UINT64 FunctionId, IN UINT6= 4 Arg2, IN UINT64 Arg3, IN UINT64 Arg4); - -EFI_STATUS -LibInitSalAndPalProc ( - VOID - ) -/*++ - -Routine Description: - - Initialize SAL and PAL procedure calling. - -Arguments: - - None - -Returns: - - EFI_SUCCESS - Always return success. - ---*/ -; - -EFI_STATUS -LibGetSalVersionInfo ( - IN OUT UINT16 *SalSpecRev, - IN OUT UINT16 *SalARev, - IN OUT UINT16 *SalBRev - ) -/*++ - -Routine Description: - - Get SAL version infomation. - -Arguments: - - SalSpecRev - SAL Spec reversion. - SalARev - SAL A reversion. - SalBRev - SAL B reversion. - -Returns: - - EFI_UNSUPPORTED - mSalSystemTable is NULL. - EFI_SUCCESS - Operation succeeded. - ---*/ -; - -EFI_STATUS -LibGetSalIoPortMapping ( - OUT UINT64 *IoPortMapping - ) -/*++ - -Routine Description: - - Get the IO Port Map from the SAL System Table. - -Arguments: - - IoPortMapping - Pointer to receive IO port mapping address. - -Returns: - - EFI_UNSUPPORTED - mSalSystemTable is NULL. - EFI_SUCCESS - Operation succeeded. - ---*/ -; - -EFI_STATUS -LibGetSalIpiBlock ( - OUT UINT64 *IpiBlock - ) -/*++ - -Routine Description: - - Get the IPI block from the SAL system table - -Arguments: - - IpiBlock - Pointer to receive IPI block address. - -Returns: - - EFI_UNSUPPORTED - SalMemDesc is NULL. - EFI_SUCCESS - Operation succeeded. - ---*/ -; - -EFI_STATUS -LibGetSalWakeupVector ( - OUT UINT64 *WakeVector - ) -/*++ - -Routine Description: - - Get the wakeup vector from the SAL system table - -Arguments: - - WakeVector - Pointer to receive wakeup vector. - -Returns: - - EFI_UNSUPPORTED - Cannot find wakeup decriptor. - EFI_SUCCESS - Operation succeeded. - ---*/ -; - -VOID * -LibSearchSalSystemTable ( - IN UINT8 EntryType - ) -/*++ - -Routine Description: - - Search SAL system table. - -Arguments: - - EntryType - SAL entry type. - -Returns: - - None. - ---*/ -; - -SAL_RETURN_REGS -LibSalProc ( - IN UINT64 Arg1, - IN UINT64 Arg2, - IN UINT64 Arg3, - IN UINT64 Arg4, - IN UINT64 Arg5, - IN UINT64 Arg6, - IN UINT64 Arg7, - IN UINT64 Arg8 - ) -; - -#endif diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/I= pf/PalApi.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/= Ipf/PalApi.h deleted file mode 100644 index 855983bd..00000000 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Ipf/PalA= pi.h +++ /dev/null @@ -1,137 +0,0 @@ -/** @file - - Copyright 2006 - 2010 Unified EFI, Inc.
- Copyright (c) 2010, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ -/*++ -Module Name: - - PalApi.h - -Abstract: - - Main PAL API's defined in PAL specification.=20 - - -Revision History: - ---*/ - -#ifndef _PALPROC_H -#define _PALPROC_H - -//#include "Tiano.h" - -#define PAL_CACHE_FLUSH 0x0001 -#define PAL_CACHE_INFO 0x0002 -#define PAL_CACHE_INIT 0x0003 -#define PAL_CACHE_SUMMARY 0x0004 -#define PAL_MEM_ATTRIB 0x0005 -#define PAL_PTCE_INFO 0x0006 -#define PAL_VM_INFO 0x0007 -#define PAL_VM_SUMMARY 0x0008 -#define PAL_BUS_GET_FEATURES 0x0009 -#define PAL_BUS_SET_FEATURES 0x000a -#define PAL_DEBUG_INFO 0x000b -#define PAL_FIXED_ADDR 0x000c -#define PAL_FREQ_BASE 0x000d -#define PAL_FREQ_RATIOS 0x000e -#define PAL_PERF_MON_INFO 0x000f -#define PAL_PLATFORM_ADDR 0x0010 -#define PAL_PROC_GET_FEATURES 0x0011 -#define PAL_PROC_SET_FEATURES 0x0012 -#define PAL_RSE_INFO 0x0013 -#define PAL_VERSION 0x0014 - -#define PAL_MC_CLEAR_LOG 0x0015 -#define PAL_MC_DRAIN 0x0016 -#define PAL_MC_EXPECTED 0x0017 -#define PAL_MC_DYNAMIC_STATE 0x0018 -#define PAL_MC_ERROR_INFO 0x0019 -#define PAL_MC_RESUME 0x001a -#define PAL_MC_REGISTER_MEM 0x001b -#define PAL_HALT 0x001c -#define PAL_HALT_LIGHT 0x001d -#define PAL_COPY_INFO 0x001e -#define PAL_SHUTDOWN 0x002c -#define PAL_AUTH 0x0209 -#define PAL_SINGL_DISPERSAL 0x0226 // dec. 550 -#define PAL_HALT_INFO 0x0101 -#define PAL_CACHE_LINE_INIT 0x001f -#define PAL_PMI_ENTRYPOINT 0x0020 -#define PAL_ENTER_IA_32_ENV 0x0021 -#define PAL_VM_PAGE_SIZE 0x0022 -#define PAL_MEM_FOR_TEST 0x0025 -#define PAL_CACHE_PROT_INFO 0x0026 - -#define PAL_COPY_PAL 0x0100 -#define PAL_CACHE_READ 0x0103 -#define PAL_CACHE_WRITE 0x0104 -#define PAL_TEST_PROC 0x0102 - -#define PAL_DEBUG_FEATURE 0x0063 // vp1 -typedef UINT64 EFI_PAL_STATUS; - -// -// Return values from PAL -// -typedef struct { - EFI_PAL_STATUS Status; // register r8 - UINT64 r9; - UINT64 r10; - UINT64 r11; -} PAL_RETURN_REGS; - -// -// PAL equates for other parameters. -// -#define PAL_SUCCESS 0x0 -#define PAL_CALL_ERROR 0xfffffffffffffffd -#define PAL_CALL_UNIMPLEMENTED 0xffffffffffffffff -#define PAL_CACHE_TYPE_I 0x1 -#define PAL_CACHE_TYPE_D 0x2 -#define PAL_CACHE_TYPE_I_AND_D 0x3 -#define PAL_CACHE_NO_INT 0x0 -#define PAL_CACHE_INT 0x2 -// -// #define PAL_CACHE_PLAT_ACK 0x4 -// -#define PAL_CACHE_NO_PLAT_ACK 0x0 -#define PAL_CACHE_INVALIDATE 0x1 -#define PAL_CACHE_NO_INVALIDATE 0x0 -#define PAL_CACHE_ALL_LEVELS - 0x1 - -#define PAL_FEATURE_ENABLE 0x1 -#define PAL_ENABLE_BERR_BIT 63 -#define PAL_ENABLE_MCA_BINIT_BIT 61 -#define PAL_ENABLE_CMCI_MCA_BIT 60 -#define PAL_CACHE_DISABLE_BIT 59 -#define PAL_DISABLE_COHERENCY_BIT 58 - -#define PAL_DIS_BUS_DATA_ERR_CHECK_BIT 63 -#define PAL_DIS_BUS_ADDR_ERR_CHECK_BIT 61 -#define PAL_DIS_BUS_INIT_EVENT_SIGNAL_BIT 60 -#define PAL_DIS_BUS_REQ_ERR_SIGNAL_BIT 58 -#define PAL_DIS_BUS_REQ_INT_ERR_SIGNAL_BIT 57 -#define PAL_DIS_BUS_REQ_ERR_CHECK_BIT 56 -#define PAL_DIS_BUS_RESP_ERR_CHECK_BIT 55 - -#define PAL_COPY_BSP_TOKEN 0x0 -#define PAL_COPY_AP_TOKEN 0x1 - -#define PAL_CODE_TOKEN 0x0 -#define PAL_IA32EMU_CODE_TOKEN 0x1 - -#define PAL_INTERRUPT_BLOCK_TOKEN 0x0 -#define PAL_IO_BLOCK_TOKEN 0x1 - -#endif diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/I= pf/SalApi.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/= Ipf/SalApi.h deleted file mode 100644 index e6adbbcf..00000000 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Ipf/SalA= pi.h +++ /dev/null @@ -1,728 +0,0 @@ -/** @file - - Copyright 2006 - 2010 Unified EFI, Inc.
- Copyright (c) 2010, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ -/*++ -Module Name: - - SalApi.h - -Abstract: - - Main SAL API's defined in SAL 3.0 specification.=20 - - -Revision History: - ---*/ - -#ifndef _SAL_API_H_ -#define _SAL_API_H_ - -typedef UINTN EFI_SAL_STATUS; - -// -// EFI_SAL_STATUS defines -// -#define EFI_SAL_SUCCESS ((EFI_SAL_STATUS) 0) -#define EFI_SAL_MORE_RECORDS ((EFI_SAL_STATUS) 3) -#define EFI_SAL_NOT_IMPLEMENTED ((EFI_SAL_STATUS) - 1) -#define EFI_SAL_INVALID_ARGUMENT ((EFI_SAL_STATUS) - 2) -#define EFI_SAL_ERROR ((EFI_SAL_STATUS) - 3) -#define EFI_SAL_VIRTUAL_ADDRESS_ERROR ((EFI_SAL_STATUS) - 4) -#define EFI_SAL_NO_INFORMATION ((EFI_SAL_STATUS) - 5) -#define EFI_SAL_NOT_ENOUGH_SCRATCH ((EFI_SAL_STATUS) - 9) - -// -// Delivery Mode of IPF CPU. -// -typedef enum { - INT, - MPreserved1, - PMI, - MPreserved2, - NMI, - INIT, - MPreserved3, - ExtINT -} EFI_DELIVERY_MODE; - -// -// Return values from SAL -// -typedef struct { - EFI_SAL_STATUS Status; // register r8 - UINTN r9; - UINTN r10; - UINTN r11; -} SAL_RETURN_REGS; - -typedef SAL_RETURN_REGS (EFIAPI *SAL_PROC) - ( - IN UINT64 FunctionId, - IN UINT64 Arg2, - IN UINT64 Arg3, - IN UINT64 Arg4, - IN UINT64 Arg5, - IN UINT64 Arg6, - IN UINT64 Arg7, - IN UINT64 Arg8 - ); - -// -// SAL Procedure FunctionId definition -// -#define EFI_SAL_SET_VECTORS 0x01000000 -#define EFI_SAL_GET_STATE_INFO 0x01000001 -#define EFI_SAL_GET_STATE_INFO_SIZE 0x01000002 -#define EFI_SAL_CLEAR_STATE_INFO 0x01000003 -#define EFI_SAL_MC_RENDEZ 0x01000004 -#define EFI_SAL_MC_SET_PARAMS 0x01000005 -#define EFI_SAL_REGISTER_PHYSICAL_ADDR 0x01000006 -#define EFI_SAL_CACHE_FLUSH 0x01000008 -#define EFI_SAL_CACHE_INIT 0x01000009 -#define EFI_SAL_PCI_CONFIG_READ 0x01000010 -#define EFI_SAL_PCI_CONFIG_WRITE 0x01000011 -#define EFI_SAL_FREQ_BASE 0x01000012 -#define EFI_SAL_UPDATE_PAL 0x01000020 - -#define EFI_SAL_FUNCTION_ID_MASK 0x0000ffff -#define EFI_SAL_MAX_SAL_FUNCTION_ID 0x00000021 - -// -// SAL Procedure parameter definitions -// Not much point in using typedefs or enums because all params -// are UI= NT64 and the entry point is common -// -// EFI_SAL_SET_VECTORS -// -#define EFI_SAL_SET_MCA_VECTOR 0x0 -#define EFI_SAL_SET_INIT_VECTOR 0x1 -#define EFI_SAL_SET_BOOT_RENDEZ_VECTOR 0x2 - -typedef struct { - UINT64 Length : 32; - UINT64 ChecksumValid : 1; - UINT64 Reserved1 : 7; - UINT64 ByteChecksum : 8; - UINT64 Reserved2 : 16; -} SAL_SET_VECTORS_CS_N; - -// -// EFI_SAL_GET_STATE_INFO, EFI_SAL_GET_STATE_INFO_SIZE, -// EFI_SAL_CLEAR_= STATE_INFO -// -#define EFI_SAL_MCA_STATE_INFO 0x0 -#define EFI_SAL_INIT_S= TATE_INFO 0x1 -#define EFI_SAL_CMC_STATE_INFO 0x2 -#define EFI_SAL_CP_STATE_INFO 0x3 - -// -// EFI_SAL_MC_SET_PARAMS -// -#define EFI_SAL_MC_SET_RENDEZ_PARAM 0x1 -#define EFI_SAL_MC_SET_WAKEUP_PAR= AM 0x2 -#define EFI_SAL_MC_SET_CPE_PARAM 0x3 - -#define EFI_SAL_MC_SET_INTR_PARAM 0x1 -#define EFI_SAL_MC_SET_MEM_PARAM 0x2 - -// -// EFI_SAL_REGISTER_PAL_PHYSICAL_ADDR -// -#define EFI_SAL_REGISTER_PAL_ADDR 0x0 - -// -// EFI_SAL_CACHE_FLUSH -// -#define EFI_SAL_FLUSH_I_CACHE 0x01 -#define EFI_SAL_FLUSH_D_CACHE 0x02 -#define EFI_SAL_FLUSH_BOTH_CACHE 0x03 -#define EFI_SAL_FLUSH_MAKE_COHERENT 0x04 - -// -// EFI_SAL_PCI_CONFIG_READ, EFI_SAL_PCI_CONFIG_WRITE -// -#define EFI_SAL_PCI_CONFIG_ONE_BYTE 0x1 -#define EFI_SAL_PCI_CONFIG_TWO_BYTES 0x2 -#define EFI_SAL_PCI_CONFIG_FOUR= _BYTES 0x4 - -typedef struct { - UINT64 Register : 8; - UINT64 Function : 3; - UINT64 Device : 5; - UINT64 Bus : 8; - UINT64 Segment : 8; - UINT64 Reserved : 32; -} SAL_PCI_ADDRESS; - -// -// EFI_SAL_FREQ_BASE -// -#define EFI_SAL_CPU_INPUT_FREQ_BASE 0x0 -#define EFI_SAL_PLATFORM_IT_FREQ_BASE 0x1 -#define EFI_SAL_PLATFORM_RTC_FREQ_BASE 0x2 - -// -// EFI_SAL_UPDATE_PAL -// -#define EFI_SAL_UPDATE_BAD_PAL_VERSION ((UINT64) -1) -#define EFI_SAL_UPDATE_PAL_AUTH_FAIL ((UINT64) -2) -#define EFI_SAL_UPDATE_PAL_BAD_TYPE ((UINT64) -3) -#define EFI_SAL_UPDATE_PAL_READONLY ((UINT64) -4) -#define EFI_SAL_UPDATE_PAL_WRITE_FAIL ((UINT64) -10) -#define EFI_SAL_UPDATE_PAL_ERASE_FAIL ((UINT64) -11) -#define EFI_SAL_UPDATE_PAL_READ_FAIL ((UINT64) -12) -#define EFI_SAL_UPDATE_PAL_CANT_FIT ((UINT64) -13) - -typedef struct { - UINT32 Size; - UINT32 MmddyyyyDate; - UINT16 Version; - UINT8 Type; - UINT8 Reserved[5]; - UINT64 FwVendorId; -} SAL_UPDATE_PAL_DATA_BLOCK; - -typedef struct _SAL_UPDATE_PAL_INFO_BLOCK { - struct _SAL_UPDATE_PAL_INFO_BLOCK *Next; - struct SAL_UPDATE_PAL_DATA_BLOCK *DataBlock; - UINT8 StoreChecksum; - UINT8 Reserved[15]; -} SAL_UPDATE_PAL_INFO_BLOCK; - -// -// SAL System Table Definitions -// -#pragma pack(1) -typedef struct { - UINT32 Signature; - UINT32 Length; - UINT16 SalRevision; - UINT16 EntryCount; - UINT8 CheckSum; - UINT8 Reserved[7]; - UINT16 SalAVersion; - UINT16 SalBVersion; - UINT8 OemId[32]; - UINT8 ProductId[32]; - UINT8 Reserved2[8]; -} SAL_SYSTEM_TABLE_HEADER; -#pragma pack() - -#define EFI_SAL_ST_HEADER_SIGNATURE "SST_" -#define EFI_SAL_REVISION 0x0300 -// -// SAL System Types -// -#define EFI_SAL_ST_ENTRY_POINT 0 -#define EFI_SAL_ST_MEMORY_DESCRIPTOR 1 -#define EFI_SAL_ST_PLATFORM_FEATU= RES 2 -#define EFI_SAL_ST_TR_USAGE 3 -#define EFI_SAL_ST_PTC 4 -#define EFI_SAL_ST_AP_WAKEUP 5 - -#pragma pack(1) -typedef struct { - UINT8 Type; // Type =3D=3D 0 - UINT8 Reserved[7]; - UINT64 PalProcEntry; - UINT64 SalProcEntry; - UINT64 SalGlobalDataPointer; - UINT64 Reserved2[2]; -} SAL_ST_ENTRY_POINT_DESCRIPTOR; - -// -// Not needed for Itanium-based OS boot -// -typedef struct { - UINT8 Type; // Type =3D=3D 1 - UINT8 NeedVirtualRegistration; - UINT8 MemoryAttributes; - UINT8 PageAccessRights; - UINT8 SupportedAttributes; - UINT8 Reserved; - UINT8 MemoryType; - UINT8 MemoryUsage; - UINT64 PhysicalMemoryAddress; - UINT32 Length; - UINT32 Reserved1; - UINT64 OemReserved; -} SAL_ST_MEMORY_DESCRIPTOR_ENTRY; - -#pragma pack() -// -// Memory Attributes -// -#define SAL_MDT_ATTRIB_WB 0x00 -// -// #define SAL_MDT_ATTRIB_UC 0x02 -// -#define SAL_MDT_ATTRIB_UC 0x04 -#define SAL_MDT_ATTRIB_UCE 0x05 -#define SAL_MDT_ATTRIB_WC 0x06 - -// -// Supported memory Attributes -// -#define SAL_MDT_SUPPORT_WB 0x1 -#define SAL_MDT_SUPPORT_UC 0x2 -#define SAL_MDT_SUPPORT_UCE 0x4 -#define SAL_MDT_SUPPORT_WC 0x8 - -// -// Virtual address registration -// -#define SAL_MDT_NO_VA 0x00 -#define SAL_MDT_NEED_VA 0x01 -// -// MemoryType info -// -#define SAL_REGULAR_MEMORY 0x0000 -#define SAL_MMIO_MAPPING 0x0001 -#define SAL_SAPIC_IPI_BLOCK 0x0002 -#define SAL_IO_PORT_MAPPING 0x0003 -#define SAL_FIRMWARE_MEMORY 0x0004 -#define SAL_BLACK_HOLE 0x000A -// -// Memory Usage info -// -#define SAL_MDT_USAGE_UNSPECIFIED 0x00 -#define SAL_PAL_CODE 0x01 -#define SAL_BOOTSERVICE_CODE 0x02 -#define SAL_BOOTSERVICE_DATA 0x03 -#define SAL_RUNTIMESERVICE_CODE 0x04 -#define SAL_RUNTIMESERVICE_DATA 0x05 -#define SAL_IA32_OPTIONROM 0x06 -#define SAL_IA32_SYSTEMROM 0x07 -#define SAL_PMI_CODE 0x0a -#define SAL_PMI_DATA 0x0b - -#pragma pack(1) -typedef struct { - UINT8 Type; // Type =3D=3D 2 - UINT8 PlatformFeatures; - UINT8 Reserved[14]; -} SAL_ST_PLATFORM_FEATURES; -#pragma pack() - -#define SAL_PLAT_FEAT_BUS_LOCK 0x01 -#define SAL_PLAT_FEAT_PLAT_IPI_HINT 0x02 -#define SAL_PLAT_FEAT_PROC_IPI_H= INT 0x04 - -#pragma pack(1) -typedef struct { - UINT8 Type; // Type =3D=3D 3 - UINT8 TRType; - UINT8 TRNumber; - UINT8 Reserved[5]; - UINT64 VirtualAddress; - UINT64 EncodedPageSize; - UINT64 Reserved1; -} SAL_ST_TR_DECRIPTOR; -#pragma pack() - -#define EFI_SAL_ST_TR_USAGE_INSTRUCTION 00 -#define EFI_SAL_ST_TR_USAGE_DATA 01 - -#pragma pack(1) -typedef struct { - UINT64 NumberOfProcessors; - UINT64 LocalIDRegister; -} SAL_COHERENCE_DOMAIN_INFO; -#pragma pack() - -#pragma pack(1) -typedef struct { - UINT8 Type; // Type =3D=3D 4 - UINT8 Reserved[3]; - UINT32 NumberOfDomains; - SAL_COHERENCE_DOMAIN_INFO *DomainInformation; -} SAL_ST_CACHE_COHERENCE_= DECRIPTOR; -#pragma pack() - -#pragma pack(1) -typedef struct { - UINT8 Type; // Type =3D=3D 5 - UINT8 WakeUpType; - UINT8 Reserved[6]; - UINT64 ExternalInterruptVector; -} SAL_ST_AP_WAKEUP_DECRIPTOR; -#pragma pack() -// -// FIT Entry -// -#define EFI_SAL_FIT_ENTRY_PTR (0x100000000 - 32) // 4GB - 24 -#define EFI_SAL_FIT_PALA_ENTRY (0x100000000 - 48) // 4GB - 32 -#define EFI_SAL_FIT_PALB_TYPE 01 - -typedef struct { - UINT64 Address; - UINT8 Size[3]; - UINT8 Reserved; - UINT16 Revision; - UINT8 Type : 7; - UINT8 CheckSumValid : 1; - UINT8 CheckSum; -} EFI_SAL_FIT_ENTRY; - -// -// SAL Common Record Header -// -typedef struct { - UINT16 Length; - UINT8 Data[1024]; -} SAL_OEM_DATA; - -typedef struct { - UINT8 Seconds; - UINT8 Minutes; - UINT8 Hours; - UINT8 Reserved; - UINT8 Day; - UINT8 Month; - UINT8 Year; - UINT8 Century; -} SAL_TIME_STAMP; - -typedef struct { - UINT64 RecordId; - UINT16 Revision; - UINT8 ErrorSeverity; - UINT8 ValidationBits; - UINT32 RecordLength; - SAL_TIME_STAMP TimeStamp; - UINT8 OemPlatformId[16]; -} SAL_RECORD_HEADER; - -typedef struct { - EFI_GUID Guid; - UINT16 Revision; - UINT8 ErrorRecoveryInfo; - UINT8 Reserved; - UINT32 SectionLength; -} SAL_SEC_HEADER; - -// -// SAL Processor Record -// -#define SAL_PROCESSOR_ERROR_RECORD_INFO \ - { \ - 0xe429faf1, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, = 0x81} \ - } - -#define CHECK_INFO_VALID_BIT_MASK 0x1 -#define REQUESTOR_ID_VALID_BIT_MASK 0x2 -#define RESPONDER_ID_VALID_BIT_MA= SK 0x4 -#define TARGER_ID_VALID_BIT_MASK 0x8 -#define PRECISE_IP_VALID_BIT_MASK 0x10 - -typedef struct { - UINT64 InfoValid : 1; - UINT64 ReqValid : 1; - UINT64 RespValid : 1; - UINT64 TargetValid : 1; - UINT64 IpValid : 1; - UINT64 Reserved : 59; - UINT64 Info; - UINT64 Req; - UINT64 Resp; - UINT64 Target; - UINT64 Ip; -} MOD_ERROR_INFO; - -typedef struct { - UINT8 CpuidInfo[40]; - UINT8 Reserved; -} CPUID_INFO; - -typedef struct { - UINT64 FrLow; - UINT64 FrHigh; -} FR_STRUCT; - -#define MIN_STATE_VALID_BIT_MASK 0x1 -#define BR_VALID_BIT_MASK 0x2 -#define CR_VALID_BIT_MASK 0x4 -#define AR_VALID_BIT_MASK 0x8 -#define RR_VALID_BIT_MASK 0x10 -#define FR_VALID_BIT_MASK 0x20 - -typedef struct { - UINT64 ValidFieldBits; - UINT8 MinStateInfo[1024]; - UINT64 Br[8]; - UINT64 Cr[128]; - UINT64 Ar[128]; - UINT64 Rr[8]; - FR_STRUCT Fr[128]; -} PSI_STATIC_STRUCT; - -#define PROC_ERROR_MAP_VALID_BIT_MASK 0x1 -#define PROC_STATE_PARAMETER_VALID_BIT_MASK 0x2 -#define PROC_CR_LID_VALID_BIT_MASK 0x4 -#define PROC_STATIC_STRUCT_VALID_BIT_MASK 0x8 -#define CPU_INFO_VALID_BIT_MASK 0x1000000 - -typedef struct { - SAL_SEC_HEADER SectionHeader; - UINT64 ValidationBits; - UINT64 ProcErrorMap; - UINT64 ProcStateParameter; - UINT64 ProcCrLid; - MOD_ERROR_INFO CacheError[15]; - MOD_ERROR_INFO TlbError[15]; - MOD_ERROR_INFO BusError[15]; - MOD_ERROR_INFO RegFileCheck[15]; - MOD_ERROR_INFO MsCheck[15]; - CPUID_INFO CpuInfo; - PSI_STATIC_STRUCT PsiValidData; -} SAL_PROCESSOR_ERROR_RECORD; - -// -// Sal Platform memory Error Record -// -#define SAL_MEMORY_ERROR_RECORD_INFO \ - { \ - 0xe429faf2, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, = 0x81} \ - } - -#define MEMORY_ERROR_STATUS_VALID_BIT_MASK 0x1 -#define MEMORY_PHYSICAL_ADDRESS_VALID_BIT_MASK 0x2 -#define MEMORY_ADDR_BIT_MASK 0x4 -#define MEMORY_NODE_VALID_BIT_MASK 0x8 -#define MEMORY_CARD_VALID_BIT_MASK 0x10 -#define MEMORY_MODULE_VALID_BIT_MASK 0x20 -#define MEMORY_BANK_VALID_BIT_MASK 0x40 -#define MEMORY_DEVICE_VALID_BIT_MASK 0x80 -#define MEMORY_ROW_VALID_BIT_MASK 0x100 -#define MEMORY_COLUMN_VALID_BIT_MASK 0x200 -#define MEMORY_BIT_POSITION_VALID_BIT_MASK 0x400 -#define MEMORY_PLATFORM_REQUESTOR_ID_VALID_BIT_MASK 0x800 -#define MEMORY_PLATFORM_RESPONDER_ID_VALID_BIT_MASK 0x1000 -#define MEMORY_PLATFORM_TARGET_VALID_BIT_MASK 0x2000 -#define MEMORY_PLATFORM_BUS_SPECIFIC_DATA_VALID_BIT_MASK 0x4000 -#define MEMORY_PLATFORM_OEM_ID_VALID_BIT_MASK 0x8000 -#define MEMORY_PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x10000 - -typedef struct { - SAL_SEC_HEADER SectionHeader; - UINT64 ValidationBits; - UINT64 MemErrorStatus; - UINT64 MemPhysicalAddress; - UINT64 MemPhysicalAddressMask; - UINT16 MemNode; - UINT16 MemCard; - UINT16 MemModule; - UINT16 MemBank; - UINT16 MemDevice; - UINT16 MemRow; - UINT16 MemColumn; - UINT16 MemBitPosition; - UINT64 ModRequestorId; - UINT64 ModResponderId; - UINT64 ModTargetId; - UINT64 BusSpecificData; - UINT8 MemPlatformOemId[16]; -} SAL_MEMORY_ERROR_RECORD; - -// -// PCI BUS Errors -// -#define SAL_PCI_BUS_ERROR_RECORD_INFO \ - { \ - 0xe429faf4, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, = 0x81} \ - } - -#define PCI_BUS_ERROR_STATUS_VALID_BIT_MASK 0x1 -#define PCI_BUS_ERROR_TYPE_VALID_BIT_MASK 0x2 -#define PCI_BUS_ID_VALID_BIT_MASK 0x4 -#define PCI_BUS_ADDRESS_VALID_BIT_MASK 0x8 -#define PCI_BUS_DATA_VALID_BIT_MASK 0x10 -#define PCI_BUS_CMD_VALID_BIT_MASK 0x20 -#define PCI_BUS_REQUESTOR_ID_VALID_BIT_MASK 0x40 -#define PCI_BUS_RESPONDER_ID_VALID_BIT_MASK 0x80 -#define PCI_BUS_TARGET_VALID_BIT_MASK 0x100 -#define PCI_BUS_OEM_ID_VALID_BIT_MASK 0x200 -#define PCI_BUS_OEM_DATA_STRUCT_VALID_BIT_MASK 0x400 - -typedef enum { - Unknown, - DataParityError, - SystemError, - MasterAbort, - BusTimeout, - MasterDataParityError, - AddressParityError, - CommandParityError -} PCI_BUS_ERROR_TYPE; - -typedef struct { - UINT8 BusNumber; - UINT8 SegmentNumber; -} PCI_BUS_ID; - -typedef struct { - SAL_SEC_HEADER SectionHeader; - UINT64 ValidationBits; - UINT64 PciBusErrorStatus; - UINT16 PciBusErrorType; - PCI_BUS_ID PciBusId; - UINT32 Reserved; - UINT64 PciBusAddress; - UINT64 PciBusData; - UINT64 PciBusCommand; - UINT64 PciBusRequestorId; - UINT64 PciBusResponderId; - UINT64 PciBusTargetId; - UINT8 PciBusOemId[16]; -} SAL_PCI_BUS_ERROR_RECORD; - -// -// PCI Component Errors -// -#define SAL_PCI_COMP_ERROR_RECORD_INFO \ - { \ - 0xe429faf6, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, = 0x81} \ - } - -#define PCI_COMP_ERROR_STATUS_VALID_BIT_MASK 0x1 -#define PCI_COMP_INFO_VALID_BIT_MASK 0x2 -#define PCI_COMP_MEM_NUM_VALID_BIT_MASK 0x4 -#define PCI_COMP_IO_NUM_VALID_BIT_MASK 0x8 -#define PCI_COMP_REG_DATA_PAIR_VALID_BIT_MASK 0x10 -#define PCI_COMP_OEM_DATA_STRUCT_VALID_BIT_MASK 0x20 - -typedef struct { - UINT16 VendorId; - UINT16 DeviceId; - UINT8 ClassCode[3]; - UINT8 FunctionNumber; - UINT8 DeviceNumber; - UINT8 BusNumber; - UINT8 SegmentNumber; - UINT8 Reserved[5]; -} PCI_COMP_INFO; - -typedef struct { - SAL_SEC_HEADER SectionHeader; - UINT64 ValidationBits; - UINT64 PciComponentErrorStatus; - PCI_COMP_INFO PciComponentInfo; - UINT32 PciComponentMemNum; - UINT32 PciComponentIoNum; - UINT8 PciBusOemId[16]; -} SAL_PCI_COMPONENT_ERROR_RECORD; - -// -// Sal Device Errors Info. -// -#define SAL_DEVICE_ERROR_RECORD_INFO \ - { \ - 0xe429faf3, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, = 0x81} \ - } - -#define SEL_RECORD_ID_VALID_BIT_MASK 0x1; -#define SEL_RECORD_TYPE_VALID_BIT_MASK 0x2; -#define SEL_GENERATOR_ID_VALID_BIT_MASK 0x4; -#define SEL_EVM_REV_VALID_BIT_MASK 0x8; -#define SEL_SENSOR_TYPE_VALID_BIT_MASK 0x10; -#define SEL_SENSOR_NUM_VALID_BIT_MASK 0x20; -#define SEL_EVENT_DIR_TYPE_VALID_BIT_MASK 0x40; -#define SEL_EVENT_DATA1_VALID_BIT_MASK 0x80; -#define SEL_EVENT_DATA2_VALID_BIT_MASK 0x100; -#define SEL_EVENT_DATA3_VALID_BIT_MASK 0x200; - -typedef struct { - SAL_SEC_HEADER SectionHeader; - UINT64 ValidationBits; - UINT16 SelRecordId; - UINT8 SelRecordType; - UINT32 TimeStamp; - UINT16 GeneratorId; - UINT8 EvmRevision; - UINT8 SensorType; - UINT8 SensorNum; - UINT8 EventDirType; - UINT8 Data1; - UINT8 Data2; - UINT8 Data3; -} SAL_DEVICE_ERROR_RECORD; - -// -// Sal SMBIOS Device Errors Info. -// -#define SAL_SMBIOS_ERROR_RECORD_INFO \ - { \ - 0xe429faf5, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, = 0x81} \ - } - -#define SMBIOS_EVENT_TYPE_VALID_BIT_MASK 0x1 -#define SMBIOS_LENGTH_VALID_BIT_MASK 0x2 -#define SMBIOS_TIME_STAMP_VALID_BIT_MASK 0x4 -#define SMBIOS_DATA_VALID_BIT_MASK 0x8 - -typedef struct { - SAL_SEC_HEADER SectionHeader; - UINT64 ValidationBits; - UINT8 SmbiosEventType; - UINT8 SmbiosLength; - UINT8 SmbiosBcdTimeStamp[6]; -} SAL_SMBIOS_DEVICE_ERROR_RECORD; - -// -// Sal Platform Specific Errors Info. -// -#define SAL_PLATFORM_ERROR_RECORD_INFO \ - { \ - 0xe429faf7, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, = 0x81} \ - } - -#define PLATFORM_ERROR_STATUS_VALID_BIT_MASK 0x1 -#define PLATFORM_REQUESTOR_ID_VALID_BIT_MASK 0x2 -#define PLATFORM_RESPONDER_ID_VALID_BIT_MASK 0x4 -#define PLATFORM_TARGET_VALID_BIT_MASK 0x8 -#define PLATFORM_SPECIFIC_DATA_VALID_BIT_MASK 0x10 -#define PLATFORM_OEM_ID_VALID_BIT_MASK 0x20 -#define PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x40 -#define PLATFORM_OEM= _DEVICE_PATH_VALID_BIT_MASK 0x80 - -typedef struct { - SAL_SEC_HEADER SectionHeader; - UINT64 ValidationBits; - UINT64 PlatformErrorStatus; - UINT64 PlatformRequestorId; - UINT64 PlatformResponderId; - UINT64 PlatformTargetId; - UINT64 PlatformBusSpecificData; - UINT8 OemComponentId[16]; -} SAL_PLATFORM_SPECIFIC_ERROR_RECORD; - -// -// Union of all the possible Sal Record Types -// -typedef union { - SAL_RECORD_HEADER *RecordHeader; - SAL_PROCESSOR_ERROR_RECORD *SalProcessorRecord; - SAL_PCI_BUS_ERROR_RECORD *SalPciBusRecord; - SAL_PCI_COMPONENT_ERROR_RECORD *SalPciComponentRecord; - SAL_DEVICE_ERROR_RECORD *ImpiRecord; - SAL_SMBIOS_DEVICE_ERROR_RECORD *SmbiosRecord; - SAL_PLATFORM_SPECIFIC_ERROR_RECORD *PlatformRecord; - SAL_MEMORY_ERROR_RECORD *MemoryRecord; - UINT8 *Raw; -} SAL_ERROR_RECORDS_POINTERS; - -#pragma pack() - -#endif diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/I= pf/SalPal.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/= Ipf/SalPal.c deleted file mode 100644 index 3881a461..00000000 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Ipf/SalP= al.c +++ /dev/null @@ -1,369 +0,0 @@ -/** @file - - Copyright 2006 - 2010 Unified EFI, Inc.
- Copyright (c) 2010, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ -/*++ - -Module Name: - - SalPal.c - -Abstract: - - Functions to make SAL and PAL proc calls - ---*/ - -#include "Sctlib.h" -#include -#include "Libsalpal.h" - -SAL_PROC mSalProc; -EFI_PLABEL mSalProcPlabel; -PAL_PROC mPalProc; -EFI_PLABEL mPalProcPlabel; -SAL_SYSTEM_TABLE_HEADER *mSalSystemTable; -BOOLEAN SalPalLibInitialized =3D FALSE; - -EFI_STATUS -LibInitSalAndPalProc ( - VOID - ) -/*++ - -Routine Description: - - Initialize SAL and PAL procedure calling. - -Arguments: - - None - -Returns: - - EFI_SUCCESS - Always return success. - ---*/ -{ - SAL_ST_ENTRY_POINT_DESCRIPTOR *SalEpDesc; - EFI_PLABEL *PlabelPtr; - UINT8 Checksum; - UINT8 *TableByte; - UINTN Offset; - EFI_STATUS Status; - - if (!SalPalLibInitialized) { - SalPalLibInitialized =3D TRUE; - mSalProc =3D NULL; - mPalProc =3D NULL; - mSalSystemTable =3D NULL; - - Status =3D SctGetSystemConfigurationTable (>EfiSalSys= temTableGuid, (VOID **) (&mSalSystemTable)); - if (EFI_ERROR (Status)) { - SctPrint (L"Error : Sal System Table NOT found\r\n"); - return EFI_SUCCESS; - } - // - // Check signature, number of entries and size. Then checksum the tabl= e. - // - if (((EntsCompareMem (&mSalSystemTable->Signature, EFI_SAL_ST_HEADER_S= IGNATURE, 4)) !=3D 0) && - (mSalSystemTable->EntryCount =3D=3D 0) && - (mSalSystemTable->Length =3D=3D 0) - ) { - return EFI_SUCCESS; - } - - TableByte =3D (UINT8 *) mSalSystemTable; - Checksum =3D 0; - for (Offset =3D 0; Offset < mSalSystemTable->Length; Offset++, TableBy= te++) { - Checksum =3D Checksum +*TableByte; - } - - if (Checksum !=3D 0) { - SctPrint (L"Error : Sal System Table checksum is invalid\r\n"); - return EFI_SUCCESS; - } - - SalEpDesc =3D NULL; - SalEpDesc =3D (SAL_ST_ENTRY_POINT_DESCRIPTOR *) LibSearchSalSystemTabl= e (EFI_SAL_ST_ENTRY_POINT); - - if (SalEpDesc =3D=3D NULL) { - SctPrint (L"Error : Sal entry point not found\r\n"); - return EFI_SUCCESS; - } - - mSalProcPlabel.EntryPoint =3D SalEpDesc->SalProcEntry; - mSalProcPlabel.GP =3D SalEpDesc->SalGlobalDataPointer; - PlabelPtr =3D &mSalProcPlabel; - mSalProc =3D *(SAL_PROC *) (&PlabelPtr); - - if ((mSalProc =3D=3D NULL) || (mSalProcPlabel.EntryPoint =3D=3D 0)) { - SctPrint (L"Error : Sal entry point invalid\r\n"); - return EFI_SUCCESS; - } - - mPalProcPlabel.EntryPoint =3D SalEpDesc->PalProcEntry; - mPalProcPlabel.GP =3D SalEpDesc->SalGlobalDataPointer; - PlabelPtr =3D &mPalProcPlabel; - mPalProc =3D *(PAL_PROC *) (&PlabelPtr); - - if (mPalProcPlabel.EntryPoint =3D=3D 0) { - SctPrint (L"Error : PAL entry point invalid\r\n"); - return EFI_SUCCESS; - } - } - - return EFI_SUCCESS; -} - -EFI_STATUS -LibGetSalVersionInfo ( - IN OUT UINT16 *SalSpecRev, - IN OUT UINT16 *SalARev, - IN OUT UINT16 *SalBRev - ) -/*++ - -Routine Description: - - Get SAL version infomation. - -Arguments: - - SalSpecRev - SAL Spec reversion. - SalARev - SAL A reversion. - SalBRev - SAL B reversion. - -Returns: - - EFI_UNSUPPORTED - mSalSystemTable is NULL. - EFI_SUCCESS - Operation succeeded. - ---*/ -{ - if (mSalSystemTable =3D=3D NULL) { - return EFI_UNSUPPORTED; - } - - *SalSpecRev =3D mSalSystemTable->SalRevision; - *SalARev =3D mSalSystemTable->SalAVersion; - *SalBRev =3D mSalSystemTable->SalBVersion; - return EFI_SUCCESS; -} - -EFI_STATUS -LibGetSalIoPortMapping ( - OUT UINT64 *IoPortMapping - ) -/*++ - -Routine Description: - - Get the IO Port Map from the SAL System Table. - -Arguments: - - IoPortMapping - Pointer to receive IO port mapping address. - -Returns: - - EFI_UNSUPPORTED - mSalSystemTable is NULL. - EFI_SUCCESS - Operation succeeded. - ---*/ -{ - SAL_ST_MEMORY_DESCRIPTOR_ENTRY *SalMemDesc; - - SalMemDesc =3D (SAL_ST_MEMORY_DESCRIPTOR_ENTRY *) LibSearchSalSystemTabl= e (EFI_SAL_ST_MEMORY_DESCRIPTOR); - - if (SalMemDesc =3D=3D NULL) { - return EFI_UNSUPPORTED; - } - - while (SalMemDesc->Type =3D=3D EFI_SAL_ST_MEMORY_DESCRIPTOR) { - if (SalMemDesc->MemoryType =3D=3D SAL_IO_PORT_MAPPING) { - *IoPortMapping =3D SalMemDesc->PhysicalMemoryAddress; - return EFI_SUCCESS; - } - - SalMemDesc++; - } - - return EFI_UNSUPPORTED; -} - -EFI_STATUS -LibGetSalIpiBlock ( - OUT UINT64 *IpiBlock - ) -/*++ - -Routine Description: - - Get the IPI block from the SAL system table - -Arguments: - - IpiBlock - Pointer to receive IPI block address. - -Returns: - - EFI_UNSUPPORTED - SalMemDesc is NULL. - EFI_SUCCESS - Operation succeeded. - ---*/ -{ - SAL_ST_MEMORY_DESCRIPTOR_ENTRY *SalMemDesc; - - SalMemDesc =3D (SAL_ST_MEMORY_DESCRIPTOR_ENTRY *) LibSearchSalSystemTabl= e (EFI_SAL_ST_MEMORY_DESCRIPTOR); - - if (SalMemDesc =3D=3D NULL) { - return EFI_UNSUPPORTED; - } - - while (SalMemDesc->Type =3D=3D EFI_SAL_ST_MEMORY_DESCRIPTOR) { - if (SalMemDesc->MemoryType =3D=3D SAL_SAPIC_IPI_BLOCK) { - *IpiBlock =3D SalMemDesc->PhysicalMemoryAddress; - return EFI_SUCCESS; - } - - SalMemDesc++; - } - - return EFI_UNSUPPORTED; -} - -EFI_STATUS -LibGetSalWakeupVector ( - OUT UINT64 *WakeVector - ) -/*++ - -Routine Description: - - Get the wakeup vector from the SAL system table - -Arguments: - - WakeVector - Pointer to receive wakeup vector. - -Returns: - - EFI_UNSUPPORTED - Cannot find wakeup decriptor. - EFI_SUCCESS - Operation succeeded. - ---*/ -{ - SAL_ST_AP_WAKEUP_DECRIPTOR *ApWakeUp; - - ApWakeUp =3D (SAL_ST_AP_WAKEUP_DECRIPTOR *) LibSearchSalSystemTable (EFI= _SAL_ST_AP_WAKEUP); - if (!ApWakeUp) { - return EFI_UNSUPPORTED; - } - - *WakeVector =3D ApWakeUp->ExternalInterruptVector; - return EFI_SUCCESS; -} - -VOID * -LibSearchSalSystemTable ( - IN UINT8 EntryType - ) -/*++ - -Routine Description: - - Search SAL system table. - -Arguments: - - EntryType - SAL entry type. - -Returns: - - None. - ---*/ -{ - - UINT8 *SalTableHack; - UINT16 EntryCount; - UINT16 Count; - - if (mSalSystemTable =3D=3D NULL) { - return NULL; - } - - EntryCount =3D mSalSystemTable->EntryCount; - if (EntryCount =3D=3D 0) { - return NULL; - } - // - // BugBug: Add code to test checksum on the Sal System Table - // - SalTableHack =3D (UINT8 *) mSalSystemTable; - SalTableHack +=3D sizeof (SAL_SYSTEM_TABLE_HEADER); - - for (Count =3D 0; Count < EntryCount; Count++) { - if (*SalTableHack =3D=3D EntryType) { - return (VOID *) SalTableHack; - } - - switch (*SalTableHack) { - case EFI_SAL_ST_ENTRY_POINT: - SalTableHack +=3D sizeof (SAL_ST_ENTRY_POINT_DESCRIPTOR); - break; - - case EFI_SAL_ST_MEMORY_DESCRIPTOR: - SalTableHack +=3D sizeof (SAL_ST_MEMORY_DESCRIPTOR_ENTRY); - break; - - case EFI_SAL_ST_PLATFORM_FEATURES: - SalTableHack +=3D sizeof (SAL_ST_PLATFORM_FEATURES); - break; - - case EFI_SAL_ST_TR_USAGE: - SalTableHack +=3D sizeof (SAL_ST_TR_DECRIPTOR); - break; - - case EFI_SAL_ST_PTC: - SalTableHack +=3D sizeof (SAL_ST_CACHE_COHERENCE_DECRIPTOR); - break; - - case EFI_SAL_ST_AP_WAKEUP: - SalTableHack +=3D sizeof (SAL_ST_AP_WAKEUP_DECRIPTOR); - break; - - default: - ASSERT (FALSE); - break; - } - } - - return NULL; -} - -SAL_RETURN_REGS -LibSalProc ( - IN UINT64 Arg1, - IN UINT64 Arg2, - IN UINT64 Arg3, - IN UINT64 Arg4, - IN UINT64 Arg5, - IN UINT64 Arg6, - IN UINT64 Arg7, - IN UINT64 Arg8 - ) -{ - return mSalProc (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8); -} -- 2.17.1