Lines Matching +full:is +full:- +full:decoded +full:- +full:cs
3 functions, file path functions, and CPU architecture-specific functions.
5 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
6 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
10 SPDX-License-Identifier: BSD-2-Clause-Patent
18 // Definitions for architecture-specific types
22 /// The IA-32 architecture context buffer used by SetJump() and LongJump().
54 UINT8 XmmBuffer[160]; ///< XMM6-XMM15.
132 /// The RISC-V architecture context buffer used by SetJump() and LongJump().
161 Returns the length of a Null-terminated Unicode string.
163 This function is similar as strlen_s defined in C11.
165 If String is not aligned on a 16-bit boundary, then ASSERT().
167 @param String A pointer to a Null-terminated Unicode string.
171 @retval 0 If String is NULL.
172 @retval MaxSize If there is no null character in the first MaxSize characters of String.
184 Returns the size of a Null-terminated Unicode string in bytes, including the
187 This function returns the size of the Null-terminated Unicode string
190 If String is not aligned on a 16-bit boundary, then ASSERT().
192 @param String A pointer to a Null-terminated Unicode string.
196 @retval 0 If String is NULL.
198 If there is no Null terminator in the first MaxSize characters of
200 @return The size of the Null-terminated Unicode string in bytes, including
215 This function is similar as strcpy_s defined in C11.
217 If Destination is not aligned on a 16-bit boundary, then ASSERT().
218 If Source is not aligned on a 16-bit boundary, then ASSERT().
220 If an error is returned, then the Destination is unmodified.
222 @param Destination A pointer to a Null-terminated Unicode string.
225 @param Source A pointer to a Null-terminated Unicode string.
227 @retval RETURN_SUCCESS String is copied.
228 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
229 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
230 If Source is NULL.
231 If PcdMaximumUnicodeStringLength is not zero,
232 and DestMax is greater than
234 If DestMax is 0.
247 Source to the array pointed to by Destination. If no null char is copied from
248 Source, then Destination[Length] is always set to null.
250 This function is similar as strncpy_s defined in C11.
252 If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
253 If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
255 If an error is returned, then the Destination is unmodified.
257 @param Destination A pointer to a Null-terminated Unicode string.
260 @param Source A pointer to a Null-terminated Unicode string.
263 @retval RETURN_SUCCESS String is copied.
264 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
266 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
267 If Source is NULL.
268 If PcdMaximumUnicodeStringLength is not zero,
269 and DestMax is greater than
271 If DestMax is 0.
287 This function is similar as strcat_s defined in C11.
289 If Destination is not aligned on a 16-bit boundary, then ASSERT().
290 If Source is not aligned on a 16-bit boundary, then ASSERT().
292 If an error is returned, then the Destination is unmodified.
294 @param Destination A pointer to a Null-terminated Unicode string.
297 @param Source A pointer to a Null-terminated Unicode string.
299 @retval RETURN_SUCCESS String is appended.
300 @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
302 @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
304 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
305 If Source is NULL.
306 If PcdMaximumUnicodeStringLength is not zero,
307 and DestMax is greater than
309 If DestMax is 0.
322 Source to the end of the string pointed to by Destination. If no null char is
323 copied from Source, then Destination[StrLen(Destination) + Length] is always
326 This function is similar as strncat_s defined in C11.
328 If Destination is not aligned on a 16-bit boundary, then ASSERT().
329 If Source is not aligned on a 16-bit boundary, then ASSERT().
331 If an error is returned, then the Destination is unmodified.
333 @param Destination A pointer to a Null-terminated Unicode string.
336 @param Source A pointer to a Null-terminated Unicode string.
339 @retval RETURN_SUCCESS String is appended.
340 @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
342 @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
344 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
345 If Source is NULL.
346 If PcdMaximumUnicodeStringLength is not zero,
347 and DestMax is greater than
349 If DestMax is 0.
362 Convert a Null-terminated Unicode decimal string to a value of type UINTN.
366 input Unicode string String is:
370 The valid decimal digit character is in the range [0-9]. The function will
373 be ignored. Then, the function stops at the first character that is a not a
374 valid decimal character or a Null-terminator, whichever one comes first.
376 If String is not aligned in a 16-bit boundary, then ASSERT().
378 If String has no valid decimal digits in the above format, then 0 is stored
381 MAX_UINTN is stored at the location pointed to by Data.
383 If EndPointer is not NULL, a pointer to the character that stopped the scan
384 is stored at the location pointed to by EndPointer. If String has no valid
385 decimal digits right after the optional pad spaces, the value of String is
388 @param String Pointer to a Null-terminated Unicode string.
392 @retval RETURN_SUCCESS Value is translated from String.
393 @retval RETURN_INVALID_PARAMETER If String is NULL.
394 If Data is NULL.
395 If PcdMaximumUnicodeStringLength is not
399 Null-terminator.
413 Convert a Null-terminated Unicode decimal string to a value of type UINT64.
417 input Unicode string String is:
421 The valid decimal digit character is in the range [0-9]. The function will
424 be ignored. Then, the function stops at the first character that is a not a
425 valid decimal character or a Null-terminator, whichever one comes first.
427 If String is not aligned in a 16-bit boundary, then ASSERT().
429 If String has no valid decimal digits in the above format, then 0 is stored
432 MAX_UINT64 is stored at the location pointed to by Data.
434 If EndPointer is not NULL, a pointer to the character that stopped the scan
435 is stored at the location pointed to by EndPointer. If String has no valid
436 decimal digits right after the optional pad spaces, the value of String is
439 @param String Pointer to a Null-terminated Unicode string.
443 @retval RETURN_SUCCESS Value is translated from String.
444 @retval RETURN_INVALID_PARAMETER If String is NULL.
445 If Data is NULL.
446 If PcdMaximumUnicodeStringLength is not
450 Null-terminator.
464 Convert a Null-terminated Unicode hexadecimal string to a value of type
469 the input Unicode string String is:
473 The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
474 The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
480 the first character that is a not a valid hexadecimal character or NULL,
483 If String is not aligned in a 16-bit boundary, then ASSERT().
485 If String has no valid hexadecimal digits in the above format, then 0 is
488 MAX_UINTN is stored at the location pointed to by Data.
490 If EndPointer is not NULL, a pointer to the character that stopped the scan
491 is stored at the location pointed to by EndPointer. If String has no valid
493 is stored at the location pointed to by EndPointer.
495 @param String Pointer to a Null-terminated Unicode string.
499 @retval RETURN_SUCCESS Value is translated from String.
500 @retval RETURN_INVALID_PARAMETER If String is NULL.
501 If Data is NULL.
502 If PcdMaximumUnicodeStringLength is not
506 Null-terminator.
520 Convert a Null-terminated Unicode hexadecimal string to a value of type
525 the input Unicode string String is:
529 The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
530 The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
536 the first character that is a not a valid hexadecimal character or NULL,
539 If String is not aligned in a 16-bit boundary, then ASSERT().
541 If String has no valid hexadecimal digits in the above format, then 0 is
544 MAX_UINT64 is stored at the location pointed to by Data.
546 If EndPointer is not NULL, a pointer to the character that stopped the scan
547 is stored at the location pointed to by EndPointer. If String has no valid
549 is stored at the location pointed to by EndPointer.
551 @param String Pointer to a Null-terminated Unicode string.
555 @retval RETURN_SUCCESS Value is translated from String.
556 @retval RETURN_INVALID_PARAMETER If String is NULL.
557 If Data is NULL.
558 If PcdMaximumUnicodeStringLength is not
562 Null-terminator.
576 Returns the length of a Null-terminated Ascii string.
578 This function is similar as strlen_s defined in C11.
580 @param String A pointer to a Null-terminated Ascii string.
584 @retval 0 If String is NULL.
585 @retval MaxSize If there is no null character in the first MaxSize characters of String.
597 Returns the size of a Null-terminated Ascii string in bytes, including the
600 This function returns the size of the Null-terminated Ascii string specified
603 @param String A pointer to a Null-terminated Ascii string.
607 @retval 0 If String is NULL.
609 If there is no Null terminator in the first MaxSize characters of
611 @return The size of the Null-terminated Ascii string in bytes, including the
626 This function is similar as strcpy_s defined in C11.
628 If an error is returned, then the Destination is unmodified.
630 @param Destination A pointer to a Null-terminated Ascii string.
633 @param Source A pointer to a Null-terminated Ascii string.
635 @retval RETURN_SUCCESS String is copied.
636 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
637 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
638 If Source is NULL.
639 If PcdMaximumAsciiStringLength is not zero,
640 and DestMax is greater than
642 If DestMax is 0.
655 Source to the array pointed to by Destination. If no null char is copied from
656 Source, then Destination[Length] is always set to null.
658 This function is similar as strncpy_s defined in C11.
660 If an error is returned, then the Destination is unmodified.
662 @param Destination A pointer to a Null-terminated Ascii string.
665 @param Source A pointer to a Null-terminated Ascii string.
668 @retval RETURN_SUCCESS String is copied.
669 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
671 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
672 If Source is NULL.
673 If PcdMaximumAsciiStringLength is not zero,
674 and DestMax is greater than
676 If DestMax is 0.
692 This function is similar as strcat_s defined in C11.
694 If an error is returned, then the Destination is unmodified.
696 @param Destination A pointer to a Null-terminated Ascii string.
699 @param Source A pointer to a Null-terminated Ascii string.
701 @retval RETURN_SUCCESS String is appended.
702 @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
704 @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
706 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
707 If Source is NULL.
708 If PcdMaximumAsciiStringLength is not zero,
709 and DestMax is greater than
711 If DestMax is 0.
724 Source to the end of the string pointed to by Destination. If no null char is
725 copied from Source, then Destination[StrLen(Destination) + Length] is always
728 This function is similar as strncat_s defined in C11.
730 If an error is returned, then the Destination is unmodified.
732 @param Destination A pointer to a Null-terminated Ascii string.
735 @param Source A pointer to a Null-terminated Ascii string.
738 @retval RETURN_SUCCESS String is appended.
739 @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
741 @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
743 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
744 If Source is NULL.
745 If PcdMaximumAsciiStringLength is not zero,
746 and DestMax is greater than
748 If DestMax is 0.
761 Convert a Null-terminated Ascii decimal string to a value of type UINTN.
765 input Ascii string String is:
769 The valid decimal digit character is in the range [0-9]. The function will
772 be ignored. Then, the function stops at the first character that is a not a
773 valid decimal character or a Null-terminator, whichever one comes first.
775 If String has no valid decimal digits in the above format, then 0 is stored
778 MAX_UINTN is stored at the location pointed to by Data.
780 If EndPointer is not NULL, a pointer to the character that stopped the scan
781 is stored at the location pointed to by EndPointer. If String has no valid
782 decimal digits right after the optional pad spaces, the value of String is
785 @param String Pointer to a Null-terminated Ascii string.
789 @retval RETURN_SUCCESS Value is translated from String.
790 @retval RETURN_INVALID_PARAMETER If String is NULL.
791 If Data is NULL.
792 If PcdMaximumAsciiStringLength is not zero,
796 Null-terminator.
810 Convert a Null-terminated Ascii decimal string to a value of type UINT64.
814 input Ascii string String is:
818 The valid decimal digit character is in the range [0-9]. The function will
821 be ignored. Then, the function stops at the first character that is a not a
822 valid decimal character or a Null-terminator, whichever one comes first.
824 If String has no valid decimal digits in the above format, then 0 is stored
827 MAX_UINT64 is stored at the location pointed to by Data.
829 If EndPointer is not NULL, a pointer to the character that stopped the scan
830 is stored at the location pointed to by EndPointer. If String has no valid
831 decimal digits right after the optional pad spaces, the value of String is
834 @param String Pointer to a Null-terminated Ascii string.
838 @retval RETURN_SUCCESS Value is translated from String.
839 @retval RETURN_INVALID_PARAMETER If String is NULL.
840 If Data is NULL.
841 If PcdMaximumAsciiStringLength is not zero,
845 Null-terminator.
859 Convert a Null-terminated Ascii hexadecimal string to a value of type UINTN.
863 the input Ascii string String is:
867 The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
868 The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If
874 character that is a not a valid hexadecimal character or Null-terminator,
877 If String has no valid hexadecimal digits in the above format, then 0 is
880 MAX_UINTN is stored at the location pointed to by Data.
882 If EndPointer is not NULL, a pointer to the character that stopped the scan
883 is stored at the location pointed to by EndPointer. If String has no valid
885 is stored at the location pointed to by EndPointer.
887 @param String Pointer to a Null-terminated Ascii string.
891 @retval RETURN_SUCCESS Value is translated from String.
892 @retval RETURN_INVALID_PARAMETER If String is NULL.
893 If Data is NULL.
894 If PcdMaximumAsciiStringLength is not zero,
898 Null-terminator.
912 Convert a Null-terminated Ascii hexadecimal string to a value of type UINT64.
916 the input Ascii string String is:
920 The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
921 The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If
927 character that is a not a valid hexadecimal character or Null-terminator,
930 If String has no valid hexadecimal digits in the above format, then 0 is
933 MAX_UINT64 is stored at the location pointed to by Data.
935 If EndPointer is not NULL, a pointer to the character that stopped the scan
936 is stored at the location pointed to by EndPointer. If String has no valid
938 is stored at the location pointed to by EndPointer.
940 @param String Pointer to a Null-terminated Ascii string.
944 @retval RETURN_SUCCESS Value is translated from String.
945 @retval RETURN_INVALID_PARAMETER If String is NULL.
946 If Data is NULL.
947 If PcdMaximumAsciiStringLength is not zero,
951 Null-terminator.
968 [ATTENTION] This function is deprecated for security reason.
970 Copies one Null-terminated Unicode string to another Null-terminated Unicode
977 If Destination is NULL, then ASSERT().
978 If Destination is not aligned on a 16-bit boundary, then ASSERT().
979 If Source is NULL, then ASSERT().
980 If Source is not aligned on a 16-bit boundary, then ASSERT().
982 If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
984 Null-terminator, then ASSERT().
986 @param Destination The pointer to a Null-terminated Unicode string.
987 @param Source The pointer to a Null-terminated Unicode string.
1001 [ATTENTION] This function is deprecated for security reason.
1003 Copies up to a specified length from one Null-terminated Unicode string to
1004 another Null-terminated Unicode string and returns the new Unicode string.
1008 characters are copied from Source to Destination. If Length is 0, then
1009 Destination is returned unmodified. If Length is greater that the number of
1010 Unicode characters in Source, then Destination is padded with Null Unicode
1014 If Length > 0 and Destination is NULL, then ASSERT().
1015 If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
1016 If Length > 0 and Source is NULL, then ASSERT().
1017 If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
1019 If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
1021 If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
1022 PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
1025 @param Destination The pointer to a Null-terminated Unicode string.
1026 @param Source The pointer to a Null-terminated Unicode string.
1042 Returns the length of a Null-terminated Unicode string.
1044 This function returns the number of Unicode characters in the Null-terminated
1047 If String is NULL, then ASSERT().
1048 If String is not aligned on a 16-bit boundary, then ASSERT().
1049 If PcdMaximumUnicodeStringLength is not zero, and String contains more than
1051 Null-terminator, then ASSERT().
1053 @param String Pointer to a Null-terminated Unicode string.
1066 Returns the size of a Null-terminated Unicode string in bytes, including the
1069 This function returns the size, in bytes, of the Null-terminated Unicode string
1072 If String is NULL, then ASSERT().
1073 If String is not aligned on a 16-bit boundary, then ASSERT().
1074 If PcdMaximumUnicodeStringLength is not zero, and String contains more than
1076 Null-terminator, then ASSERT().
1078 @param String The pointer to a Null-terminated Unicode string.
1091 Compares two Null-terminated Unicode strings, and returns the difference
1094 This function compares the Null-terminated Unicode string FirstString to the
1095 Null-terminated Unicode string SecondString. If FirstString is identical to
1096 SecondString, then 0 is returned. Otherwise, the value returned is the first
1100 If FirstString is NULL, then ASSERT().
1101 If FirstString is not aligned on a 16-bit boundary, then ASSERT().
1102 If SecondString is NULL, then ASSERT().
1103 If SecondString is not aligned on a 16-bit boundary, then ASSERT().
1104 If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more
1106 Null-terminator, then ASSERT().
1107 If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more
1109 Null-terminator, then ASSERT().
1111 @param FirstString The pointer to a Null-terminated Unicode string.
1112 @param SecondString The pointer to a Null-terminated Unicode string.
1114 @retval 0 FirstString is identical to SecondString.
1115 @return others FirstString is not identical to SecondString.
1127 Compares up to a specified length the contents of two Null-terminated Unicode strings,
1130 This function compares the Null-terminated Unicode string FirstString to the
1131 Null-terminated Unicode string SecondString. At most, Length Unicode
1132 characters will be compared. If Length is 0, then 0 is returned. If
1133 FirstString is identical to SecondString, then 0 is returned. Otherwise, the
1134 value returned is the first mismatched Unicode character in SecondString
1137 If Length > 0 and FirstString is NULL, then ASSERT().
1138 If Length > 0 and FirstString is not aligned on a 16-bit boundary, then ASSERT().
1139 If Length > 0 and SecondString is NULL, then ASSERT().
1140 If Length > 0 and SecondString is not aligned on a 16-bit boundary, then ASSERT().
1141 If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
1143 If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more than
1144 PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
1146 If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more than
1147 PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
1150 @param FirstString The pointer to a Null-terminated Unicode string.
1151 @param SecondString The pointer to a Null-terminated Unicode string.
1154 @retval 0 FirstString is identical to SecondString.
1155 @return others FirstString is not identical to SecondString.
1170 [ATTENTION] This function is deprecated for security reason.
1172 Concatenates one Null-terminated Unicode string to another Null-terminated
1175 This function concatenates two Null-terminated Unicode strings. The contents
1176 of Null-terminated Unicode string Source are concatenated to the end of
1177 Null-terminated Unicode string Destination. The Null-terminated concatenated
1178 Unicode String is returned. If Source and Destination overlap, then the
1181 If Destination is NULL, then ASSERT().
1182 If Destination is not aligned on a 16-bit boundary, then ASSERT().
1183 If Source is NULL, then ASSERT().
1184 If Source is not aligned on a 16-bit boundary, then ASSERT().
1186 If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
1188 Null-terminator, then ASSERT().
1189 If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
1191 Null-terminator, then ASSERT().
1192 If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
1195 Null-terminator, then ASSERT().
1197 @param Destination The pointer to a Null-terminated Unicode string.
1198 @param Source The pointer to a Null-terminated Unicode string.
1212 [ATTENTION] This function is deprecated for security reason.
1214 Concatenates up to a specified length one Null-terminated Unicode to the end
1215 of another Null-terminated Unicode string, and returns the concatenated
1218 This function concatenates two Null-terminated Unicode strings. The contents
1219 of Null-terminated Unicode string Source are concatenated to the end of
1220 Null-terminated Unicode string Destination, and Destination is returned. At
1222 Destination, and Destination is always Null-terminated. If Length is 0, then
1223 Destination is returned unmodified. If Source and Destination overlap, then
1226 If Destination is NULL, then ASSERT().
1227 If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
1228 If Length > 0 and Source is NULL, then ASSERT().
1229 If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
1231 If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
1233 If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
1235 Null-terminator, then ASSERT().
1236 If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
1238 Null-terminator, then ASSERT().
1239 If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
1241 Unicode characters, not including the Null-terminator, then ASSERT().
1243 @param Destination The pointer to a Null-terminated Unicode string.
1244 @param Source The pointer to a Null-terminated Unicode string.
1261 Returns the first occurrence of a Null-terminated Unicode sub-string
1262 in a Null-terminated Unicode string.
1264 This function scans the contents of the Null-terminated Unicode string
1266 If SearchString is not found in String, then NULL is returned. If
1267 the length of SearchString is zero, then String is returned.
1269 If String is NULL, then ASSERT().
1270 If String is not aligned on a 16-bit boundary, then ASSERT().
1271 If SearchString is NULL, then ASSERT().
1272 If SearchString is not aligned on a 16-bit boundary, then ASSERT().
1274 If PcdMaximumUnicodeStringLength is not zero, and SearchString
1276 characters, not including the Null-terminator, then ASSERT().
1278 @param String The pointer to a Null-terminated Unicode string.
1279 @param SearchString The pointer to a Null-terminated Unicode string to search for.
1282 @return others If there is a match.
1293 Convert a Null-terminated Unicode decimal string to a value of
1298 of the input Unicode string String is:
1302 The valid decimal digit character is in the range [0-9]. The
1306 stops at the first character that is a not a valid decimal character
1307 or a Null-terminator, whichever one comes first.
1309 If String is NULL, then ASSERT().
1310 If String is not aligned in a 16-bit boundary, then ASSERT().
1311 If String has only pad spaces, then 0 is returned.
1313 then 0 is returned.
1315 to the range defined by UINTN, then MAX_UINTN is returned.
1317 If PcdMaximumUnicodeStringLength is not zero, and String contains
1319 the Null-terminator, then ASSERT().
1321 @param String The pointer to a Null-terminated Unicode string.
1333 Convert a Null-terminated Unicode decimal string to a value of
1338 of the input Unicode string String is:
1342 The valid decimal digit character is in the range [0-9]. The
1346 stops at the first character that is a not a valid decimal character
1347 or a Null-terminator, whichever one comes first.
1349 If String is NULL, then ASSERT().
1350 If String is not aligned in a 16-bit boundary, then ASSERT().
1351 If String has only pad spaces, then 0 is returned.
1353 then 0 is returned.
1355 to the range defined by UINT64, then MAX_UINT64 is returned.
1357 If PcdMaximumUnicodeStringLength is not zero, and String contains
1359 the Null-terminator, then ASSERT().
1361 @param String The pointer to a Null-terminated Unicode string.
1374 Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
1378 The format of the input Unicode string String is:
1382 The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
1383 The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
1389 that is a not a valid hexadecimal character or NULL, whichever one comes first.
1391 If String is NULL, then ASSERT().
1392 If String is not aligned in a 16-bit boundary, then ASSERT().
1393 If String has only pad spaces, then zero is returned.
1395 then zero is returned.
1397 UINTN, then MAX_UINTN is returned.
1399 If PcdMaximumUnicodeStringLength is not zero, and String contains more than
1400 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
1403 @param String The pointer to a Null-terminated Unicode string.
1416 Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
1420 The format of the input Unicode string String is
1424 The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
1425 The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
1430 first valid hexadecimal digit. Then, the function stops at the first character that is
1433 If String is NULL, then ASSERT().
1434 If String is not aligned in a 16-bit boundary, then ASSERT().
1435 If String has only pad spaces, then zero is returned.
1437 then zero is returned.
1439 UINT64, then MAX_UINT64 is returned.
1441 If PcdMaximumUnicodeStringLength is not zero, and String contains more than
1442 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
1445 @param String The pointer to a Null-terminated Unicode string.
1457 Convert a Null-terminated Unicode string to IPv6 address and prefix length.
1461 by String. The format of the input Unicode string String is as follows:
1465 X contains one to four hexadecimal digit characters in the range [0-9], [a-f] and
1466 [A-F]. X is converted to a value of type UINT16, whose low byte is stored in low
1467 memory address and high byte is stored in high memory address. P contains decimal
1468 digit characters in the range [0-9]. The running zero in the beginning of P will
1469 be ignored. /P is optional.
1471 When /P is not in the String, the function stops at the first character that is
1474 When /P is in the String, the function stops at the first character that is not
1475 a valid decimal digit character after P is converted.
1480 If String is not aligned in a 16-bit boundary, then ASSERT().
1482 If EndPointer is not NULL and Address is translated from String, a pointer
1483 to the character that stopped the scan is stored at the location pointed to
1486 @param String Pointer to a Null-terminated Unicode string.
1490 length. MAX_UINT8 is returned when /P is
1493 @retval RETURN_SUCCESS Address is translated from String.
1494 @retval RETURN_INVALID_PARAMETER If String is NULL.
1495 If Data is NULL.
1499 is not less than 8.
1500 If P starts with character that is not a
1516 Convert a Null-terminated Unicode string to IPv4 address and prefix length.
1520 by String. The format of the input Unicode string String is as follows:
1524 D and P are decimal digit characters in the range [0-9]. The running zero in
1525 the beginning of D and P will be ignored. /P is optional.
1527 When /P is not in the String, the function stops at the first character that is
1530 When /P is in the String, the function stops at the first character that is not
1531 a valid decimal digit character after P is converted.
1533 If String is not aligned in a 16-bit boundary, then ASSERT().
1535 If EndPointer is not NULL and Address is translated from String, a pointer
1536 to the character that stopped the scan is stored at the location pointed to
1539 @param String Pointer to a Null-terminated Unicode string.
1543 length. MAX_UINT8 is returned when /P is
1546 @retval RETURN_SUCCESS Address is translated from String.
1547 @retval RETURN_INVALID_PARAMETER If String is NULL.
1548 If Data is NULL.
1549 @retval RETURN_UNSUPPORTED If String is not in the correct format.
1568 Convert a Null-terminated Unicode GUID string to a value of type
1575 aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
1577 The pairs aa - pp are two characters in the range [0-9], [a-f] and
1578 [A-F], with each pair representing a single byte hexadecimal value.
1580 The mapping between String and the EFI_GUID structure is as follows:
1598 If String is not aligned in a 16-bit boundary, then ASSERT().
1600 @param String Pointer to a Null-terminated Unicode string.
1603 @retval RETURN_SUCCESS Guid is translated from String.
1604 @retval RETURN_INVALID_PARAMETER If String is NULL.
1605 If Data is NULL.
1606 @retval RETURN_UNSUPPORTED If String is not as the above format.
1617 Convert a Null-terminated Unicode hexadecimal string to a byte array.
1621 the input Unicode string String is:
1625 X is a hexadecimal digit character in the range [0-9], [a-f] and [A-F].
1630 If String is not aligned in a 16-bit boundary, then ASSERT().
1632 @param String Pointer to a Null-terminated Unicode string.
1637 @retval RETURN_SUCCESS Buffer is translated from String.
1638 @retval RETURN_INVALID_PARAMETER If String is NULL.
1639 If Data is NULL.
1640 If Length is not multiple of 2.
1641 If PcdMaximumUnicodeStringLength is not zero,
1642 and Length is greater than
1645 a character that is not valid hexadecimal
1646 digit characters, or a Null-terminator.
1647 @retval RETURN_BUFFER_TOO_SMALL If MaxBufferSize is less than (Length / 2).
1661 [ATTENTION] This function is deprecated for security reason.
1663 Convert a Null-terminated Unicode string to a Null-terminated
1670 The caller is responsible to make sure Destination points to a buffer with size
1673 If any Unicode characters in Source contain non-zero value in
1676 If Destination is NULL, then ASSERT().
1677 If Source is NULL, then ASSERT().
1678 If Source is not aligned on a 16-bit boundary, then ASSERT().
1681 If PcdMaximumUnicodeStringLength is not zero, and Source contains
1683 the Null-terminator, then ASSERT().
1685 If PcdMaximumAsciiStringLength is not zero, and Source contains more
1687 Null-terminator, then ASSERT().
1689 @param Source The pointer to a Null-terminated Unicode string.
1690 @param Destination The pointer to a Null-terminated ASCII string.
1705 Convert a Null-terminated Unicode string to a Null-terminated
1708 This function is similar to AsciiStrCpyS.
1713 Destination by appending a Null-terminator character at the end.
1715 The caller is responsible to make sure Destination points to a buffer with size
1718 If any Unicode characters in Source contain non-zero value in
1721 If Source is not aligned on a 16-bit boundary, then ASSERT().
1723 If an error is returned, then the Destination is unmodified.
1725 @param Source The pointer to a Null-terminated Unicode string.
1726 @param Destination The pointer to a Null-terminated ASCII string.
1730 @retval RETURN_SUCCESS String is converted.
1731 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
1732 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
1733 If Source is NULL.
1734 If PcdMaximumAsciiStringLength is not zero,
1735 and DestMax is greater than
1737 If PcdMaximumUnicodeStringLength is not zero,
1738 and DestMax is greater than
1740 If DestMax is 0.
1753 Convert not more than Length successive characters from a Null-terminated
1754 Unicode string to a Null-terminated Ascii string. If no null char is copied
1755 from Source, then Destination[Length] is always set to null.
1760 Destination by appending a Null-terminator character at the end.
1762 The caller is responsible to make sure Destination points to a buffer with size
1765 If any Unicode characters in Source contain non-zero value in the upper 8
1767 If Source is not aligned on a 16-bit boundary, then ASSERT().
1769 If an error is returned, then the Destination is unmodified.
1771 @param Source The pointer to a Null-terminated Unicode string.
1774 @param Destination The pointer to a Null-terminated Ascii string.
1779 @retval RETURN_SUCCESS String is converted.
1780 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
1781 If Source is NULL.
1782 If DestinationLength is NULL.
1783 If PcdMaximumAsciiStringLength is not zero,
1784 and Length or DestMax is greater than
1786 If PcdMaximumUnicodeStringLength is not
1787 zero, and Length or DestMax is greater than
1789 If DestMax is 0.
1790 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
1808 [ATTENTION] This function is deprecated for security reason.
1810 Copies one Null-terminated ASCII string to another Null-terminated ASCII
1817 If Destination is NULL, then ASSERT().
1818 If Source is NULL, then ASSERT().
1820 If PcdMaximumAsciiStringLength is not zero and Source contains more than
1821 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
1824 @param Destination The pointer to a Null-terminated ASCII string.
1825 @param Source The pointer to a Null-terminated ASCII string.
1839 [ATTENTION] This function is deprecated for security reason.
1841 Copies up to a specified length one Null-terminated ASCII string to another
1842 Null-terminated ASCII string and returns the new ASCII string.
1846 are copied from Source to Destination. If Length is 0, then Destination is
1847 returned unmodified. If Length is greater that the number of ASCII characters
1848 in Source, then Destination is padded with Null ASCII characters. If Source
1851 If Destination is NULL, then ASSERT().
1852 If Source is NULL, then ASSERT().
1854 If PcdMaximumAsciiStringLength is not zero, and Length is greater than
1856 If PcdMaximumAsciiStringLength is not zero, and Source contains more than
1857 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
1860 @param Destination The pointer to a Null-terminated ASCII string.
1861 @param Source The pointer to a Null-terminated ASCII string.
1877 Returns the length of a Null-terminated ASCII string.
1879 This function returns the number of ASCII characters in the Null-terminated
1882 If Length > 0 and Destination is NULL, then ASSERT().
1883 If Length > 0 and Source is NULL, then ASSERT().
1884 If PcdMaximumAsciiStringLength is not zero and String contains more than
1885 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
1888 @param String The pointer to a Null-terminated ASCII string.
1901 Returns the size of a Null-terminated ASCII string in bytes, including the
1904 This function returns the size, in bytes, of the Null-terminated ASCII string
1907 If String is NULL, then ASSERT().
1908 If PcdMaximumAsciiStringLength is not zero and String contains more than
1909 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
1912 @param String The pointer to a Null-terminated ASCII string.
1925 Compares two Null-terminated ASCII strings, and returns the difference
1928 This function compares the Null-terminated ASCII string FirstString to the
1929 Null-terminated ASCII string SecondString. If FirstString is identical to
1930 SecondString, then 0 is returned. Otherwise, the value returned is the first
1934 If FirstString is NULL, then ASSERT().
1935 If SecondString is NULL, then ASSERT().
1936 If PcdMaximumAsciiStringLength is not zero and FirstString contains more than
1937 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
1939 If PcdMaximumAsciiStringLength is not zero and SecondString contains more
1941 Null-terminator, then ASSERT().
1943 @param FirstString The pointer to a Null-terminated ASCII string.
1944 @param SecondString The pointer to a Null-terminated ASCII string.
1946 @retval ==0 FirstString is identical to SecondString.
1947 @retval !=0 FirstString is not identical to SecondString.
1959 Performs a case insensitive comparison of two Null-terminated ASCII strings,
1962 This function performs a case insensitive comparison of the Null-terminated
1963 ASCII string FirstString to the Null-terminated ASCII string SecondString. If
1964 FirstString is identical to SecondString, then 0 is returned. Otherwise, the
1965 value returned is the first mismatched lower case ASCII character in
1969 If FirstString is NULL, then ASSERT().
1970 If SecondString is NULL, then ASSERT().
1971 If PcdMaximumAsciiStringLength is not zero and FirstString contains more than
1972 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
1974 If PcdMaximumAsciiStringLength is not zero and SecondString contains more
1976 Null-terminator, then ASSERT().
1978 @param FirstString The pointer to a Null-terminated ASCII string.
1979 @param SecondString The pointer to a Null-terminated ASCII string.
1981 @retval ==0 FirstString is identical to SecondString using case insensitive
1983 @retval !=0 FirstString is not identical to SecondString using case
1996 Compares two Null-terminated ASCII strings with maximum lengths, and returns
1999 This function compares the Null-terminated ASCII string FirstString to the
2000 Null-terminated ASCII string SecondString. At most, Length ASCII characters
2001 will be compared. If Length is 0, then 0 is returned. If FirstString is
2002 identical to SecondString, then 0 is returned. Otherwise, the value returned
2003 is the first mismatched ASCII character in SecondString subtracted from the
2006 If Length > 0 and FirstString is NULL, then ASSERT().
2007 If Length > 0 and SecondString is NULL, then ASSERT().
2008 If PcdMaximumAsciiStringLength is not zero, and Length is greater than
2010 If PcdMaximumAsciiStringLength is not zero, and FirstString contains more than
2011 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
2013 If PcdMaximumAsciiStringLength is not zero, and SecondString contains more than
2014 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
2017 @param FirstString The pointer to a Null-terminated ASCII string.
2018 @param SecondString The pointer to a Null-terminated ASCII string.
2021 @retval ==0 FirstString is identical to SecondString.
2022 @retval !=0 FirstString is not identical to SecondString.
2037 [ATTENTION] This function is deprecated for security reason.
2039 Concatenates one Null-terminated ASCII string to another Null-terminated
2042 This function concatenates two Null-terminated ASCII strings. The contents of
2043 Null-terminated ASCII string Source are concatenated to the end of Null-
2044 terminated ASCII string Destination. The Null-terminated concatenated ASCII
2045 String is returned.
2047 If Destination is NULL, then ASSERT().
2048 If Source is NULL, then ASSERT().
2049 If PcdMaximumAsciiStringLength is not zero and Destination contains more than
2050 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
2052 If PcdMaximumAsciiStringLength is not zero and Source contains more than
2053 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
2055 If PcdMaximumAsciiStringLength is not zero and concatenating Destination and
2059 @param Destination The pointer to a Null-terminated ASCII string.
2060 @param Source The pointer to a Null-terminated ASCII string.
2074 [ATTENTION] This function is deprecated for security reason.
2076 Concatenates up to a specified length one Null-terminated ASCII string to
2077 the end of another Null-terminated ASCII string, and returns the
2080 This function concatenates two Null-terminated ASCII strings. The contents
2081 of Null-terminated ASCII string Source are concatenated to the end of Null-
2082 terminated ASCII string Destination, and Destination is returned. At most,
2084 Destination, and Destination is always Null-terminated. If Length is 0, then
2085 Destination is returned unmodified. If Source and Destination overlap, then
2088 If Length > 0 and Destination is NULL, then ASSERT().
2089 If Length > 0 and Source is NULL, then ASSERT().
2091 If PcdMaximumAsciiStringLength is not zero, and Length is greater than
2093 If PcdMaximumAsciiStringLength is not zero, and Destination contains more than
2094 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
2096 If PcdMaximumAsciiStringLength is not zero, and Source contains more than
2097 PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
2099 If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and
2101 ASCII characters, not including the Null-terminator, then ASSERT().
2103 @param Destination The pointer to a Null-terminated ASCII string.
2104 @param Source The pointer to a Null-terminated ASCII string.
2121 Returns the first occurrence of a Null-terminated ASCII sub-string
2122 in a Null-terminated ASCII string.
2125 and returns the first occurrence of SearchString. If SearchString is not
2126 found in String, then NULL is returned. If the length of SearchString is zero,
2127 then String is returned.
2129 If String is NULL, then ASSERT().
2130 If SearchString is NULL, then ASSERT().
2132 If PcdMaximumAsciiStringLength is not zero, and SearchString or
2134 not including the Null-terminator, then ASSERT().
2136 @param String The pointer to a Null-terminated ASCII string.
2137 @param SearchString The pointer to a Null-terminated ASCII string to search for.
2140 @retval others If there is a match return the first occurrence of SearchingString.
2141 If the length of SearchString is zero,return String.
2153 Convert a Null-terminated ASCII decimal string to a value of type
2158 ASCII string String is:
2162 The valid decimal digit character is in the range [0-9]. The function will
2165 function stops at the first character that is a not a valid decimal character or
2166 Null-terminator, whichever on comes first.
2168 If String has only pad spaces, then 0 is returned.
2169 If String has no pad spaces or valid decimal digits, then 0 is returned.
2171 UINTN, then MAX_UINTN is returned.
2172 If String is NULL, then ASSERT().
2173 If PcdMaximumAsciiStringLength is not zero, and String contains more than
2174 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
2177 @param String The pointer to a Null-terminated ASCII string.
2190 Convert a Null-terminated ASCII decimal string to a value of type
2195 ASCII string String is:
2199 The valid decimal digit character is in the range [0-9]. The function will
2202 function stops at the first character that is a not a valid decimal character or
2203 Null-terminator, whichever on comes first.
2205 If String has only pad spaces, then 0 is returned.
2206 If String has no pad spaces or valid decimal digits, then 0 is returned.
2208 UINT64, then MAX_UINT64 is returned.
2209 If String is NULL, then ASSERT().
2210 If PcdMaximumAsciiStringLength is not zero, and String contains more than
2211 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
2214 @param String The pointer to a Null-terminated ASCII string.
2227 Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
2231 string String is:
2235 The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
2236 The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"
2241 digit. Then, the function stops at the first character that is a not a valid
2242 hexadecimal character or Null-terminator, whichever on comes first.
2244 If String has only pad spaces, then 0 is returned.
2246 0 is returned.
2249 then MAX_UINTN is returned.
2250 If String is NULL, then ASSERT().
2251 If PcdMaximumAsciiStringLength is not zero,
2253 the Null-terminator, then ASSERT().
2255 @param String The pointer to a Null-terminated ASCII string.
2268 Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
2272 string String is:
2276 The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
2277 The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"
2282 digit. Then, the function stops at the first character that is a not a valid
2283 hexadecimal character or Null-terminator, whichever on comes first.
2285 If String has only pad spaces, then 0 is returned.
2287 0 is returned.
2290 then MAX_UINT64 is returned.
2291 If String is NULL, then ASSERT().
2292 If PcdMaximumAsciiStringLength is not zero,
2294 the Null-terminator, then ASSERT().
2296 @param String The pointer to a Null-terminated ASCII string.
2308 Convert a Null-terminated ASCII string to IPv6 address and prefix length.
2312 by String. The format of the input ASCII string String is as follows:
2316 X contains one to four hexadecimal digit characters in the range [0-9], [a-f] and
2317 [A-F]. X is converted to a value of type UINT16, whose low byte is stored in low
2318 memory address and high byte is stored in high memory address. P contains decimal
2319 digit characters in the range [0-9]. The running zero in the beginning of P will
2320 be ignored. /P is optional.
2322 When /P is not in the String, the function stops at the first character that is
2325 When /P is in the String, the function stops at the first character that is not
2326 a valid decimal digit character after P is converted.
2331 If EndPointer is not NULL and Address is translated from String, a pointer
2332 to the character that stopped the scan is stored at the location pointed to
2335 @param String Pointer to a Null-terminated ASCII string.
2339 length. MAX_UINT8 is returned when /P is
2342 @retval RETURN_SUCCESS Address is translated from String.
2343 @retval RETURN_INVALID_PARAMETER If String is NULL.
2344 If Data is NULL.
2348 is not less than 8.
2349 If P starts with character that is not a
2365 Convert a Null-terminated ASCII string to IPv4 address and prefix length.
2369 by String. The format of the input ASCII string String is as follows:
2373 D and P are decimal digit characters in the range [0-9]. The running zero in
2374 the beginning of D and P will be ignored. /P is optional.
2376 When /P is not in the String, the function stops at the first character that is
2379 When /P is in the String, the function stops at the first character that is not
2380 a valid decimal digit character after P is converted.
2382 If EndPointer is not NULL and Address is translated from String, a pointer
2383 to the character that stopped the scan is stored at the location pointed to
2386 @param String Pointer to a Null-terminated ASCII string.
2390 length. MAX_UINT8 is returned when /P is
2393 @retval RETURN_SUCCESS Address is translated from String.
2394 @retval RETURN_INVALID_PARAMETER If String is NULL.
2395 If Data is NULL.
2396 @retval RETURN_UNSUPPORTED If String is not in the correct format.
2413 Convert a Null-terminated ASCII GUID string to a value of type
2420 aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
2422 The pairs aa - pp are two characters in the range [0-9], [a-f] and
2423 [A-F], with each pair representing a single byte hexadecimal value.
2425 The mapping between String and the EFI_GUID structure is as follows:
2443 @param String Pointer to a Null-terminated ASCII string.
2446 @retval RETURN_SUCCESS Guid is translated from String.
2447 @retval RETURN_INVALID_PARAMETER If String is NULL.
2448 If Data is NULL.
2449 @retval RETURN_UNSUPPORTED If String is not as the above format.
2460 Convert a Null-terminated ASCII hexadecimal string to a byte array.
2464 the input ASCII string String is:
2468 X is a hexadecimal digit character in the range [0-9], [a-f] and [A-F].
2473 @param String Pointer to a Null-terminated ASCII string.
2478 @retval RETURN_SUCCESS Buffer is translated from String.
2479 @retval RETURN_INVALID_PARAMETER If String is NULL.
2480 If Data is NULL.
2481 If Length is not multiple of 2.
2482 If PcdMaximumAsciiStringLength is not zero,
2483 and Length is greater than
2486 a character that is not valid hexadecimal
2487 digit characters, or a Null-terminator.
2488 @retval RETURN_BUFFER_TOO_SMALL If MaxBufferSize is less than (Length / 2).
2502 [ATTENTION] This function is deprecated for security reason.
2504 Convert one Null-terminated ASCII string to a Null-terminated
2509 Unicode string Destination by appending a Null-terminator character at the end.
2510 The caller is responsible to make sure Destination points to a buffer with size
2513 If Destination is NULL, then ASSERT().
2514 If Destination is not aligned on a 16-bit boundary, then ASSERT().
2515 If Source is NULL, then ASSERT().
2517 If PcdMaximumAsciiStringLength is not zero, and Source contains more than
2518 PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
2520 If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
2522 Null-terminator, then ASSERT().
2524 @param Source The pointer to a Null-terminated ASCII string.
2525 @param Destination The pointer to a Null-terminated Unicode string.
2540 Convert one Null-terminated ASCII string to a Null-terminated
2543 This function is similar to StrCpyS.
2547 appending a Null-terminator character at the end.
2549 The caller is responsible to make sure Destination points to a buffer with size
2552 If Destination is not aligned on a 16-bit boundary, then ASSERT().
2554 If an error is returned, then the Destination is unmodified.
2556 @param Source The pointer to a Null-terminated ASCII string.
2557 @param Destination The pointer to a Null-terminated Unicode string.
2561 @retval RETURN_SUCCESS String is converted.
2562 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
2563 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
2564 If Source is NULL.
2565 If PcdMaximumUnicodeStringLength is not zero,
2566 and DestMax is greater than
2568 If PcdMaximumAsciiStringLength is not zero,
2569 and DestMax is greater than
2571 If DestMax is 0.
2584 Convert not more than Length successive characters from a Null-terminated
2585 Ascii string to a Null-terminated Unicode string. If no null char is copied
2586 from Source, then Destination[Length] is always set to null.
2590 terminates the Unicode string Destination by appending a Null-terminator
2593 The caller is responsible to make sure Destination points to a buffer with
2597 If Destination is not aligned on a 16-bit boundary, then ASSERT().
2599 If an error is returned, then Destination and DestinationLength are
2602 @param Source The pointer to a Null-terminated Ascii string.
2604 @param Destination The pointer to a Null-terminated Unicode string.
2609 @retval RETURN_SUCCESS String is converted.
2610 @retval RETURN_INVALID_PARAMETER If Destination is NULL.
2611 If Source is NULL.
2612 If DestinationLength is NULL.
2613 If PcdMaximumUnicodeStringLength is not
2614 zero, and Length or DestMax is greater than
2616 If PcdMaximumAsciiStringLength is not zero,
2617 and Length or DestMax is greater than
2619 If DestMax is 0.
2620 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
2637 it maps to a valid small-case ASCII character.
2640 which maps to a valid small-case ASCII character, i.e.
2642 is returned directly.
2646 @retval LowerCharacter If the Char is with range L'a' to L'z'.
2659 If Chr is lowercase Ascii character, then converts it to upper one.
2678 …Produce a Null-terminated Ascii string in the output buffer specified by Destination and Destinati…
2679 The Ascii string is produced by converting the data string specified by Source and SourceLength.
2685 Caller is responsible for passing in buffer of DestinationSize
2687 @retval RETURN_SUCCESS When ascii buffer is filled in.
2688 @retval RETURN_INVALID_PARAMETER If Source is NULL or DestinationSize is NULL.
2689 …RETURN_INVALID_PARAMETER If SourceLength or DestinationSize is bigger than (MAX_ADDRESS - (UINTN…
2690 @retval RETURN_BUFFER_TOO_SMALL If SourceLength is 0 and DestinationSize is <1.
2691 …@retval RETURN_BUFFER_TOO_SMALL If Destination is NULL or DestinationSize is smaller than requi…
2704 Decode Base64 ASCII encoded data to 8-bit binary representation, based on
2709 Whitespace is ignored at all positions:
2710 - 0x09 ('\t') horizontal tab
2711 - 0x0A ('\n') new line
2712 - 0x0B ('\v') vertical tab
2713 - 0x0C ('\f') form feed
2714 - 0x0D ('\r') carriage return
2715 - 0x20 (' ') space
2717 The minimum amount of required padding (with ASCII 0x3D, '=') is tolerated
2724 ASCII encoding. May be NULL if SourceSize is
2729 @param[out] Destination Array of UINT8 elements receiving the decoded
2730 8-bit binary representation. Allocated by the
2731 caller. May be NULL if DestinationSize is
2732 zero on input. If NULL, decoding is
2733 performed, but the 8-bit binary
2734 representation is not stored. If non-NULL and
2747 is indeterminate on output.
2750 been decoded to on-output DestinationSize
2753 DestinationSize is zero on input, and
2757 @retval RETURN_BUFFER_TOO_SMALL The input value of DestinationSize is not
2763 @retval RETURN_INVALID_PARAMETER DestinationSize is NULL.
2765 @retval RETURN_INVALID_PARAMETER Source is NULL, but SourceSize is not zero.
2767 @retval RETURN_INVALID_PARAMETER Destination is NULL, but DestinationSize is
2770 @retval RETURN_INVALID_PARAMETER Source is non-NULL, and (Source +
2773 @retval RETURN_INVALID_PARAMETER Destination is non-NULL, and (Destination +
2795 Converts an 8-bit value to an 8-bit BCD value.
2797 Converts the 8-bit value specified by Value to BCD. The BCD value is
2802 @param Value The 8-bit value to convert to BCD. Range 0..99.
2815 Converts an 8-bit BCD value to an 8-bit value.
2817 Converts the 8-bit BCD value specified by Value to an 8-bit value. The 8-bit
2818 value is returned.
2823 @param Value The 8-bit BCD value to convert to an 8-bit value.
2825 @return The 8-bit value is returned.
2854 - Single periods in the path are removed.
2855 - Double periods in the path are removed along with a single parent directory.
2856 - Forward slashes L'/' are converted to backward slashes L'\'.
2876 Initializes the head node of a doubly linked list that is declared as a
2899 for(Entry = (ListHead)->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)
2915 for(Entry = (ListHead)->ForwardLink, NextEntry = Entry->ForwardLink;\
2916 Entry != (ListHead); Entry = NextEntry, NextEntry = Entry->ForwardLink)
2919 Checks whether FirstEntry and SecondEntry are part of the same doubly-linked
2922 If FirstEntry is NULL, then ASSERT().
2923 If FirstEntry->ForwardLink is NULL, then ASSERT().
2924 If FirstEntry->BackLink is NULL, then ASSERT().
2925 If SecondEntry is NULL, then ASSERT();
2926 If PcdMaximumLinkedListLength is not zero, and List contains more than
2932 @retval TRUE SecondEntry is in the same doubly-linked list as FirstEntry.
2933 @retval FALSE SecondEntry isn't in the same doubly-linked list as FirstEntry,
2934 or FirstEntry is invalid.
2951 functions may be used to add and remove nodes from the linked list. It is up
2954 If ListHead is NULL, then ASSERT().
2975 If ListHead is NULL, then ASSERT().
2976 If Entry is NULL, then ASSERT().
2979 If PcdMaximumLinkedListLength is not zero, and prior to insertion the number
2980 of nodes in ListHead, including the ListHead node, is greater than or
2984 @param Entry A pointer to a node that is to be inserted at the beginning
3005 If ListHead is NULL, then ASSERT().
3006 If Entry is NULL, then ASSERT().
3009 If PcdMaximumLinkedListLength is not zero, and prior to insertion the number
3010 of nodes in ListHead, including the ListHead node, is greater than or
3014 @param Entry A pointer to a node that is to be added at the end of the
3033 If List is empty, then List is returned.
3035 If List is NULL, then ASSERT().
3038 If PcdMaximumLinkedListLength is not zero, and the number of nodes
3039 in List, including the List node, is greater than or equal to
3045 @retval List The list is empty.
3060 or InitializeListHead(). If List is empty, then List is returned.
3062 If List is NULL, then ASSERT().
3063 If Node is NULL, then ASSERT().
3066 If PcdMaximumLinkedListLength is not zero, and List contains more than
3068 If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
3073 @return The pointer to the next node if one exists. Otherwise List is returned.
3089 or InitializeListHead(). If List is empty, then List is returned.
3091 If List is NULL, then ASSERT().
3092 If Node is NULL, then ASSERT().
3095 If PcdMaximumLinkedListLength is not zero, and List contains more than
3097 If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
3102 @return The pointer to the previous node if one exists. Otherwise List is returned.
3114 Checks to see if a doubly linked list is empty or not.
3116 Checks to see if the doubly linked list is empty. If the linked list contains
3119 If ListHead is NULL, then ASSERT().
3122 If PcdMaximumLinkedListLength is not zero, and the number of nodes
3123 in List, including the List node, is greater than or equal to
3128 @retval TRUE The linked list is empty.
3129 @retval FALSE The linked list is not empty.
3140 Determines if a node in a doubly linked list is the head node of a the same
3141 doubly linked list. This function is typically used to terminate a loop that
3144 Returns TRUE if Node is equal to List. Returns FALSE if Node is one of the
3148 If List is NULL, then ASSERT().
3149 If Node is NULL, then ASSERT().
3152 If PcdMaximumLinkedListLength is not zero, and the number of nodes
3153 in List, including the List node, is greater than or equal to
3155 If PcdVerifyNodeInList is TRUE and Node is not a node in List the and Node is not equal
3161 @retval TRUE Node is the head of the doubly-linked list pointed by List.
3162 @retval FALSE Node is not the head of the doubly-linked list pointed by List.
3176 Returns TRUE if Node is the last node in the doubly linked list specified by
3177 List. Otherwise, FALSE is returned. List must have been initialized with
3180 If List is NULL, then ASSERT().
3181 If Node is NULL, then ASSERT().
3184 If PcdMaximumLinkedListLength is not zero, and the number of nodes
3185 in List, including the List node, is greater than or equal to
3187 If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
3192 @retval TRUE Node is the last node in the linked list.
3193 @retval FALSE Node is not the last node in the linked list.
3208 If FirstEntry is identical to SecondEntry, then SecondEntry is returned.
3209 Otherwise, the location of the FirstEntry node is swapped with the location
3213 SecondEntry is returned after the nodes are swapped.
3215 If FirstEntry is NULL, then ASSERT().
3216 If SecondEntry is NULL, then ASSERT().
3217 If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the
3219 If PcdMaximumLinkedListLength is not zero, and the number of nodes in the
3221 the FirstEntry and SecondEntry nodes, is greater than or equal to
3242 Removes the node Entry from a doubly linked list. It is up to the caller of
3243 this function to release the memory used by this node if that is required. On
3244 exit, the node following Entry in the doubly linked list is returned. If
3245 Entry is the only node in the linked list, then the head node of the linked
3246 list is returned.
3248 If Entry is NULL, then ASSERT().
3249 If Entry is the head node of an empty list, then ASSERT().
3250 If PcdMaximumLinkedListLength is not zero, and the number of nodes in the
3251 linked list containing Entry, including the Entry node, is greater than
3270 Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled
3271 with zeros. The shifted value is returned.
3273 This function shifts the 64-bit value Operand to the left by Count bits. The
3274 low Count bits are set to zero. The shifted value is returned.
3276 If Count is greater than 63, then ASSERT().
3278 @param Operand The 64-bit operand to shift left.
3293 Shifts a 64-bit integer right between 0 and 63 bits. This high bits are
3294 filled with zeros. The shifted value is returned.
3296 This function shifts the 64-bit value Operand to the right by Count bits. The
3297 high Count bits are set to zero. The shifted value is returned.
3299 If Count is greater than 63, then ASSERT().
3301 @param Operand The 64-bit operand to shift right.
3316 Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled
3317 with original integer's bit 63. The shifted value is returned.
3319 This function shifts the 64-bit value Operand to the right by Count bits. The
3320 high Count bits are set to bit 63 of Operand. The shifted value is returned.
3322 If Count is greater than 63, then ASSERT().
3324 @param Operand The 64-bit operand to shift right.
3339 Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits
3342 This function rotates the 32-bit value Operand to the left by Count bits. The
3344 value is returned.
3346 If Count is greater than 31, then ASSERT().
3348 @param Operand The 32-bit operand to rotate left.
3363 Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits
3366 This function rotates the 32-bit value Operand to the right by Count bits.
3368 value is returned.
3370 If Count is greater than 31, then ASSERT().
3372 @param Operand The 32-bit operand to rotate right.
3387 Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits
3390 This function rotates the 64-bit value Operand to the left by Count bits. The
3392 value is returned.
3394 If Count is greater than 63, then ASSERT().
3396 @param Operand The 64-bit operand to rotate left.
3411 Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits
3414 This function rotates the 64-bit value Operand to the right by Count bits.
3416 value is returned.
3418 If Count is greater than 63, then ASSERT().
3420 @param Operand The 64-bit operand to rotate right.
3435 Returns the bit position of the lowest bit set in a 32-bit value.
3437 This function computes the bit position of the lowest bit set in the 32-bit
3438 value specified by Operand. If Operand is zero, then -1 is returned.
3439 Otherwise, a value between 0 and 31 is returned.
3441 @param Operand The 32-bit operand to evaluate.
3444 @retval -1 Operand is zero.
3455 Returns the bit position of the lowest bit set in a 64-bit value.
3457 This function computes the bit position of the lowest bit set in the 64-bit
3458 value specified by Operand. If Operand is zero, then -1 is returned.
3459 Otherwise, a value between 0 and 63 is returned.
3461 @param Operand The 64-bit operand to evaluate.
3464 @retval -1 Operand is zero.
3476 Returns the bit position of the highest bit set in a 32-bit value. Equivalent
3479 This function computes the bit position of the highest bit set in the 32-bit
3480 value specified by Operand. If Operand is zero, then -1 is returned.
3481 Otherwise, a value between 0 and 31 is returned.
3483 @param Operand The 32-bit operand to evaluate.
3486 @retval -1 Operand is zero.
3497 Returns the bit position of the highest bit set in a 64-bit value. Equivalent
3500 This function computes the bit position of the highest bit set in the 64-bit
3501 value specified by Operand. If Operand is zero, then -1 is returned.
3502 Otherwise, a value between 0 and 63 is returned.
3504 @param Operand The 64-bit operand to evaluate.
3507 @retval -1 Operand is zero.
3518 Returns the value of the highest bit set in a 32-bit value. Equivalent to
3521 This function computes the value of the highest bit set in the 32-bit value
3522 specified by Operand. If Operand is zero, then zero is returned.
3524 @param Operand The 32-bit operand to evaluate.
3527 @retval 0 Operand is zero.
3538 Returns the value of the highest bit set in a 64-bit value. Equivalent to
3541 This function computes the value of the highest bit set in the 64-bit value
3542 specified by Operand. If Operand is zero, then zero is returned.
3544 @param Operand The 64-bit operand to evaluate.
3547 @retval 0 Operand is zero.
3558 Switches the endianness of a 16-bit integer.
3560 This function swaps the bytes in a 16-bit unsigned value to switch the value
3561 from little endian to big endian or vice versa. The byte swapped value is
3564 @param Value A 16-bit unsigned value.
3577 Switches the endianness of a 32-bit integer.
3579 This function swaps the bytes in a 32-bit unsigned value to switch the value
3580 from little endian to big endian or vice versa. The byte swapped value is
3583 @param Value A 32-bit unsigned value.
3596 Switches the endianness of a 64-bit integer.
3598 This function swaps the bytes in a 64-bit unsigned value to switch the value
3599 from little endian to big endian or vice versa. The byte swapped value is
3602 @param Value A 64-bit unsigned value.
3615 Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and
3616 generates a 64-bit unsigned result.
3618 This function multiples the 64-bit unsigned value Multiplicand by the 32-bit
3619 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
3620 bit unsigned result is returned.
3622 @param Multiplicand A 64-bit unsigned value.
3623 @param Multiplier A 32-bit unsigned value.
3637 Multiples a 64-bit unsigned integer by a 64-bit unsigned integer and
3638 generates a 64-bit unsigned result.
3640 This function multiples the 64-bit unsigned value Multiplicand by the 64-bit
3641 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
3642 bit unsigned result is returned.
3644 @param Multiplicand A 64-bit unsigned value.
3645 @param Multiplier A 64-bit unsigned value.
3659 Multiples a 64-bit signed integer by a 64-bit signed integer and generates a
3660 64-bit signed result.
3662 This function multiples the 64-bit signed value Multiplicand by the 64-bit
3663 signed value Multiplier and generates a 64-bit signed result. This 64-bit
3664 signed result is returned.
3666 @param Multiplicand A 64-bit signed value.
3667 @param Multiplier A 64-bit signed value.
3681 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
3682 a 64-bit unsigned result.
3684 This function divides the 64-bit unsigned value Dividend by the 32-bit
3685 unsigned value Divisor and generates a 64-bit unsigned quotient. This
3686 function returns the 64-bit unsigned quotient.
3688 If Divisor is 0, then ASSERT().
3690 @param Dividend A 64-bit unsigned value.
3691 @param Divisor A 32-bit unsigned value.
3705 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
3706 a 32-bit unsigned remainder.
3708 This function divides the 64-bit unsigned value Dividend by the 32-bit
3709 unsigned value Divisor and generates a 32-bit remainder. This function
3710 returns the 32-bit unsigned remainder.
3712 If Divisor is 0, then ASSERT().
3714 @param Dividend A 64-bit unsigned value.
3715 @param Divisor A 32-bit unsigned value.
3729 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
3730 a 64-bit unsigned result and an optional 32-bit unsigned remainder.
3732 This function divides the 64-bit unsigned value Dividend by the 32-bit
3733 unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
3734 is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
3735 This function returns the 64-bit unsigned quotient.
3737 If Divisor is 0, then ASSERT().
3739 @param Dividend A 64-bit unsigned value.
3740 @param Divisor A 32-bit unsigned value.
3741 @param Remainder A pointer to a 32-bit unsigned value. This parameter is
3757 Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates
3758 a 64-bit unsigned result and an optional 64-bit unsigned remainder.
3760 This function divides the 64-bit unsigned value Dividend by the 64-bit
3761 unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
3762 is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
3763 This function returns the 64-bit unsigned quotient.
3765 If Divisor is 0, then ASSERT().
3767 @param Dividend A 64-bit unsigned value.
3768 @param Divisor A 64-bit unsigned value.
3769 @param Remainder A pointer to a 64-bit unsigned value. This parameter is
3785 Divides a 64-bit signed integer by a 64-bit signed integer and generates a
3786 64-bit signed result and a optional 64-bit signed remainder.
3788 This function divides the 64-bit signed value Dividend by the 64-bit signed
3789 value Divisor and generates a 64-bit signed quotient. If Remainder is not
3790 NULL, then the 64-bit signed remainder is returned in Remainder. This
3791 function returns the 64-bit signed quotient.
3793 It is the caller's responsibility to not call this function with a Divisor of 0.
3794 If Divisor is 0, then the quotient and remainder should be assumed to be
3797 If Divisor is 0, then ASSERT().
3799 @param Dividend A 64-bit signed value.
3800 @param Divisor A 64-bit signed value.
3801 @param Remainder A pointer to a 64-bit signed value. This parameter is
3817 Reads a 16-bit value from memory that may be unaligned.
3819 This function returns the 16-bit value pointed to by Buffer. The function
3822 If the Buffer is NULL, then ASSERT().
3824 @param Buffer The pointer to a 16-bit value that may be unaligned.
3826 @return The 16-bit value read from Buffer.
3837 Writes a 16-bit value to memory that may be unaligned.
3839 This function writes the 16-bit value specified by Value to Buffer. Value is
3843 If the Buffer is NULL, then ASSERT().
3845 @param Buffer The pointer to a 16-bit value that may be unaligned.
3846 @param Value 16-bit value to write to Buffer.
3848 @return The 16-bit value to write to Buffer.
3860 Reads a 24-bit value from memory that may be unaligned.
3862 This function returns the 24-bit value pointed to by Buffer. The function
3865 If the Buffer is NULL, then ASSERT().
3867 @param Buffer The pointer to a 24-bit value that may be unaligned.
3869 @return The 24-bit value read from Buffer.
3880 Writes a 24-bit value to memory that may be unaligned.
3882 This function writes the 24-bit value specified by Value to Buffer. Value is
3886 If the Buffer is NULL, then ASSERT().
3888 @param Buffer The pointer to a 24-bit value that may be unaligned.
3889 @param Value 24-bit value to write to Buffer.
3891 @return The 24-bit value to write to Buffer.
3903 Reads a 32-bit value from memory that may be unaligned.
3905 This function returns the 32-bit value pointed to by Buffer. The function
3908 If the Buffer is NULL, then ASSERT().
3910 @param Buffer The pointer to a 32-bit value that may be unaligned.
3912 @return The 32-bit value read from Buffer.
3923 Writes a 32-bit value to memory that may be unaligned.
3925 This function writes the 32-bit value specified by Value to Buffer. Value is
3929 If the Buffer is NULL, then ASSERT().
3931 @param Buffer The pointer to a 32-bit value that may be unaligned.
3932 @param Value 32-bit value to write to Buffer.
3934 @return The 32-bit value to write to Buffer.
3946 Reads a 64-bit value from memory that may be unaligned.
3948 This function returns the 64-bit value pointed to by Buffer. The function
3951 If the Buffer is NULL, then ASSERT().
3953 @param Buffer The pointer to a 64-bit value that may be unaligned.
3955 @return The 64-bit value read from Buffer.
3966 Writes a 64-bit value to memory that may be unaligned.
3968 This function writes the 64-bit value specified by Value to Buffer. Value is
3972 If the Buffer is NULL, then ASSERT().
3974 @param Buffer The pointer to a 64-bit value that may be unaligned.
3975 @param Value 64-bit value to write to Buffer.
3977 @return The 64-bit value to write to Buffer.
3993 Returns a bit field from an 8-bit value.
3997 If 8-bit operations are not supported, then ASSERT().
3998 If StartBit is greater than 7, then ASSERT().
3999 If EndBit is greater than 7, then ASSERT().
4000 If EndBit is less than StartBit, then ASSERT().
4021 Writes a bit field to an 8-bit value, and returns the result.
4024 Operand. All other bits in Operand are preserved. The new 8-bit value is
4027 If 8-bit operations are not supported, then ASSERT().
4028 If StartBit is greater than 7, then ASSERT().
4029 If EndBit is greater than 7, then ASSERT().
4030 If EndBit is less than StartBit, then ASSERT().
4031 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4040 @return The new 8-bit value.
4054 Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the
4059 Operand are preserved. The new 8-bit value is returned.
4061 If 8-bit operations are not supported, then ASSERT().
4062 If StartBit is greater than 7, then ASSERT().
4063 If EndBit is greater than 7, then ASSERT().
4064 If EndBit is less than StartBit, then ASSERT().
4065 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4074 @return The new 8-bit value.
4088 Reads a bit field from an 8-bit value, performs a bitwise AND, and returns
4093 preserved. The new 8-bit value is returned.
4095 If 8-bit operations are not supported, then ASSERT().
4096 If StartBit is greater than 7, then ASSERT().
4097 If EndBit is greater than 7, then ASSERT().
4098 If EndBit is less than StartBit, then ASSERT().
4099 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4108 @return The new 8-bit value.
4122 Reads a bit field from an 8-bit value, performs a bitwise AND followed by a
4128 preserved. The new 8-bit value is returned.
4130 If 8-bit operations are not supported, then ASSERT().
4131 If StartBit is greater than 7, then ASSERT().
4132 If EndBit is greater than 7, then ASSERT().
4133 If EndBit is less than StartBit, then ASSERT().
4134 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4135 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4145 @return The new 8-bit value.
4160 Returns a bit field from a 16-bit value.
4164 If 16-bit operations are not supported, then ASSERT().
4165 If StartBit is greater than 15, then ASSERT().
4166 If EndBit is greater than 15, then ASSERT().
4167 If EndBit is less than StartBit, then ASSERT().
4188 Writes a bit field to a 16-bit value, and returns the result.
4191 Operand. All other bits in Operand are preserved. The new 16-bit value is
4194 If 16-bit operations are not supported, then ASSERT().
4195 If StartBit is greater than 15, then ASSERT().
4196 If EndBit is greater than 15, then ASSERT().
4197 If EndBit is less than StartBit, then ASSERT().
4198 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4207 @return The new 16-bit value.
4221 Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the
4226 Operand are preserved. The new 16-bit value is returned.
4228 If 16-bit operations are not supported, then ASSERT().
4229 If StartBit is greater than 15, then ASSERT().
4230 If EndBit is greater than 15, then ASSERT().
4231 If EndBit is less than StartBit, then ASSERT().
4232 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4241 @return The new 16-bit value.
4255 Reads a bit field from a 16-bit value, performs a bitwise AND, and returns
4260 preserved. The new 16-bit value is returned.
4262 If 16-bit operations are not supported, then ASSERT().
4263 If StartBit is greater than 15, then ASSERT().
4264 If EndBit is greater than 15, then ASSERT().
4265 If EndBit is less than StartBit, then ASSERT().
4266 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4275 @return The new 16-bit value.
4289 Reads a bit field from a 16-bit value, performs a bitwise AND followed by a
4295 preserved. The new 16-bit value is returned.
4297 If 16-bit operations are not supported, then ASSERT().
4298 If StartBit is greater than 15, then ASSERT().
4299 If EndBit is greater than 15, then ASSERT().
4300 If EndBit is less than StartBit, then ASSERT().
4301 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4302 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4312 @return The new 16-bit value.
4327 Returns a bit field from a 32-bit value.
4331 If 32-bit operations are not supported, then ASSERT().
4332 If StartBit is greater than 31, then ASSERT().
4333 If EndBit is greater than 31, then ASSERT().
4334 If EndBit is less than StartBit, then ASSERT().
4355 Writes a bit field to a 32-bit value, and returns the result.
4358 Operand. All other bits in Operand are preserved. The new 32-bit value is
4361 If 32-bit operations are not supported, then ASSERT().
4362 If StartBit is greater than 31, then ASSERT().
4363 If EndBit is greater than 31, then ASSERT().
4364 If EndBit is less than StartBit, then ASSERT().
4365 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4374 @return The new 32-bit value.
4388 Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the
4393 Operand are preserved. The new 32-bit value is returned.
4395 If 32-bit operations are not supported, then ASSERT().
4396 If StartBit is greater than 31, then ASSERT().
4397 If EndBit is greater than 31, then ASSERT().
4398 If EndBit is less than StartBit, then ASSERT().
4399 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4408 @return The new 32-bit value.
4422 Reads a bit field from a 32-bit value, performs a bitwise AND, and returns
4427 preserved. The new 32-bit value is returned.
4429 If 32-bit operations are not supported, then ASSERT().
4430 If StartBit is greater than 31, then ASSERT().
4431 If EndBit is greater than 31, then ASSERT().
4432 If EndBit is less than StartBit, then ASSERT().
4433 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4442 @return The new 32-bit value.
4456 Reads a bit field from a 32-bit value, performs a bitwise AND followed by a
4462 preserved. The new 32-bit value is returned.
4464 If 32-bit operations are not supported, then ASSERT().
4465 If StartBit is greater than 31, then ASSERT().
4466 If EndBit is greater than 31, then ASSERT().
4467 If EndBit is less than StartBit, then ASSERT().
4468 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4469 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4479 @return The new 32-bit value.
4494 Returns a bit field from a 64-bit value.
4498 If 64-bit operations are not supported, then ASSERT().
4499 If StartBit is greater than 63, then ASSERT().
4500 If EndBit is greater than 63, then ASSERT().
4501 If EndBit is less than StartBit, then ASSERT().
4522 Writes a bit field to a 64-bit value, and returns the result.
4525 Operand. All other bits in Operand are preserved. The new 64-bit value is
4528 If 64-bit operations are not supported, then ASSERT().
4529 If StartBit is greater than 63, then ASSERT().
4530 If EndBit is greater than 63, then ASSERT().
4531 If EndBit is less than StartBit, then ASSERT().
4532 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4541 @return The new 64-bit value.
4555 Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the
4560 Operand are preserved. The new 64-bit value is returned.
4562 If 64-bit operations are not supported, then ASSERT().
4563 If StartBit is greater than 63, then ASSERT().
4564 If EndBit is greater than 63, then ASSERT().
4565 If EndBit is less than StartBit, then ASSERT().
4566 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4575 @return The new 64-bit value.
4589 Reads a bit field from a 64-bit value, performs a bitwise AND, and returns
4594 preserved. The new 64-bit value is returned.
4596 If 64-bit operations are not supported, then ASSERT().
4597 If StartBit is greater than 63, then ASSERT().
4598 If EndBit is greater than 63, then ASSERT().
4599 If EndBit is less than StartBit, then ASSERT().
4600 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4609 @return The new 64-bit value.
4623 Reads a bit field from a 64-bit value, performs a bitwise AND followed by a
4629 preserved. The new 64-bit value is returned.
4631 If 64-bit operations are not supported, then ASSERT().
4632 If StartBit is greater than 63, then ASSERT().
4633 If EndBit is greater than 63, then ASSERT().
4634 If EndBit is less than StartBit, then ASSERT().
4635 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4636 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
4646 @return The new 64-bit value.
4660 Reads a bit field from a 32-bit value, counts and returns
4664 StartBit and EndBit in Operand. The count is returned.
4666 If StartBit is greater than 31, then ASSERT().
4667 If EndBit is greater than 31, then ASSERT().
4668 If EndBit is less than StartBit, then ASSERT().
4688 Reads a bit field from a 64-bit value, counts and returns
4692 StartBit and EndBit in Operand. The count is returned.
4694 If StartBit is greater than 63, then ASSERT().
4695 If EndBit is greater than 63, then ASSERT().
4696 If EndBit is less than StartBit, then ASSERT().
4725 The result is returned as UINT8. If Length is Zero, then Zero is
4728 If Buffer is NULL, then ASSERT().
4729 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4747 of 8-bit values.
4749 This function first calculates the sum of the 8-bit values in the
4751 of addition are dropped. Then, the two's complement of the sum is
4752 returned. If Length is 0, then 0 is returned.
4754 If Buffer is NULL, then ASSERT().
4755 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4772 Returns the sum of all elements in a buffer of 16-bit values. During
4775 This function calculates the sum of the 16-bit values in the buffer
4777 The 16-bit result is returned. If Length is 0, then 0 is returned.
4779 If Buffer is NULL, then ASSERT().
4780 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
4781 If Length is not aligned on a 16-bit boundary, then ASSERT().
4782 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4800 16-bit values.
4802 This function first calculates the sum of the 16-bit values in the buffer
4804 are dropped. Then, the two's complement of the sum is returned. If Length
4805 is 0, then 0 is returned.
4807 If Buffer is NULL, then ASSERT().
4808 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
4809 If Length is not aligned on a 16-bit boundary, then ASSERT().
4810 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4827 Returns the sum of all elements in a buffer of 32-bit values. During
4830 This function calculates the sum of the 32-bit values in the buffer
4832 The 32-bit result is returned. If Length is 0, then 0 is returned.
4834 If Buffer is NULL, then ASSERT().
4835 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
4836 If Length is not aligned on a 32-bit boundary, then ASSERT().
4837 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4855 32-bit values.
4857 This function first calculates the sum of the 32-bit values in the buffer
4859 are dropped. Then, the two's complement of the sum is returned. If Length
4860 is 0, then 0 is returned.
4862 If Buffer is NULL, then ASSERT().
4863 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
4864 If Length is not aligned on a 32-bit boundary, then ASSERT().
4865 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4882 Returns the sum of all elements in a buffer of 64-bit values. During
4885 This function calculates the sum of the 64-bit values in the buffer
4887 The 64-bit result is returned. If Length is 0, then 0 is returned.
4889 If Buffer is NULL, then ASSERT().
4890 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
4891 If Length is not aligned on a 64-bit boundary, then ASSERT().
4892 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4910 64-bit values.
4912 This function first calculates the sum of the 64-bit values in the buffer
4914 are dropped. Then, the two's complement of the sum is returned. If Length
4915 is 0, then 0 is returned.
4917 If Buffer is NULL, then ASSERT().
4918 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
4919 If Length is not aligned on a 64-bit boundary, then ASSERT().
4920 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4936 Computes and returns a 32-bit CRC for a data buffer.
4937 CRC32 value bases on ITU-T V.42.
4939 If Buffer is NULL, then ASSERT().
4940 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
4942 @param[in] Buffer A pointer to the buffer on which the 32-bit CRC is to be computed.
4945 @retval Crc32 The 32-bit CRC was computed for the data buffer.
4960 Function entry point used when a stack switch is requested with SwitchStack()
4994 calls to LongJump() cause a non-zero value to be returned by SetJump().
4996 If JumpBuffer is NULL, then ASSERT().
4997 For Itanium processors, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
4999 NOTE: The structure BASE_LIBRARY_JUMP_BUFFER is CPU architecture specific.
5001 …For example, a BASE_LIBRARY_JUMP_BUFFER allocated by an IA-32 module must never be used from an x6…
5002 SetJump()/LongJump() is not currently supported for the EBC processor type.
5021 function never returns to the caller. Instead is resumes execution based on
5024 If JumpBuffer is NULL, then ASSERT().
5025 For Itanium processors, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
5026 If Value is 0, then ASSERT().
5029 @param Value The value to return when the SetJump() context is
5030 restored and must be non-zero.
5111 InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
5112 InterruptState is FALSE, then interrupts are disabled. InterruptState is
5150 These additional arguments are ignored on IA-32, x64, and EBC architectures.
5154 If EntryPoint is NULL, then ASSERT().
5155 If NewStack is NULL, then ASSERT().
5164 @param ... This variable argument list is ignored for IA-32, x64, and
5166 argument list is expected to contain a single parameter of
5229 /// Byte packed structure for 16-bit Real Mode EFLAGS.
5254 /// 32-bits on IA-32.
5255 /// 64-bits on x64. The upper 32-bits on x64 are reserved.
5287 /// 32-bits on IA-32.
5288 /// 64-bits on x64. The upper 32-bits on x64 are reserved.
5303 UINT32 NW:1; ///< Mot Write-through.
5312 /// 32-bits on IA-32.
5313 /// 64-bits on x64. The upper 32-bits on x64 are reserved.
5317 UINT32 VME:1; ///< Virtual-8086 Mode Extensions.
5318 UINT32 PVI:1; ///< Protected-Mode Virtual Interrupts.
5332 UINT32 UMIP:1; ///< User-Mode Instruction Prevention.
5343 UINT32 PKE:1; ///< Protection-Key Enable.
5392 /// Byte packed structure for an IA-32 Interrupt Gate Descriptor.
5407 // IA32 Task-State Segment Definition
5434 UINT16 CS; member
5493 // IA32 Task-State Segment Definition
5541 /// Structures for the 16-bit real mode thunks.
5596 UINT16 CS; member
5607 /// Byte packed structure for an 16-bit real mode thunks.
5624 /// While the type is technically defined as a function type (note: not a
5625 /// pointer-to-function type), such labels in NASM source code never stand for
5627 /// never be called. This is also why the EFIAPI calling convention specifier
5628 /// is missing from the typedef, and why the typedef does not follow the usual
5629 /// edk2 coding style for function (or pointer-to-function) typedefs. The VOID
5639 If Eax is not NULL, then the value of EAX after CPUID is returned in Eax.
5640 If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx.
5641 If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx.
5642 If Edx is not NULL, then the value of EDX after CPUID is returned in Edx.
5643 This function is only available on IA-32 and x64.
5645 @param Index The 32-bit value to load into EAX prior to invoking the CPUID
5647 @param Eax The pointer to the 32-bit EAX value returned by the CPUID
5648 instruction. This is an optional parameter that may be NULL.
5649 @param Ebx The pointer to the 32-bit EBX value returned by the CPUID
5650 instruction. This is an optional parameter that may be NULL.
5651 @param Ecx The pointer to the 32-bit ECX value returned by the CPUID
5652 instruction. This is an optional parameter that may be NULL.
5653 @param Edx The pointer to the 32-bit EDX value returned by the CPUID
5654 instruction. This is an optional parameter that may be NULL.
5675 Index. This function is only available on IA-32 and x64.
5677 If Eax is not NULL, then the value of EAX after CPUID is returned in Eax.
5678 If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx.
5679 If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx.
5680 If Edx is not NULL, then the value of EDX after CPUID is returned in Edx.
5682 @param Index The 32-bit value to load into EAX prior to invoking the
5684 @param SubIndex The 32-bit value to load into ECX prior to invoking the
5686 @param Eax The pointer to the 32-bit EAX value returned by the CPUID
5687 instruction. This is an optional parameter that may be
5689 @param Ebx The pointer to the 32-bit EBX value returned by the CPUID
5690 instruction. This is an optional parameter that may be
5692 @param Ecx The pointer to the 32-bit ECX value returned by the CPUID
5693 instruction. This is an optional parameter that may be
5695 @param Edx The pointer to the 32-bit EDX value returned by the CPUID
5696 instruction. This is an optional parameter that may be
5718 and executing a WBINVD instruction. This function is only available on IA-32 and x64.
5732 bits of CR0 to 0. This function is only available on IA-32 and x64.
5743 Returns the lower 32-bits of a Machine Specific Register(MSR).
5745 Reads and returns the lower 32-bits of the MSR specified by Index.
5746 No parameter checking is performed on Index, and some Index values may cause
5747 CPU exceptions. The caller must either guarantee that Index is valid, or the
5749 is only available on IA-32 and x64.
5751 @param Index The 32-bit MSR index to read.
5764 Writes a 32-bit value to a Machine Specific Register(MSR), and returns the value.
5765 The upper 32-bits of the MSR are set to zero.
5767 Writes the 32-bit value specified by Value to the MSR specified by Index. The
5768 upper 32-bits of the MSR write are set to zero. The 32-bit value written to
5769 the MSR is returned. No parameter checking is performed on Index or Value,
5772 handlers. This function is only available on IA-32 and x64.
5774 @param Index The 32-bit MSR index to write.
5775 @param Value The 32-bit value to write to the MSR.
5789 Reads a 64-bit MSR, performs a bitwise OR on the lower 32-bits, and
5790 writes the result back to the 64-bit MSR.
5792 Reads the 64-bit MSR specified by Index, performs a bitwise OR
5793 between the lower 32-bits of the read result and the value specified by
5794 OrData, and writes the result to the 64-bit MSR specified by Index. The lower
5795 32-bits of the value written to the MSR is returned. No parameter checking is
5798 must establish proper exception handlers. This function is only available on
5799 IA-32 and x64.
5801 @param Index The 32-bit MSR index to write.
5804 @return The lower 32-bit value written to the MSR.
5816 Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes
5817 the result back to the 64-bit MSR.
5819 Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
5820 lower 32-bits of the read result and the value specified by AndData, and
5821 writes the result to the 64-bit MSR specified by Index. The lower 32-bits of
5822 the value written to the MSR is returned. No parameter checking is performed
5825 establish proper exception handlers. This function is only available on IA-32
5828 @param Index The 32-bit MSR index to write.
5831 @return The lower 32-bit value written to the MSR.
5843 Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise OR
5844 on the lower 32-bits, and writes the result back to the 64-bit MSR.
5846 Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
5847 lower 32-bits of the read result and the value specified by AndData
5848 preserving the upper 32-bits, performs a bitwise OR between the
5850 result to the 64-bit MSR specified by Address. The lower 32-bits of the value
5851 written to the MSR is returned. No parameter checking is performed on Index,
5854 caller must establish proper exception handlers. This function is only
5855 available on IA-32 and x64.
5857 @param Index The 32-bit MSR index to write.
5861 @return The lower 32-bit value written to the MSR.
5876 Reads the bit field in the lower 32-bits of a 64-bit MSR. The bit field is
5877 specified by the StartBit and the EndBit. The value of the bit field is
5878 returned. The caller must either guarantee that Index is valid, or the caller
5879 must set up exception handlers to catch the exceptions. This function is only
5880 available on IA-32 and x64.
5882 If StartBit is greater than 31, then ASSERT().
5883 If EndBit is greater than 31, then ASSERT().
5884 If EndBit is less than StartBit, then ASSERT().
5886 @param Index The 32-bit MSR index to read.
5907 Writes Value to a bit field in the lower 32-bits of a 64-bit MSR. The bit
5908 field is specified by the StartBit and the EndBit. All other bits in the
5909 destination MSR are preserved. The lower 32-bits of the MSR written is
5911 is valid, or the caller must set up exception handlers to catch the exceptions.
5912 This function is only available on IA-32 and x64.
5914 If StartBit is greater than 31, then ASSERT().
5915 If EndBit is greater than 31, then ASSERT().
5916 If EndBit is less than StartBit, then ASSERT().
5917 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
5919 @param Index The 32-bit MSR index to write.
5926 @return The lower 32-bit of the value written to the MSR.
5940 Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the
5941 result back to the bit field in the 64-bit MSR.
5943 Reads the 64-bit MSR specified by Index, performs a bitwise OR
5945 result to the 64-bit MSR specified by Index. The lower 32-bits of the value
5947 caller must either guarantee that Index and the data written is valid, or
5949 function is only available on IA-32 and x64.
5951 If StartBit is greater than 31, then ASSERT().
5952 If EndBit is greater than 31, then ASSERT().
5953 If EndBit is less than StartBit, then ASSERT().
5954 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
5956 @param Index The 32-bit MSR index to write.
5963 @return The lower 32-bit of the value written to the MSR.
5977 Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
5978 result back to the bit field in the 64-bit MSR.
5980 Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
5982 64-bit MSR specified by Index. The lower 32-bits of the value written to the
5984 either guarantee that Index and the data written is valid, or the caller must
5985 set up exception handlers to catch the exceptions. This function is only
5986 available on IA-32 and x64.
5988 If StartBit is greater than 31, then ASSERT().
5989 If EndBit is greater than 31, then ASSERT().
5990 If EndBit is less than StartBit, then ASSERT().
5991 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
5993 @param Index The 32-bit MSR index to write.
6000 @return The lower 32-bit of the value written to the MSR.
6014 Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
6016 64-bit MSR.
6018 Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by a
6020 AndData, and writes the result to the 64-bit MSR specified by Index. The
6021 lower 32-bits of the value written to the MSR are returned. Extra left bits
6023 that Index and the data written is valid, or the caller must set up exception
6024 handlers to catch the exceptions. This function is only available on IA-32
6027 If StartBit is greater than 31, then ASSERT().
6028 If EndBit is greater than 31, then ASSERT().
6029 If EndBit is less than StartBit, then ASSERT().
6030 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
6031 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
6033 @param Index The 32-bit MSR index to write.
6041 @return The lower 32-bit of the value written to the MSR.
6056 Returns a 64-bit Machine Specific Register(MSR).
6058 Reads and returns the 64-bit MSR specified by Index. No parameter checking is
6060 caller must either guarantee that Index is valid, or the caller must set up
6061 exception handlers to catch the exceptions. This function is only available
6062 on IA-32 and x64.
6064 @param Index The 32-bit MSR index to read.
6077 Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
6080 Writes the 64-bit value specified by Value to the MSR specified by Index. The
6081 64-bit value written to the MSR is returned. No parameter checking is
6084 must establish proper exception handlers. This function is only available on
6085 IA-32 and x64.
6087 @param Index The 32-bit MSR index to write.
6088 @param Value The 64-bit value to write to the MSR.
6102 Reads a 64-bit MSR, performs a bitwise OR, and writes the result
6103 back to the 64-bit MSR.
6105 Reads the 64-bit MSR specified by Index, performs a bitwise OR
6107 result to the 64-bit MSR specified by Index. The value written to the MSR is
6108 returned. No parameter checking is performed on Index or OrData, and some of
6111 This function is only available on IA-32 and x64.
6113 @param Index The 32-bit MSR index to write.
6128 Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the
6129 64-bit MSR.
6131 Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
6133 64-bit MSR specified by Index. The value written to the MSR is returned. No
6134 parameter checking is performed on Index or OrData, and some of these may
6137 function is only available on IA-32 and x64.
6139 @param Index The 32-bit MSR index to write.
6154 Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise
6155 OR, and writes the result back to the 64-bit MSR.
6157 Reads the 64-bit MSR specified by Index, performs a bitwise AND between read
6160 and writes the result to the 64-bit MSR specified by Index. The value written
6161 to the MSR is returned. No parameter checking is performed on Index, AndData,
6164 establish proper exception handlers. This function is only available on IA-32
6167 @param Index The 32-bit MSR index to write.
6186 Reads the bit field in the 64-bit MSR. The bit field is specified by the
6187 StartBit and the EndBit. The value of the bit field is returned. The caller
6188 must either guarantee that Index is valid, or the caller must set up
6189 exception handlers to catch the exceptions. This function is only available
6190 on IA-32 and x64.
6192 If StartBit is greater than 63, then ASSERT().
6193 If EndBit is greater than 63, then ASSERT().
6194 If EndBit is less than StartBit, then ASSERT().
6196 @param Index The 32-bit MSR index to read.
6217 Writes Value to a bit field in a 64-bit MSR. The bit field is specified by
6219 preserved. The MSR written is returned. The caller must either guarantee
6220 that Index and the data written is valid, or the caller must set up exception
6221 handlers to catch the exceptions. This function is only available on IA-32 and x64.
6223 If StartBit is greater than 63, then ASSERT().
6224 If EndBit is greater than 63, then ASSERT().
6225 If EndBit is less than StartBit, then ASSERT().
6226 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
6228 @param Index The 32-bit MSR index to write.
6249 Reads a bit field in a 64-bit MSR, performs a bitwise OR, and
6250 writes the result back to the bit field in the 64-bit MSR.
6252 Reads the 64-bit MSR specified by Index, performs a bitwise OR
6254 result to the 64-bit MSR specified by Index. The value written to the MSR is
6256 guarantee that Index and the data written is valid, or the caller must set up
6257 exception handlers to catch the exceptions. This function is only available
6258 on IA-32 and x64.
6260 If StartBit is greater than 63, then ASSERT().
6261 If EndBit is greater than 63, then ASSERT().
6262 If EndBit is less than StartBit, then ASSERT().
6263 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
6265 @param Index The 32-bit MSR index to write.
6286 Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
6287 result back to the bit field in the 64-bit MSR.
6289 Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
6291 64-bit MSR specified by Index. The value written to the MSR is returned.
6293 that Index and the data written is valid, or the caller must set up exception
6294 handlers to catch the exceptions. This function is only available on IA-32
6297 If StartBit is greater than 63, then ASSERT().
6298 If EndBit is greater than 63, then ASSERT().
6299 If EndBit is less than StartBit, then ASSERT().
6300 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
6302 @param Index The 32-bit MSR index to write.
6323 Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
6325 64-bit MSR.
6327 Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by
6329 AndData, and writes the result to the 64-bit MSR specified by Index. The
6330 value written to the MSR is returned. Extra left bits in both AndData and
6332 written is valid, or the caller must set up exception handlers to catch the
6333 exceptions. This function is only available on IA-32 and x64.
6335 If StartBit is greater than 63, then ASSERT().
6336 If EndBit is greater than 63, then ASSERT().
6337 If EndBit is less than StartBit, then ASSERT().
6338 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
6339 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
6341 @param Index The 32-bit MSR index to write.
6366 Reads and returns the current value of the EFLAGS register. This function is
6367 only available on IA-32 and x64. This returns a 32-bit value on IA-32 and a
6368 64-bit value on x64.
6370 @return EFLAGS on IA-32 or RFLAGS on x64.
6383 Reads and returns the current value of CR0. This function is only available
6384 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6400 Reads and returns the current value of CR2. This function is only available
6401 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6417 Reads and returns the current value of CR3. This function is only available
6418 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6434 Reads and returns the current value of CR4. This function is only available
6435 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6451 Writes and returns a new value to CR0. This function is only available on
6452 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6469 Writes and returns a new value to CR2. This function is only available on
6470 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6487 Writes and returns a new value to CR3. This function is only available on
6488 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6505 Writes and returns a new value to CR4. This function is only available on
6506 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6523 Reads and returns the current value of DR0. This function is only available
6524 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6540 Reads and returns the current value of DR1. This function is only available
6541 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6557 Reads and returns the current value of DR2. This function is only available
6558 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6574 Reads and returns the current value of DR3. This function is only available
6575 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6591 Reads and returns the current value of DR4. This function is only available
6592 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6608 Reads and returns the current value of DR5. This function is only available
6609 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6625 Reads and returns the current value of DR6. This function is only available
6626 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6642 Reads and returns the current value of DR7. This function is only available
6643 on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
6659 Writes and returns a new value to DR0. This function is only available on
6660 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6677 Writes and returns a new value to DR1. This function is only available on
6678 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6695 Writes and returns a new value to DR2. This function is only available on
6696 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6713 Writes and returns a new value to DR3. This function is only available on
6714 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6731 Writes and returns a new value to DR4. This function is only available on
6732 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6749 Writes and returns a new value to DR5. This function is only available on
6750 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6767 Writes and returns a new value to DR6. This function is only available on
6768 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6785 Writes and returns a new value to DR7. This function is only available on
6786 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
6801 Reads the current value of Code Segment Register (CS).
6803 Reads and returns the current value of CS. This function is only available on
6804 IA-32 and x64.
6806 @return The current value of CS.
6819 Reads and returns the current value of DS. This function is only available on
6820 IA-32 and x64.
6835 Reads and returns the current value of ES. This function is only available on
6836 IA-32 and x64.
6851 Reads and returns the current value of FS. This function is only available on
6852 IA-32 and x64.
6867 Reads and returns the current value of GS. This function is only available on
6868 IA-32 and x64.
6883 Reads and returns the current value of SS. This function is only available on
6884 IA-32 and x64.
6899 Reads and returns the current value of TR. This function is only available on
6900 IA-32 and x64.
6916 function is only available on IA-32 and x64.
6918 If Gdtr is NULL, then ASSERT().
6933 Writes and the current GDTR descriptor specified by Gdtr. This function is
6934 only available on IA-32 and x64.
6936 If Gdtr is NULL, then ASSERT().
6952 function is only available on IA-32 and x64.
6954 If Idtr is NULL, then ASSERT().
6969 Writes the current IDTR descriptor and returns it in Idtr. This function is
6970 only available on IA-32 and x64.
6972 If Idtr is NULL, then ASSERT().
6987 Reads and returns the current 16-bit LDTR descriptor value. This function is
6988 only available on IA-32 and x64.
7003 Writes and the current LDTR descriptor specified by Ldtr. This function is
7004 only available on IA-32 and x64.
7006 @param Ldtr 16-bit LDTR selector value.
7020 Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
7021 available on IA-32 and x64.
7023 If Buffer is NULL, then ASSERT().
7024 If Buffer is not aligned on a 16-byte boundary, then ASSERT().
7040 by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
7041 only available on IA-32 and x64.
7043 If Buffer is NULL, then ASSERT().
7044 If Buffer is not aligned on a 16-byte boundary, then ASSERT().
7058 Reads the current value of 64-bit MMX Register #0 (MM0).
7060 Reads and returns the current value of MM0. This function is only available
7061 on IA-32 and x64.
7074 Reads the current value of 64-bit MMX Register #1 (MM1).
7076 Reads and returns the current value of MM1. This function is only available
7077 on IA-32 and x64.
7090 Reads the current value of 64-bit MMX Register #2 (MM2).
7092 Reads and returns the current value of MM2. This function is only available
7093 on IA-32 and x64.
7106 Reads the current value of 64-bit MMX Register #3 (MM3).
7108 Reads and returns the current value of MM3. This function is only available
7109 on IA-32 and x64.
7122 Reads the current value of 64-bit MMX Register #4 (MM4).
7124 Reads and returns the current value of MM4. This function is only available
7125 on IA-32 and x64.
7138 Reads the current value of 64-bit MMX Register #5 (MM5).
7140 Reads and returns the current value of MM5. This function is only available
7141 on IA-32 and x64.
7154 Reads the current value of 64-bit MMX Register #6 (MM6).
7156 Reads and returns the current value of MM6. This function is only available
7157 on IA-32 and x64.
7170 Reads the current value of 64-bit MMX Register #7 (MM7).
7172 Reads and returns the current value of MM7. This function is only available
7173 on IA-32 and x64.
7186 Writes the current value of 64-bit MMX Register #0 (MM0).
7188 Writes the current value of MM0. This function is only available on IA32 and
7191 @param Value The 64-bit value to write to MM0.
7202 Writes the current value of 64-bit MMX Register #1 (MM1).
7204 Writes the current value of MM1. This function is only available on IA32 and
7207 @param Value The 64-bit value to write to MM1.
7218 Writes the current value of 64-bit MMX Register #2 (MM2).
7220 Writes the current value of MM2. This function is only available on IA32 and
7223 @param Value The 64-bit value to write to MM2.
7234 Writes the current value of 64-bit MMX Register #3 (MM3).
7236 Writes the current value of MM3. This function is only available on IA32 and
7239 @param Value The 64-bit value to write to MM3.
7250 Writes the current value of 64-bit MMX Register #4 (MM4).
7252 Writes the current value of MM4. This function is only available on IA32 and
7255 @param Value The 64-bit value to write to MM4.
7266 Writes the current value of 64-bit MMX Register #5 (MM5).
7268 Writes the current value of MM5. This function is only available on IA32 and
7271 @param Value The 64-bit value to write to MM5.
7282 Writes the current value of 64-bit MMX Register #6 (MM6).
7284 Writes the current value of MM6. This function is only available on IA32 and
7287 @param Value The 64-bit value to write to MM6.
7298 Writes the current value of 64-bit MMX Register #7 (MM7).
7300 Writes the current value of MM7. This function is only available on IA32 and
7303 @param Value The 64-bit value to write to MM7.
7316 Reads and returns the current value of TSC. This function is only available
7317 on IA-32 and x64.
7333 Index. This function is only available on IA-32 and x64.
7335 @param Index The 32-bit Performance Counter index to read.
7348 Sets up a monitor buffer that is used by AsmMwait().
7351 and Edx. Returns Eax. This function is only available on IA-32 and x64.
7376 Ecx. Returns Eax. This function is only available on IA-32 and x64.
7397 Executes a WBINVD instruction. This function is only available on IA-32 and
7411 Executes a INVD instruction. This function is only available on IA-32 and
7427 This function is only available on IA-32 and x64.
7429 @param LinearAddress The address of the cache line to flush. If the CPU is
7430 in a physical addressing mode, then LinearAddress is a
7431 physical address. If the CPU is in a virtual
7432 addressing mode, then LinearAddress is a virtual
7445 Enables the 32-bit paging mode on the CPU.
7447 Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
7449 assumes the current execution mode is 32-bit protected mode. This function is
7450 only available on IA-32. After the 32-bit paging mode is enabled, control is
7456 If the current execution mode is not 32-bit protected mode, then ASSERT().
7457 If EntryPoint is NULL, then ASSERT().
7458 If NewStack is NULL, then ASSERT().
7463 2) The caller must be in 32-bit protected mode with flat descriptors. This
7465 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
7468 is complete, and those page tables must guarantee that the pages for this
7472 paging is enabled.
7474 function as the first parameter after paging is enabled.
7476 function as the second parameter after paging is enabled.
7478 function after paging is enabled.
7492 Disables the 32-bit paging mode on the CPU.
7494 Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
7495 mode. This function assumes the current execution mode is 32-paged protected
7496 mode. This function is only available on IA-32. After the 32-bit paging mode
7497 is disabled, control is transferred to the function specified by EntryPoint
7502 If the current execution mode is not 32-bit paged mode, then ASSERT().
7503 If EntryPoint is NULL, then ASSERT().
7504 If NewStack is NULL, then ASSERT().
7509 2) The caller must be in 32-bit paged mode.
7510 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
7515 paging is disabled.
7517 function as the first parameter after paging is disabled.
7519 function as the second parameter after paging is
7522 function after paging is disabled.
7536 Enables the 64-bit paging mode on the CPU.
7538 Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
7540 assumes the current execution mode is 32-bit protected mode with flat
7541 descriptors. This function is only available on IA-32. After the 64-bit
7542 paging mode is enabled, control is transferred to the function specified by
7547 If the current execution mode is not 32-bit protected mode with flat
7549 If EntryPoint is 0, then ASSERT().
7550 If NewStack is 0, then ASSERT().
7552 @param Cs The 16-bit selector to load in the CS before EntryPoint
7553 is called. The descriptor in the GDT that this selector
7555 @param EntryPoint The 64-bit virtual address of the function to call with
7556 the new stack after paging is enabled.
7557 @param Context1 The 64-bit virtual address of the context to pass into
7559 paging is enabled.
7560 @param Context2 The 64-bit virtual address of the context to pass into
7562 paging is enabled.
7563 @param NewStack The 64-bit virtual address of the new stack to use for
7564 the EntryPoint function after paging is enabled.
7570 IN UINT16 Cs,
7579 Disables the 64-bit paging mode on the CPU.
7581 Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
7582 mode. This function assumes the current execution mode is 64-paging mode.
7583 This function is only available on x64. After the 64-bit paging mode is
7584 disabled, control is transferred to the function specified by EntryPoint
7589 If the current execution mode is not 64-bit paged mode, then ASSERT().
7590 If EntryPoint is 0, then ASSERT().
7591 If NewStack is 0, then ASSERT().
7593 @param Cs The 16-bit selector to load in the CS before EntryPoint
7594 is called. The descriptor in the GDT that this selector
7595 references must be setup for 32-bit protected mode.
7596 @param EntryPoint The 64-bit virtual address of the function to call with
7597 the new stack after paging is disabled.
7598 @param Context1 The 64-bit virtual address of the context to pass into
7600 paging is disabled.
7601 @param Context2 The 64-bit virtual address of the context to pass into
7603 paging is disabled.
7604 @param NewStack The 64-bit virtual address of the new stack to use for
7605 the EntryPoint function after paging is disabled.
7611 IN UINT16 Cs,
7620 // 16-bit thunking services
7624 Retrieves the properties for 16-bit thunk functions.
7628 buffer size is returned in RealModeBufferSize, and the stack size is returned
7629 in ExtraStackSize. If parameters are passed to the 16-bit real mode code,
7630 then the actual minimum stack size is ExtraStackSize plus the maximum number
7631 of bytes that need to be passed to the 16-bit real mode code.
7633 If RealModeBufferSize is NULL, then ASSERT().
7634 If ExtraStackSize is NULL, then ASSERT().
7637 required to use the 16-bit thunk functions.
7639 that the 16-bit thunk functions require for
7641 16-bit real mode.
7657 …This interface is limited to be used in either physical mode or virtual modes with paging enabled …
7658 virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1.
7660 If ThunkContext is NULL, then ASSERT().
7663 16-bit real mode code to call.
7674 Transfers control to a 16-bit real mode entry point and returns the results.
7676 Transfers control to a 16-bit real mode entry point and returns the results.
7677 AsmPrepareThunk16() must be called with ThunkContext before this function is used.
7680 The register state from the RealModeState field of ThunkContext is restored just prior
7681 to calling the 16-bit real mode entry point. This includes the EFLAGS field of RealModeState,
7682 which is used to set the interrupt state when a 16-bit real mode entry point is called.
7683 …Control is transferred to the 16-bit real mode entry point specified by the CS and Eip fields of R…
7684 The stack is initialized to the SS and ESP fields of RealModeState. Any parameters passed to
7685 …the 16-bit real mode code must be populated by the caller at SS:ESP prior to calling this function.
7686 The 16-bit real mode entry point is invoked with a 16-bit CALL FAR instruction,
7687 so when accessing stack contents, the 16-bit real mode code must account for the 16-bit segment
7688 …and 16-bit offset of the return address that were pushed onto the stack. The 16-bit real mode entry
7689 …point must exit with a RETF instruction. The register state is captured into RealModeState immedia…
7690 after the RETF instruction is executed.
7692 If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts,
7693 …or any of the 16-bit real mode code makes a SW interrupt, then the caller is responsible for makin…
7694 …the IDT at address 0 is initialized to handle any HW or SW interrupts that may occur while in 16-b…
7696 If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts,
7697 …then the caller is responsible for making sure the 8259 PIC is in a state compatible with 16-bit r…
7700 …If THUNK_ATTRIBUTE_BIG_REAL_MODE is set in the ThunkAttributes field of ThunkContext, then the use…
7701 …is invoked in big real mode. Otherwise, the user code is invoked in 16-bit real mode with 64KB se…
7704 …ThunkAttributes, then it is assumed that the user code did not enable the A20 mask, and no attempt…
7707 …If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is set and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is…
7711 …If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is clear and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL …
7714 If ThunkContext is NULL, then ASSERT().
7719 …This interface is limited to be used in either physical mode or virtual modes with paging enabled …
7723 16-bit real mode code to call.
7734 Prepares all structures and code for a 16-bit real mode thunk, transfers
7735 control to a 16-bit real mode entry point, and returns the results.
7737 Prepares all structures and code for a 16-bit real mode thunk, transfers
7738 control to a 16-bit real mode entry point, and returns the results. If the
7739 caller only need to perform a single 16-bit real mode thunk, then this
7740 service should be used. If the caller intends to make more than one 16-bit
7741 real mode thunk, then it is more efficient if AsmPrepareThunk16() is called
7742 once and AsmThunk16() can be called for each 16-bit real mode thunk.
7744 …This interface is limited to be used in either physical mode or virtual modes with paging enabled …
7745 virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1.
7750 16-bit real mode code to call.
7760 Generates a 16-bit random number through RDRAND instruction.
7762 if Rand is NULL, then ASSERT().
7777 Generates a 32-bit random number through RDRAND instruction.
7779 if Rand is NULL, then ASSERT().
7794 Generates a 64-bit random number through RDRAND instruction.
7796 if Rand is NULL, then ASSERT().
7822 Performs a serializing operation on all load-from-memory instructions that
7825 Executes a LFENCE instruction. This function is only available on IA-32 and x64.
7836 word, dword or qword operand is encoded at the end of the instruction's
7854 immediate operand to patch is expected to
7856 If InstructionEnd is closer to address 0 than
7860 The caller is responsible for ensuring that