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