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