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