]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PeiMemoryLib/MemLibInternals.h
remove some comments introduced by tools.
[mirror_edk2.git] / MdePkg / Library / PeiMemoryLib / MemLibInternals.h
1 /** @file
2 Declaration of internal functions for Base Memory Library.
3
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 The following BaseMemoryLib instances share the same version of this file:
14
15 BaseMemoryLib
16 BaseMemoryLibMmx
17 BaseMemoryLibSse2
18 BaseMemoryLibRepStr
19 PeiMemoryLib
20 DxeMemoryLib
21
22 **/
23
24 #ifndef __MEM_LIB_INTERNALS__
25 #define __MEM_LIB_INTERNALS__
26
27
28 #include <PiPei.h>
29
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/PeiServicesTablePointerLib.h>
32 #include <Library/DebugLib.h>
33 #include <Library/BaseLib.h>
34
35 /**
36 Copy Length bytes from Source to Destination.
37
38 @param Destination Target of copy
39 @param Source Place to copy from
40 @param Length Number of bytes to copy
41
42 @return Destination
43
44 **/
45 VOID *
46 EFIAPI
47 InternalMemCopyMem (
48 OUT VOID *DestinationBuffer,
49 IN CONST VOID *SourceBuffer,
50 IN UINTN Length
51 );
52
53 /**
54 Set Buffer to Value for Size bytes.
55
56 @param Buffer Memory to set.
57 @param Size Number of bytes to set
58 @param Value Value of the set operation.
59
60 @return Buffer
61
62 **/
63 VOID *
64 EFIAPI
65 InternalMemSetMem (
66 OUT VOID *Buffer,
67 IN UINTN Length,
68 IN UINT8 Value
69 );
70
71 /**
72 Fills a target buffer with a 16-bit value, and returns the target buffer.
73
74 @param Buffer Pointer to the target buffer to fill.
75 @param Length Number of bytes in Buffer to fill.
76 @param Value Value with which to fill Length bytes of Buffer.
77
78 @return Buffer
79
80 **/
81 VOID *
82 EFIAPI
83 InternalMemSetMem16 (
84 OUT VOID *Buffer,
85 IN UINTN Length,
86 IN UINT16 Value
87 );
88
89 /**
90 Fills a target buffer with a 32-bit value, and returns the target buffer.
91
92 @param Buffer Pointer to the target buffer to fill.
93 @param Length Number of bytes in Buffer to fill.
94 @param Value Value with which to fill Length bytes of Buffer.
95
96 @return Buffer
97
98 **/
99 VOID *
100 EFIAPI
101 InternalMemSetMem32 (
102 OUT VOID *Buffer,
103 IN UINTN Length,
104 IN UINT32 Value
105 );
106
107 /**
108 Fills a target buffer with a 64-bit value, and returns the target buffer.
109
110 @param Buffer Pointer to the target buffer to fill.
111 @param Length Number of bytes in Buffer to fill.
112 @param Value Value with which to fill Length bytes of Buffer.
113
114 @return Buffer
115
116 **/
117 VOID *
118 EFIAPI
119 InternalMemSetMem64 (
120 OUT VOID *Buffer,
121 IN UINTN Length,
122 IN UINT64 Value
123 );
124
125 /**
126 Set Buffer to 0 for Size bytes.
127
128 @param Buffer Memory to set.
129 @param Size Number of bytes to set
130
131 @return Buffer
132
133 **/
134 VOID *
135 EFIAPI
136 InternalMemZeroMem (
137 OUT VOID *Buffer,
138 IN UINTN Length
139 );
140
141 /**
142 Compares two memory buffers of a given length.
143
144 @param DestinationBuffer First memory buffer
145 @param SourceBuffer Second memory buffer
146 @param Length Length of DestinationBuffer and SourceBuffer memory
147 regions to compare. Must be non-zero.
148
149 @retval 0 if MemOne == MemTwo
150
151 **/
152 INTN
153 EFIAPI
154 InternalMemCompareMem (
155 IN CONST VOID *DestinationBuffer,
156 IN CONST VOID *SourceBuffer,
157 IN UINTN Length
158 );
159
160 /**
161 Scans a target buffer for an 8-bit value, and returns a pointer to the
162 matching 8-bit value in the target buffer.
163
164 @param Buffer Pointer to the target buffer to scan.
165 @param Length Number of bytes in Buffer to scan. Must be non-zero.
166 @param Value Value to search for in the target buffer.
167
168 @return Pointer to the first occurrence or NULL if not found.
169
170 **/
171 CONST VOID *
172 EFIAPI
173 InternalMemScanMem8 (
174 IN CONST VOID *Buffer,
175 IN UINTN Length,
176 IN UINT8 Value
177 );
178
179 /**
180 Scans a target buffer for a 16-bit value, and returns a pointer to the
181 matching 16-bit value in the target buffer.
182
183 @param Buffer Pointer to the target buffer to scan.
184 @param Length Number of bytes in Buffer to scan. Must be non-zero.
185 @param Value Value to search for in the target buffer.
186
187 @return Pointer to the first occurrence or NULL if not found.
188
189 **/
190 CONST VOID *
191 EFIAPI
192 InternalMemScanMem16 (
193 IN CONST VOID *Buffer,
194 IN UINTN Length,
195 IN UINT16 Value
196 );
197
198 /**
199 Scans a target buffer for a 32-bit value, and returns a pointer to the
200 matching 32-bit value in the target buffer.
201
202 @param Buffer Pointer to the target buffer to scan.
203 @param Length Number of bytes in Buffer to scan. Must be non-zero.
204 @param Value Value to search for in the target buffer.
205
206 @return Pointer to the first occurrence or NULL if not found.
207
208 **/
209 CONST VOID *
210 EFIAPI
211 InternalMemScanMem32 (
212 IN CONST VOID *Buffer,
213 IN UINTN Length,
214 IN UINT32 Value
215 );
216
217 /**
218 Scans a target buffer for a 64-bit value, and returns a pointer to the
219 matching 64-bit value in the target buffer.
220
221 @param Buffer Pointer to the target buffer to scan.
222 @param Length Number of bytes in Buffer to scan. Must be non-zero.
223 @param Value Value to search for in the target buffer.
224
225 @return Pointer to the first occurrence or NULL if not found.
226
227 **/
228 CONST VOID *
229 EFIAPI
230 InternalMemScanMem64 (
231 IN CONST VOID *Buffer,
232 IN UINTN Length,
233 IN UINT64 Value
234 );
235
236 #endif