From 2a0879aa03ca972c8eea456cfba0f5f119695055 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Thu, 29 Jul 2010 05:38:39 +0000 Subject: Use local version EfiScriptLibAsciiStrLen() and EfiScriptLibStrLen() function to get string length so that this library doesn't depend on other EDK libraries and it can be linked together with EdkIIGlueLib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10711 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/Dxe/EfiScriptLib/EfiScriptLib.c | 54 ++++++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) (limited to 'EdkCompatibilityPkg') diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c index 01ae07ee04..7b905b49fc 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c +++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2010, 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 @@ -23,6 +23,54 @@ Abstract: EFI_BOOT_SCRIPT_SAVE_PROTOCOL *mBootScriptSave; +UINTN +EfiScriptLibAsciiStrLen ( + IN CHAR8 *String + ) +/*++ + +Routine Description: + Return the number of Ascii characters in String. This is not the same as + the length of the string in bytes. + +Arguments: + String - String to process + +Returns: + Number of Ascii characters in String + +--*/ +{ + UINTN Length; + + for (Length=0; *String; String++, Length++); + return Length; +} + +UINTN +EfiScriptLibStrLen ( + IN CHAR16 *String + ) +/*++ + +Routine Description: + Return the number of Unicode characters in String. This is not the same as + the length of the string in bytes. + +Arguments: + String - String to process + +Returns: + Number of Unicode characters in String + +--*/ +{ + UINTN Length; + + for (Length=0; *String; String++, Length++); + return Length; +} + EFI_STATUS EFIAPI BootScriptSaveInitialize ( @@ -622,7 +670,7 @@ Returns: { return BootScriptSaveInformation ( TableName, - (UINT32) EfiStrLen (String) * 2 + 2, + (UINT32) EfiScriptLibStrLen (String) * 2 + 2, (EFI_PHYSICAL_ADDRESS) (UINTN) String ); } @@ -655,7 +703,7 @@ Returns: { return BootScriptSaveInformation ( TableName, - (UINT32) EfiAsciiStrLen (String) + 1, + (UINT32) EfiScriptLibAsciiStrLen (String) + 1, (EFI_PHYSICAL_ADDRESS) (UINTN) String ); } -- cgit v1.2.3