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