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