]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h
Update copyright for files modified in this year
[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
2bfb6009 4 The following BaseMemoryLib instances contain the same copy of this file:\r
c5ecf6c1 5 BaseMemoryLib\r
6 BaseMemoryLibMmx\r
7 BaseMemoryLibSse2\r
8 BaseMemoryLibRepStr\r
2bfb6009
LG
9 BaseMemoryLibOptDxe\r
10 BaseMemoryLibOptPei\r
c5ecf6c1 11 PeiMemoryLib\r
12 DxeMemoryLib\r
13\r
373ade0e 14 Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
d531bfee 15 All rights reserved. This program and the accompanying materials\r
16 are licensed and made available under the terms and conditions of the BSD License\r
17 which accompanies this distribution. The full text of the license may be found at\r
18 http://opensource.org/licenses/bsd-license.php\r
19\r
20 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
21 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
22\r
c5ecf6c1 23**/\r
24\r
25#ifndef __MEM_LIB_INTERNALS__\r
26#define __MEM_LIB_INTERNALS__\r
27\r
38bbd3d9 28#include <Base.h>\r
c5ecf6c1 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
42eedea9 36 @param DestinationBuffer Target of copy\r
37 @param SourceBuffer Place to copy from\r
c5ecf6c1 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
38bbd3d9 55 @param Length Number of bytes to set\r
c5ecf6c1 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
38bbd3d9 127 @param Length Number of bytes to set\r
c5ecf6c1 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
d531bfee 147 @return 0 All Length bytes of the two buffers are identical.\r
148 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first\r
149 mismatched byte in DestinationBuffer.\r
c5ecf6c1 150\r
151**/\r
152INTN\r
153EFIAPI\r
154InternalMemCompareMem (\r
155 IN CONST VOID *DestinationBuffer,\r
156 IN CONST VOID *SourceBuffer,\r
157 IN UINTN Length\r
158 );\r
159\r
160/**\r
161 Scans a target buffer for an 8-bit value, and returns a pointer to the\r
162 matching 8-bit value in the target buffer.\r
163\r
164 @param Buffer Pointer to the target buffer to scan.\r
165 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
166 @param Value Value to search for in the target buffer.\r
167\r
168 @return Pointer to the first occurrence or NULL if not found.\r
169\r
170**/\r
171CONST VOID *\r
172EFIAPI\r
173InternalMemScanMem8 (\r
174 IN CONST VOID *Buffer,\r
175 IN UINTN Length,\r
176 IN UINT8 Value\r
177 );\r
178\r
179/**\r
180 Scans a target buffer for a 16-bit value, and returns a pointer to the\r
181 matching 16-bit value in the target buffer.\r
182\r
183 @param Buffer Pointer to the target buffer to scan.\r
184 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
185 @param Value Value to search for in the target buffer.\r
186\r
187 @return Pointer to the first occurrence or NULL if not found.\r
188\r
189**/\r
190CONST VOID *\r
191EFIAPI\r
192InternalMemScanMem16 (\r
193 IN CONST VOID *Buffer,\r
194 IN UINTN Length,\r
195 IN UINT16 Value\r
196 );\r
197\r
198/**\r
199 Scans a target buffer for a 32-bit value, and returns a pointer to the\r
200 matching 32-bit value in the target buffer.\r
201\r
202 @param Buffer Pointer to the target buffer to scan.\r
203 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
204 @param Value Value to search for in the target buffer.\r
205\r
206 @return Pointer to the first occurrence or NULL if not found.\r
207\r
208**/\r
209CONST VOID *\r
210EFIAPI\r
211InternalMemScanMem32 (\r
212 IN CONST VOID *Buffer,\r
213 IN UINTN Length,\r
214 IN UINT32 Value\r
215 );\r
216\r
217/**\r
218 Scans a target buffer for a 64-bit value, and returns a pointer to the\r
219 matching 64-bit value in the target buffer.\r
220\r
221 @param Buffer Pointer to the target buffer to scan.\r
222 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
223 @param Value Value to search for in the target buffer.\r
224\r
225 @return Pointer to the first occurrence or NULL if not found.\r
226\r
227**/\r
228CONST VOID *\r
229EFIAPI\r
230InternalMemScanMem64 (\r
231 IN CONST VOID *Buffer,\r
232 IN UINTN Length,\r
233 IN UINT64 Value\r
234 );\r
235\r
236#endif\r