]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h
Code scrub:
[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
38bbd3d9 29#include <Base.h>\r
c5ecf6c1 30#include <Library/BaseMemoryLib.h>\r
31#include <Library/BaseLib.h>\r
32#include <Library/DebugLib.h>\r
33\r
34/**\r
35 Copy Length bytes from Source to Destination.\r
36\r
37 @param Destination Target of copy\r
38 @param Source Place to copy from\r
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
c5ecf6c1 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
c5ecf6c1 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
148 @retval 0 if MemOne == MemTwo\r
149\r
150**/\r
151INTN\r
152EFIAPI\r
153InternalMemCompareMem (\r
154 IN CONST VOID *DestinationBuffer,\r
155 IN CONST VOID *SourceBuffer,\r
156 IN UINTN Length\r
157 );\r
158\r
159/**\r
160 Scans a target buffer for an 8-bit value, and returns a pointer to the\r
161 matching 8-bit value in the target buffer.\r
162\r
163 @param Buffer Pointer to the target buffer to scan.\r
164 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
165 @param Value Value to search for in the target buffer.\r
166\r
167 @return Pointer to the first occurrence or NULL if not found.\r
168\r
169**/\r
170CONST VOID *\r
171EFIAPI\r
172InternalMemScanMem8 (\r
173 IN CONST VOID *Buffer,\r
174 IN UINTN Length,\r
175 IN UINT8 Value\r
176 );\r
177\r
178/**\r
179 Scans a target buffer for a 16-bit value, and returns a pointer to the\r
180 matching 16-bit value in the target buffer.\r
181\r
182 @param Buffer Pointer to the target buffer to scan.\r
183 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
184 @param Value Value to search for in the target buffer.\r
185\r
186 @return Pointer to the first occurrence or NULL if not found.\r
187\r
188**/\r
189CONST VOID *\r
190EFIAPI\r
191InternalMemScanMem16 (\r
192 IN CONST VOID *Buffer,\r
193 IN UINTN Length,\r
194 IN UINT16 Value\r
195 );\r
196\r
197/**\r
198 Scans a target buffer for a 32-bit value, and returns a pointer to the\r
199 matching 32-bit value in the target buffer.\r
200\r
201 @param Buffer Pointer to the target buffer to scan.\r
202 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
203 @param Value Value to search for in the target buffer.\r
204\r
205 @return Pointer to the first occurrence or NULL if not found.\r
206\r
207**/\r
208CONST VOID *\r
209EFIAPI\r
210InternalMemScanMem32 (\r
211 IN CONST VOID *Buffer,\r
212 IN UINTN Length,\r
213 IN UINT32 Value\r
214 );\r
215\r
216/**\r
217 Scans a target buffer for a 64-bit value, and returns a pointer to the\r
218 matching 64-bit value in the target buffer.\r
219\r
220 @param Buffer Pointer to the target buffer to scan.\r
221 @param Length Number of bytes in Buffer to scan. Must be non-zero.\r
222 @param Value Value to search for in the target buffer.\r
223\r
224 @return Pointer to the first occurrence or NULL if not found.\r
225\r
226**/\r
227CONST VOID *\r
228EFIAPI\r
229InternalMemScanMem64 (\r
230 IN CONST VOID *Buffer,\r
231 IN UINTN Length,\r
232 IN UINT64 Value\r
233 );\r
234\r
235#endif\r