From a73480f6f2e211947ac19ef049adcba6f50bb655 Mon Sep 17 00:00:00 2001 From: qwang12 Date: Fri, 6 Jul 2007 15:19:20 +0000 Subject: Enable Intel IPF compilation for MdePkg. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3130 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Library/UefiLib.h | 138 +++++++++++++++++++++ MdePkg/Library/BaseCacheMaintenanceLib/IpfCache.c | 1 + MdePkg/Library/DxeHobLib/HobLib.c | 1 + MdePkg/Library/DxeHobLib/HobLibInternal.h | 26 ++++ MdePkg/Library/DxePcdLib/DxePcdLib.c | 2 + MdePkg/Library/DxePcdLib/DxePcdLibInternal.h | 35 ++++++ .../DxeServicesTableLib/DxeServicesTableLib.c | 1 + .../DxeServicesTableLibInternal.h | 40 ++++++ MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h | 20 +++ .../PeiServicesTablePointer.c | 1 + .../PeiServicesTablePointerInternal.h | 36 ++++++ .../UefiBootServicesTableLib.c | 3 +- .../UefiBootServicesTableLibInternal.h | 25 ++++ .../UefiDevicePathLib.c | 2 + .../UefiDevicePathLibInternal.h | 39 ++++++ .../UefiRuntimeServicesTableLib.c | 2 + .../UefiRuntimeServicesTableLibInternal.h | 39 ++++++ 17 files changed, 410 insertions(+), 1 deletion(-) create mode 100644 MdePkg/Library/DxeHobLib/HobLibInternal.h create mode 100644 MdePkg/Library/DxePcdLib/DxePcdLibInternal.h create mode 100644 MdePkg/Library/DxeServicesTableLib/DxeServicesTableLibInternal.h create mode 100644 MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerInternal.h create mode 100644 MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLibInternal.h create mode 100644 MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibInternal.h create mode 100644 MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLibInternal.h (limited to 'MdePkg') diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h index 7b247e0..874ad1f 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -357,6 +357,73 @@ LookupUnicodeString ( ); /** + This function looks up a Unicode string in UnicodeStringTable. + If Language is a member of SupportedLanguages and a Unicode + string is found in UnicodeStringTable that matches the + language code specified by Language, then it is returned in + UnicodeString. + + @param Language A pointer to the ISO 639-2 or + RFC 3066 language code for the + Unicode string to look up and + return. + + @param SupportedLanguages A pointer to the set of ISO + 639-2 or RFC 3066 language + codes that the Unicode string + table supports. Language must + be a member of this set. + + @param UnicodeStringTable A pointer to the table of + Unicode strings. + + @param UnicodeString A pointer to the Unicode + string from UnicodeStringTable + that matches the language + specified by Language. + + @param Iso639Language Specify the language code + format supported. If true, + then the format follow ISO + 639-2. If false, then it + follows RFC3066. + + @retval EFI_SUCCESS The Unicode string that + matches the language specified + by Language was found in the + table of Unicoide strings + UnicodeStringTable, and it was + returned in UnicodeString. + + @retval EFI_INVALID_PARAMETER Language is NULL. + + @retval EFI_INVALID_PARAMETER UnicodeString is NULL. + + @retval EFI_UNSUPPORTED SupportedLanguages is NULL. + + @retval EFI_UNSUPPORTED UnicodeStringTable is NULL. + + @retval EFI_UNSUPPORTED The language specified by + Language is not a member + ofSupportedLanguages. + + @retval EFI_UNSUPPORTED The language specified by + Language is not supported by + UnicodeStringTable. + +**/ +EFI_STATUS +EFIAPI +LookupUnicodeString2 ( + IN CONST CHAR8 *Language, + IN CONST CHAR8 *SupportedLanguages, + IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable, + OUT CHAR16 **UnicodeString, + IN BOOLEAN Iso639Language + ) +; + +/** This function adds a Unicode string to UnicodeStringTable. If Language is a member of SupportedLanguages then UnicodeString is added to UnicodeStringTable. New buffers are allocated for both Language and @@ -398,6 +465,77 @@ AddUnicodeString ( ); /** + + This function adds a Unicode string to UnicodeStringTable. + If Language is a member of SupportedLanguages then + UnicodeString is added to UnicodeStringTable. New buffers are + allocated for both Language and UnicodeString. The contents + of Language and UnicodeString are copied into these new + buffers. These buffers are automatically freed when + FreeUnicodeStringTable() is called. + + @param Language A pointer to the ISO 639-2 or + RFC 3066 language code for the + Unicode string to add. + + @param SupportedLanguages A pointer to the set of ISO + 639-2 or RFC 3.66 language + codes that the Unicode string + table supports. Language must + be a member of this set. + + @param UnicodeStringTable A pointer to the table of + Unicode strings. + + @param UnicodeString A pointer to the Unicode + string to add. + + @param Iso639Language Specify the language code + format supported. If true, + then the format follow ISO + 639-2. If false, then it + follows RFC3066. + + @retval EFI_SUCCESS The Unicode string that + matches the language specified + by Language was found in the + table of Unicode strings + UnicodeStringTable, and it was + returned in UnicodeString. + + @retval EFI_INVALID_PARAMETER Language is NULL. + + @retval EFI_INVALID_PARAMETER UnicodeString is NULL. + + @retval EFI_INVALID_PARAMETER UnicodeString is an empty string. + + @retval EFI_UNSUPPORTED SupportedLanguages is NULL. + + @retval EFI_ALREADY_STARTED A Unicode string with language + Language is already present in + UnicodeStringTable. + + @retval EFI_OUT_OF_RESOURCES There is not enough memory to + add another Unicode string to + UnicodeStringTable. + + @retval EFI_UNSUPPORTED The language specified by + Language is not a member of + SupportedLanguages. + +**/ +EFI_STATUS +EFIAPI +AddUnicodeString2 ( + IN CONST CHAR8 *Language, + IN CONST CHAR8 *SupportedLanguages, + IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable, + IN CONST CHAR16 *UnicodeString, + IN BOOLEAN Iso639Language + ) +; + +/** This function frees the table of Unicode strings in UnicodeStringTable. If UnicodeStringTable is NULL, then EFI_SUCCESS is returned. Otherwise, each language code, and each Unicode string in the Unicode string diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/IpfCache.c b/MdePkg/Library/BaseCacheMaintenanceLib/IpfCache.c index 8461d68..5be0014 100644 --- a/MdePkg/Library/BaseCacheMaintenanceLib/IpfCache.c +++ b/MdePkg/Library/BaseCacheMaintenanceLib/IpfCache.c @@ -17,6 +17,7 @@ // Include common header file for this module. // #include +#include #include #include diff --git a/MdePkg/Library/DxeHobLib/HobLib.c b/MdePkg/Library/DxeHobLib/HobLib.c index b05f143..990bd30 100644 --- a/MdePkg/Library/DxeHobLib/HobLib.c +++ b/MdePkg/Library/DxeHobLib/HobLib.c @@ -30,6 +30,7 @@ #include #include #include +#include "HobLibInternal.h" STATIC VOID *mHobList = NULL; diff --git a/MdePkg/Library/DxeHobLib/HobLibInternal.h b/MdePkg/Library/DxeHobLib/HobLibInternal.h new file mode 100644 index 0000000..639886b --- /dev/null +++ b/MdePkg/Library/DxeHobLib/HobLibInternal.h @@ -0,0 +1,26 @@ +/** @file + Internal include file of DXE Entry Point HOB Library. + + Copyright (c) 2006 - 2007, 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. + +**/ + +#ifndef _DXE_HOB_LIB_INTERNAL_H__ +#define _DXE_HOB_LIB_INTERNAL_H__ + +EFI_STATUS +EFIAPI +HobLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + +#endif diff --git a/MdePkg/Library/DxePcdLib/DxePcdLib.c b/MdePkg/Library/DxePcdLib/DxePcdLib.c index b05c655..e12a455 100644 --- a/MdePkg/Library/DxePcdLib/DxePcdLib.c +++ b/MdePkg/Library/DxePcdLib/DxePcdLib.c @@ -31,6 +31,8 @@ Module Name: DxePcdLib.c #include #include +#include "DxePcdLibInternal.h" + static PCD_PROTOCOL *mPcd; /** diff --git a/MdePkg/Library/DxePcdLib/DxePcdLibInternal.h b/MdePkg/Library/DxePcdLib/DxePcdLibInternal.h new file mode 100644 index 0000000..8f98b47 --- /dev/null +++ b/MdePkg/Library/DxePcdLib/DxePcdLibInternal.h @@ -0,0 +1,35 @@ +/** @file +Internal header of PcdLib class library for DXE phase. + +Copyright (c) 2006, 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. + +**/ +#ifndef _DXE_PCD_LIB_INTERNAL_H_ +#define _DXE_PCD_LIB_INTERNAL_H_ + +/** + The constructor function caches the PCD_PROTOCOL pointer. + + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The constructor always return EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +PcdLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + +#endif + diff --git a/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c b/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c index b4faf97..afaa913 100644 --- a/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c +++ b/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c @@ -20,6 +20,7 @@ #include #include +#include "DxeServicesTableLibInternal.h" // // Cache copy of the DXE Services Table diff --git a/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLibInternal.h b/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLibInternal.h new file mode 100644 index 0000000..0a5d4a2 --- /dev/null +++ b/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLibInternal.h @@ -0,0 +1,40 @@ +/** @file + Internal Header file for Dxe Services Table Library Instance. + + Copyright (c) 2006, 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. + +**/ + +#ifndef _DXE_SERVICE_TABLE_LIB_INTERNAL_H +#define _DXE_SERVICE_TABLE_LIB_INTERNAL_H + + +/** + The constructor function caches the pointer of DXE Services Table. + + The constructor function caches the pointer of DXE Services Table. + It will ASSERT() if that operation fails. + It will ASSERT() if the pointer of DXE Services Table is NULL. + It will always return EFI_SUCCESS. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +DxeServicesTableLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; +#endif diff --git a/MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h b/MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h index 2435bae..8c96f64 100644 --- a/MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h +++ b/MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h @@ -73,4 +73,24 @@ InternalSmBusExec ( OUT RETURN_STATUS *Status OPTIONAL ); +/** + The constructor function caches the pointer to Smbus protocol. + + The constructor function locates Smbus protocol from protocol database. + It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +SmbusLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + #endif diff --git a/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c b/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c index 9dea047..558f7cc 100644 --- a/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c +++ b/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c @@ -18,6 +18,7 @@ #include #include +#include "PeiServicesTablePointerInternal.h" static EFI_PEI_SERVICES **gPeiServices; diff --git a/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerInternal.h b/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerInternal.h new file mode 100644 index 0000000..0e0e4ff --- /dev/null +++ b/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerInternal.h @@ -0,0 +1,36 @@ +/** @file + Internal Header file for PEI Services Table Pointer Library. + + Copyright (c) 2006, 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. + +**/ + +#ifndef _PEI_SERVICE_TABLE_POINTER_INTERNAL_H_ +#define _PEI_SERVICE_TABLE_POINTER_INTERNAL_H_ +/** + The constructor function caches the pointer to PEI services. + + The constructor function caches the pointer to PEI services. + It will always return EFI_SUCCESS. + + @param FfsHeader Pointer to FFS header the loaded driver. + @param PeiServices Pointer to the PEI services. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +PeiServicesTablePointerLibConstructor ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ) +; +#endif diff --git a/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c b/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c index bf77adf..3493c64 100644 --- a/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c +++ b/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c @@ -26,6 +26,7 @@ // #include #include +#include "UefiBootServicesTableLibInternal.h" EFI_HANDLE gImageHandle = NULL; EFI_SYSTEM_TABLE *gST = NULL; @@ -33,7 +34,7 @@ EFI_BOOT_SERVICES *gBS = NULL; /** The constructor function caches the pointer of Boot Services Table. - + The constructor function caches the pointer of Boot Services Table through System Table. It will ASSERT() if the pointer of System Table is NULL. It will ASSERT() if the pointer of Boot Services Table is NULL. diff --git a/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLibInternal.h b/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLibInternal.h new file mode 100644 index 0000000..63a138a --- /dev/null +++ b/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLibInternal.h @@ -0,0 +1,25 @@ +/** @file + UEFI Boot Services Table Library internal header + + Copyright (c) 2006 - 2007, 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. + +**/ + +#ifndef _UefiBootServicesTable_Lib_H +#define _UefiBootServicesTable_Lib_H + +EFI_STATUS +EFIAPI +UefiBootServicesTableLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; +#endif diff --git a/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c b/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c index 6a587ab..0b926e2 100644 --- a/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c +++ b/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c @@ -33,6 +33,8 @@ #include #include +#include "UefiDevicePathLibInternal.h" + STATIC EFI_DEVICE_PATH_UTILITIES_PROTOCOL *mDevicePathUtilities = NULL; /** diff --git a/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibInternal.h b/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibInternal.h new file mode 100644 index 0000000..9d1f669 --- /dev/null +++ b/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibInternal.h @@ -0,0 +1,39 @@ +/** @file + Internal Header file for UEFI Device Path Library. + + Copyright (c) 2006, 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. + +**/ + +#ifndef _UEFI_DEVICEPATH_LIB_INTERNAL_H_ +#define _UEFI_DEVICEPATH_LIB_INTERNAL_H_ + + +/** + The constructor function caches the pointer to DevicePathUtilites protocol. + + The constructor function locates DevicePathUtilities protocol from protocol database. + It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +DevicePathLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + +#endif diff --git a/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c b/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c index 3d493d5..3ef317f 100644 --- a/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c +++ b/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c @@ -27,6 +27,8 @@ #include #include +#include "UefiRuntimeServicesTableLibInternal.h" + EFI_RUNTIME_SERVICES *gRT = NULL; /** diff --git a/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLibInternal.h b/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLibInternal.h new file mode 100644 index 0000000..95ff283 --- /dev/null +++ b/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLibInternal.h @@ -0,0 +1,39 @@ +/** @file + Internal Header file for UEFI Runtime Services Table Library. + + Copyright (c) 2006, 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. + +**/ + + +#ifndef _UEFI_RUNTIME_SERVICES_TABLE_LIB_INTERNAL_H_ +#define _UEFI_RUNTIME_SERVICES_TABLE_LIB_INTERNAL_H_ +/** + The constructor function caches the pointer of Runtime Services Table. + + The constructor function caches the pointer of Runtime Services Table. + It will ASSERT() if the pointer of Runtime Services Table is NULL. + It will always return EFI_SUCCESS. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +UefiRuntimeServicesTableLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; +#endif + -- cgit v1.1