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