]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h
Update copyright for files modified in this year
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / MemLibInternals.h
CommitLineData
e1f414b6 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
842f5579
A
5 BaseMemoryLib\r
6 BaseMemoryLibMmx\r
7 BaseMemoryLibSse2\r
8 BaseMemoryLibRepStr\r
2bfb6009
LG
9 BaseMemoryLibOptDxe\r
10 BaseMemoryLibOptPei\r
842f5579
A
11 PeiMemoryLib\r
12 DxeMemoryLib\r
13\r
373ade0e 14 Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
e1f414b6 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
e1f414b6 23**/\r
24\r
25#ifndef __MEM_LIB_INTERNALS__\r
26#define __MEM_LIB_INTERNALS__\r
27\r
f734a10a
A
28#include <Base.h>\r
29#include <Library/BaseMemoryLib.h>\r
30#include <Library/BaseLib.h>\r
31#include <Library/DebugLib.h>\r
32\r
e1f414b6 33\r
34/**\r
35 Copy Length bytes from Source to Destination.\r
36\r
42eedea9 37 @param DestinationBuffer Target of copy\r
38 @param SourceBuffer Place to copy from\r
e1f414b6 39 @param Length Number of bytes to copy\r
40\r
41 @return Destination\r
42\r
43**/\r
44VOID *\r
45EFIAPI\r
46InternalMemCopyMem (\r
47 OUT VOID *DestinationBuffer,\r
48 IN CONST VOID *SourceBuffer,\r
49 IN UINTN Length\r
50 );\r
51\r
52/**\r
53 Set Buffer to Value for Size bytes.\r
54\r
55 @param Buffer Memory to set.\r
38bbd3d9 56 @param Length Number of bytes to set\r
e1f414b6 57 @param Value Value of the set operation.\r
58\r
59 @return Buffer\r
60\r
61**/\r
62VOID *\r
63EFIAPI\r
64InternalMemSetMem (\r
65 OUT VOID *Buffer,\r
66 IN UINTN Length,\r
67 IN UINT8 Value\r
68 );\r
69\r
70/**\r
71 Fills a target buffer with a 16-bit value, and returns the target buffer.\r
72\r
73 @param Buffer Pointer to the target buffer to fill.\r
74 @param Length Number of bytes in Buffer to fill.\r
75 @param Value Value with which to fill Length bytes of Buffer.\r
76\r
77 @return Buffer\r
78\r
79**/\r
80VOID *\r
81EFIAPI\r
82InternalMemSetMem16 (\r
83 OUT VOID *Buffer,\r
84 IN UINTN Length,\r
85 IN UINT16 Value\r
86 );\r
87\r
88/**\r
89 Fills a target buffer with a 32-bit value, and returns the target buffer.\r
90\r
91 @param Buffer Pointer to the target buffer to fill.\r
92 @param Length Number of bytes in Buffer to fill.\r
93 @param Value Value with which to fill Length bytes of Buffer.\r
94\r
95 @return Buffer\r
96\r
97**/\r
98VOID *\r
99EFIAPI\r
100InternalMemSetMem32 (\r
101 OUT VOID *Buffer,\r
102 IN UINTN Length,\r
103 IN UINT32 Value\r
104 );\r
105\r
106/**\r
107 Fills a target buffer with a 64-bit value, and returns the target buffer.\r
108\r
109 @param Buffer Pointer to the target buffer to fill.\r
110 @param Length Number of bytes in Buffer to fill.\r
111 @param Value Value with which to fill Length bytes of Buffer.\r
112\r
113 @return Buffer\r
114\r
115**/\r
116VOID *\r
117EFIAPI\r
118InternalMemSetMem64 (\r
119 OUT VOID *Buffer,\r
120 IN UINTN Length,\r
121 IN UINT64 Value\r
122 );\r
123\r
124/**\r
125 Set Buffer to 0 for Size bytes.\r
126\r
127 @param Buffer Memory to set.\r
38bbd3d9 128 @param Length Number of bytes to set\r
e1f414b6 129\r
130 @return Buffer\r
131\r
132**/\r
133VOID *\r
134EFIAPI\r
135InternalMemZeroMem (\r
136 OUT VOID *Buffer,\r
137 IN UINTN Length\r
138 );\r
139\r
140/**\r
141 Compares two memory buffers of a given length.\r
142\r
143 @param DestinationBuffer First memory buffer\r
144 @param SourceBuffer Second memory buffer\r
145 @param Length Length of DestinationBuffer and SourceBuffer memory\r
146 regions to compare. Must be non-zero.\r
147\r
d531bfee 148 @return 0 All Length bytes of the two buffers are identical.\r
149 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first\r
150 mismatched byte in DestinationBuffer.\r
e1f414b6 151\r
152**/\r
153INTN\r
154EFIAPI\r
155InternalMemCompareMem (\r
156 IN CONST VOID *DestinationBuffer,\r
157 IN CONST VOID *SourceBuffer,\r
158 IN UINTN Length\r
159 );\r
160\r
161/**\r
162 Scans a target buffer for an 8-bit value, and returns a pointer to the\r
163 matching 8-bit value in the target buffer.\r
164\r
165 @param Buffer Pointer to the target buffer to scan.\r
166 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
167 @param Value Value to search for in the target buffer.\r
168\r
169 @return Pointer to the first occurrence or NULL if not found.\r
170\r
171**/\r
172CONST VOID *\r
173EFIAPI\r
174InternalMemScanMem8 (\r
175 IN CONST VOID *Buffer,\r
176 IN UINTN Length,\r
177 IN UINT8 Value\r
178 );\r
179\r
180/**\r
181 Scans a target buffer for a 16-bit value, and returns a pointer to the\r
182 matching 16-bit value in the target buffer.\r
183\r
184 @param Buffer Pointer to the target buffer to scan.\r
185 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
186 @param Value Value to search for in the target buffer.\r
187\r
188 @return Pointer to the first occurrence or NULL if not found.\r
189\r
190**/\r
191CONST VOID *\r
192EFIAPI\r
193InternalMemScanMem16 (\r
194 IN CONST VOID *Buffer,\r
195 IN UINTN Length,\r
196 IN UINT16 Value\r
197 );\r
198\r
199/**\r
200 Scans a target buffer for a 32-bit value, and returns a pointer to the\r
201 matching 32-bit value in the target buffer.\r
202\r
203 @param Buffer Pointer to the target buffer to scan.\r
204 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
205 @param Value Value to search for in the target buffer.\r
206\r
207 @return Pointer to the first occurrence or NULL if not found.\r
208\r
209**/\r
210CONST VOID *\r
211EFIAPI\r
212InternalMemScanMem32 (\r
213 IN CONST VOID *Buffer,\r
214 IN UINTN Length,\r
215 IN UINT32 Value\r
216 );\r
217\r
218/**\r
219 Scans a target buffer for a 64-bit value, and returns a pointer to the\r
220 matching 64-bit value in the target buffer.\r
221\r
222 @param Buffer Pointer to the target buffer to scan.\r
223 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
224 @param Value Value to search for in the target buffer.\r
225\r
226 @return Pointer to the first occurrence or NULL if not found.\r
227\r
228**/\r
229CONST VOID *\r
230EFIAPI\r
231InternalMemScanMem64 (\r
232 IN CONST VOID *Buffer,\r
233 IN UINTN Length,\r
234 IN UINT64 Value\r
235 );\r
236\r
237#endif\r