1 /** @file 2 3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR> 4 5 This program and the accompanying materials are licensed and made available under 7 the terms and conditions of the BSD License that accompanies this distribution. 9 The full text of the license may be found at 11 http://opensource.org/licenses/bsd-license.php. 13 15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 17 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 19 21 23 24 Module Name: 25 26 SetupFunctions.c 27 28 Abstract: 29 30 Revision History 31 32 --*/ 33 34 #include "PlatformSetupDxe.h" 35 36 VOID 37 AsciiToUnicode ( 38 IN CHAR8 *AsciiString, 39 IN CHAR16 *UnicodeString 40 ) 41 { 42 UINT8 Index; 43 44 Index = 0; 45 while (AsciiString[Index] != 0) { 46 UnicodeString[Index] = (CHAR16)AsciiString[Index]; 47 Index++; 48 } 49 } 50 51 VOID 52 SwapEntries ( 53 IN CHAR8 *Data 54 ) 55 { 56 UINT16 Index; 57 CHAR8 Temp8; 58 59 Index = 0; 60 while (Data[Index] != 0 && Data[Index+1] != 0) { 61 Temp8 = Data[Index]; 62 Data[Index] = Data[Index+1]; 63 Data[Index+1] = Temp8; 64 Index +=2; 65 } 66 67 return; 68 } 69 70 UINT32 71 ConvertBase10ToRaw ( 72 IN EFI_EXP_BASE10_DATA *Data) 73 { 74 UINTN Index; 75 UINT32 RawData; 76 77 RawData = Data->Value; 78 for (Index = 0; Index < (UINTN) Data->Exponent; Index++) { 79 RawData *= 10; 80 } 81 82 return RawData; 83 } 84 85 UINT32 86 ConvertBase2ToRaw ( 87 IN EFI_EXP_BASE2_DATA *Data) 88 { 89 UINTN Index; 90 UINT32 RawData; 91 92 RawData = Data->Value; 93 for (Index = 0; Index < (UINTN) Data->Exponent; Index++) { 94 RawData <<= 1; 95 } 96 97 return RawData; 98 } 99 100