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