]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/PlatformSetupDxe/SetupFunctions.c
Vlv2TbltDevicePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2TbltDevicePkg / PlatformSetupDxe / SetupFunctions.c
1 /** @file
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
9
10 Module Name:
11
12 SetupFunctions.c
13
14 Abstract:
15
16 Revision History
17
18 --*/
19
20 #include "PlatformSetupDxe.h"
21
22 VOID
23 AsciiToUnicode (
24 IN CHAR8 *AsciiString,
25 IN CHAR16 *UnicodeString
26 )
27 {
28 UINT8 Index;
29
30 Index = 0;
31 while (AsciiString[Index] != 0) {
32 UnicodeString[Index] = (CHAR16)AsciiString[Index];
33 Index++;
34 }
35 }
36
37 VOID
38 SwapEntries (
39 IN CHAR8 *Data
40 )
41 {
42 UINT16 Index;
43 CHAR8 Temp8;
44
45 Index = 0;
46 while (Data[Index] != 0 && Data[Index+1] != 0) {
47 Temp8 = Data[Index];
48 Data[Index] = Data[Index+1];
49 Data[Index+1] = Temp8;
50 Index +=2;
51 }
52
53 return;
54 }
55
56 UINT32
57 ConvertBase10ToRaw (
58 IN EFI_EXP_BASE10_DATA *Data)
59 {
60 UINTN Index;
61 UINT32 RawData;
62
63 RawData = Data->Value;
64 for (Index = 0; Index < (UINTN) Data->Exponent; Index++) {
65 RawData *= 10;
66 }
67
68 return RawData;
69 }
70
71 UINT32
72 ConvertBase2ToRaw (
73 IN EFI_EXP_BASE2_DATA *Data)
74 {
75 UINTN Index;
76 UINT32 RawData;
77
78 RawData = Data->Value;
79 for (Index = 0; Index < (UINTN) Data->Exponent; Index++) {
80 RawData <<= 1;
81 }
82
83 return RawData;
84 }
85