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