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