]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/TianoTools/Common/PeiLib/PeiLib.c
Add <FrameworkModules> in EdkModulePkg-All-Archs.fpd and MdePkg-All-Archs.fpd file...
[mirror_edk2.git] / Tools / Source / TianoTools / Common / PeiLib / PeiLib.c
CommitLineData
878ddf1f 1/*++\r
2\r
3Copyright (c) 2004, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 PeiLib.c\r
15\r
16Abstract:\r
17\r
18 PEI Library Functions\r
19 \r
20--*/\r
21\r
22#include "TianoCommon.h"\r
23#include "PeiHob.h"\r
24#include "Pei.h"\r
25\r
26VOID\r
27PeiCopyMem (\r
28 IN VOID *Destination,\r
29 IN VOID *Source,\r
30 IN UINTN Length\r
31 );\r
32\r
33VOID\r
34ZeroMem (\r
35 IN VOID *Buffer,\r
36 IN UINTN Size\r
37 )\r
38/*++\r
39\r
40Routine Description:\r
41\r
42 Set Buffer to zero for Size bytes.\r
43\r
44Arguments:\r
45\r
46 Buffer - Memory to set.\r
47\r
48 Size - Number of bytes to set\r
49\r
50Returns:\r
51\r
52 None\r
53\r
54--*/\r
55{\r
56 INT8 *Ptr;\r
57\r
58 Ptr = Buffer;\r
59 while (Size--) {\r
60 *(Ptr++) = 0;\r
61 }\r
62}\r
63\r
64VOID\r
65PeiCopyMem (\r
66 IN VOID *Destination,\r
67 IN VOID *Source,\r
68 IN UINTN Length\r
69 )\r
70/*++\r
71\r
72Routine Description:\r
73\r
74 Copy Length bytes from Source to Destination.\r
75\r
76Arguments:\r
77\r
78 Destination - Target of copy\r
79\r
80 Source - Place to copy from\r
81\r
82 Length - Number of bytes to copy\r
83\r
84Returns:\r
85\r
86 None\r
87\r
88--*/\r
89{\r
90 CHAR8 *Destination8;\r
91 CHAR8 *Source8;\r
92\r
93 Destination8 = Destination;\r
94 Source8 = Source;\r
95 while (Length--) {\r
96 *(Destination8++) = *(Source8++);\r
97 }\r
98}\r
99\r
100VOID\r
101CopyMem (\r
102 IN VOID *Destination,\r
103 IN VOID *Source,\r
104 IN UINTN Length\r
105 )\r
106/*++\r
107\r
108Routine Description:\r
109\r
110 Copy Length bytes from Source to Destination.\r
111\r
112Arguments:\r
113\r
114 Destination - Target of copy\r
115\r
116 Source - Place to copy from\r
117\r
118 Length - Number of bytes to copy\r
119\r
120Returns:\r
121\r
122 None\r
123\r
124--*/\r
125{\r
126 CHAR8 *Destination8;\r
127 CHAR8 *Source8;\r
128\r
129 Destination8 = Destination;\r
130 Source8 = Source;\r
131 while (Length--) {\r
132 *(Destination8++) = *(Source8++);\r
133 }\r
134}\r
135\r
136BOOLEAN\r
137CompareGuid (\r
138 IN EFI_GUID *Guid1,\r
139 IN EFI_GUID *Guid2\r
140 )\r
141/*++\r
142\r
143Routine Description:\r
144\r
145 Compares two GUIDs\r
146\r
147Arguments:\r
148\r
149 Guid1 - guid to compare\r
150 Guid2 - guid to compare\r
151\r
152Returns:\r
153 = TRUE if Guid1 == Guid2\r
154 = FALSE if Guid1 != Guid2 \r
155\r
156--*/\r
157{\r
158 if ((((INT32 *) Guid1)[0] - ((INT32 *) Guid2)[0]) == 0) {\r
159 if ((((INT32 *) Guid1)[1] - ((INT32 *) Guid2)[1]) == 0) {\r
160 if ((((INT32 *) Guid1)[2] - ((INT32 *) Guid2)[2]) == 0) {\r
161 if ((((INT32 *) Guid1)[3] - ((INT32 *) Guid2)[3]) == 0) {\r
162 return TRUE;\r
163 }\r
164 }\r
165 }\r
166 }\r
167\r
168 return FALSE;\r
169}\r