]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h
1. Change 0 == Length style to Length == 0
[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 contain the same copy of this file:
16
17 BaseMemoryLib
18 BaseMemoryLibMmx
19 BaseMemoryLibSse2
20 BaseMemoryLibRepStr
21 BaseMemoryLibOptDxe
22 BaseMemoryLibOptPei
23 PeiMemoryLib
24 DxeMemoryLib
25
26 **/
27
28 #ifndef __MEM_LIB_INTERNALS__
29 #define __MEM_LIB_INTERNALS__
30
31 #include <Base.h>
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/BaseLib.h>
34 #include <Library/DebugLib.h>
35
36 /**
37 Copy Length bytes from Source to Destination.
38
39 @param DestinationBuffer Target of copy
40 @param SourceBuffer Place to copy from
41 @param Length Number of bytes to copy
42
43 @return Destination
44
45 **/
46 VOID *
47 EFIAPI
48 InternalMemCopyMem (
49 OUT VOID *DestinationBuffer,
50 IN CONST VOID *SourceBuffer,
51 IN UINTN Length
52 );
53
54 /**
55 Set Buffer to Value for Size bytes.
56
57 @param Buffer Memory to set.
58 @param Length Number of bytes to set
59 @param Value Value of the set operation.
60
61 @return Buffer
62
63 **/
64 VOID *
65 EFIAPI
66 InternalMemSetMem (
67 OUT VOID *Buffer,
68 IN UINTN Length,
69 IN UINT8 Value
70 );
71
72 /**
73 Fills a target buffer with a 16-bit value, and returns the target buffer.
74
75 @param Buffer Pointer to the target buffer to fill.
76 @param Length Number of bytes in Buffer to fill.
77 @param Value Value with which to fill Length bytes of Buffer.
78
79 @return Buffer
80
81 **/
82 VOID *
83 EFIAPI
84 InternalMemSetMem16 (
85 OUT VOID *Buffer,
86 IN UINTN Length,
87 IN UINT16 Value
88 );
89
90 /**
91 Fills a target buffer with a 32-bit value, and returns the target buffer.
92
93 @param Buffer Pointer to the target buffer to fill.
94 @param Length Number of bytes in Buffer to fill.
95 @param Value Value with which to fill Length bytes of Buffer.
96
97 @return Buffer
98
99 **/
100 VOID *
101 EFIAPI
102 InternalMemSetMem32 (
103 OUT VOID *Buffer,
104 IN UINTN Length,
105 IN UINT32 Value
106 );
107
108 /**
109 Fills a target buffer with a 64-bit value, and returns the target buffer.
110
111 @param Buffer Pointer to the target buffer to fill.
112 @param Length Number of bytes in Buffer to fill.
113 @param Value Value with which to fill Length bytes of Buffer.
114
115 @return Buffer
116
117 **/
118 VOID *
119 EFIAPI
120 InternalMemSetMem64 (
121 OUT VOID *Buffer,
122 IN UINTN Length,
123 IN UINT64 Value
124 );
125
126 /**
127 Set Buffer to 0 for Size bytes.
128
129 @param Buffer Memory to set.
130 @param Length Number of bytes to set
131
132 @return Buffer
133
134 **/
135 VOID *
136 EFIAPI
137 InternalMemZeroMem (
138 OUT VOID *Buffer,
139 IN UINTN Length
140 );
141
142 /**
143 Compares two memory buffers of a given length.
144
145 @param DestinationBuffer First memory buffer
146 @param SourceBuffer Second memory buffer
147 @param Length Length of DestinationBuffer and SourceBuffer memory
148 regions to compare. Must be non-zero.
149
150 @retval 0 if MemOne == MemTwo
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