TianoCore EDK2 master
Loading...
Searching...
No Matches
SafeIntLib.h
Go to the documentation of this file.
1
12#ifndef __INT_SAFE_LIB_H__
13#define __INT_SAFE_LIB_H__
14
15//
16// It is common for -1 to be used as an error value
17//
18#define INT8_ERROR ((INT8) -1)
19#define UINT8_ERROR MAX_UINT8
20#define CHAR8_ERROR ((CHAR8)(MAX_INT8))
21#define INT16_ERROR ((INT16) -1)
22#define UINT16_ERROR MAX_UINT16
23#define CHAR16_ERROR MAX_UINT16
24#define INT32_ERROR ((INT32) -1)
25#define UINT32_ERROR MAX_UINT32
26#define INT64_ERROR ((INT64) -1)
27#define UINT64_ERROR MAX_UINT64
28#define INTN_ERROR ((INTN) -1)
29#define UINTN_ERROR MAX_UINTN
30
31//
32// CHAR16 is defined to be the same as UINT16, so for CHAR16
33// operations redirect to the UINT16 ones:
34//
35#define SafeInt8ToChar16 SafeInt8ToUint16
36#define SafeInt16ToChar16 SafeInt16ToUint16
37#define SafeInt32ToChar16 SafeInt32ToUint16
38#define SafeUint32ToChar16 SafeUint32ToUint16
39#define SafeInt64ToChar16 SafeInt64ToUint16
40#define SafeUint64ToChar16 SafeUint64ToUint16
41#define SafeIntnToChar16 SafeIntnToUint16
42#define SafeUintnToChar16 SafeUintnToUint16
43
44#define SafeChar16ToInt8 SafeUint16ToInt8
45#define SafeChar16ToUint8 SafeUint16ToUint8
46#define SafeChar16ToChar8 SafeUint16ToChar8
47#define SafeChar16ToInt16 SafeUint16ToInt16
48
49#define SafeChar16Mult SafeUint16Mult
50#define SafeChar16Sub SafeUint16Sub
51#define SafeChar16Add SafeUint16Add
52
53//
54// Conversion functions
55//
56// There are three reasons for having conversion functions:
57//
58// 1. We are converting from a signed type to an unsigned type of the same
59// size, or vice-versa.
60//
61// 2. We are converting to a smaller type, and we could therefore possibly
62// overflow.
63//
64// 3. We are converting to a bigger type, and we are signed and the type we are
65// converting to is unsigned.
66//
67
88RETURN_STATUS
89EFIAPI
91 IN INT8 Operand,
92 OUT UINT8 *Result
93 );
94
115RETURN_STATUS
116EFIAPI
118 IN INT8 Operand,
119 OUT CHAR8 *Result
120 );
121
142RETURN_STATUS
143EFIAPI
145 IN INT8 Operand,
146 OUT UINT16 *Result
147 );
148
169RETURN_STATUS
170EFIAPI
172 IN INT8 Operand,
173 OUT UINT32 *Result
174 );
175
196RETURN_STATUS
197EFIAPI
199 IN INT8 Operand,
200 OUT UINTN *Result
201 );
202
223RETURN_STATUS
224EFIAPI
226 IN INT8 Operand,
227 OUT UINT64 *Result
228 );
229
250RETURN_STATUS
251EFIAPI
253 IN UINT8 Operand,
254 OUT INT8 *Result
255 );
256
277RETURN_STATUS
278EFIAPI
280 IN UINT8 Operand,
281 OUT CHAR8 *Result
282 );
283
304RETURN_STATUS
305EFIAPI
307 IN INT16 Operand,
308 OUT INT8 *Result
309 );
310
331RETURN_STATUS
332EFIAPI
334 IN INT16 Operand,
335 OUT CHAR8 *Result
336 );
337
358RETURN_STATUS
359EFIAPI
361 IN INT16 Operand,
362 OUT UINT8 *Result
363 );
364
385RETURN_STATUS
386EFIAPI
388 IN INT16 Operand,
389 OUT UINT16 *Result
390 );
391
412RETURN_STATUS
413EFIAPI
415 IN INT16 Operand,
416 OUT UINT32 *Result
417 );
418
439RETURN_STATUS
440EFIAPI
442 IN INT16 Operand,
443 OUT UINTN *Result
444 );
445
466RETURN_STATUS
467EFIAPI
469 IN INT16 Operand,
470 OUT UINT64 *Result
471 );
472
493RETURN_STATUS
494EFIAPI
496 IN UINT16 Operand,
497 OUT INT8 *Result
498 );
499
520RETURN_STATUS
521EFIAPI
523 IN UINT16 Operand,
524 OUT CHAR8 *Result
525 );
526
547RETURN_STATUS
548EFIAPI
550 IN UINT16 Operand,
551 OUT UINT8 *Result
552 );
553
574RETURN_STATUS
575EFIAPI
577 IN UINT16 Operand,
578 OUT INT16 *Result
579 );
580
601RETURN_STATUS
602EFIAPI
604 IN INT32 Operand,
605 OUT INT8 *Result
606 );
607
628RETURN_STATUS
629EFIAPI
631 IN INT32 Operand,
632 OUT CHAR8 *Result
633 );
634
655RETURN_STATUS
656EFIAPI
658 IN INT32 Operand,
659 OUT UINT8 *Result
660 );
661
682RETURN_STATUS
683EFIAPI
685 IN INT32 Operand,
686 OUT INT16 *Result
687 );
688
709RETURN_STATUS
710EFIAPI
712 IN INT32 Operand,
713 OUT UINT16 *Result
714 );
715
736RETURN_STATUS
737EFIAPI
739 IN INT32 Operand,
740 OUT UINT32 *Result
741 );
742
763RETURN_STATUS
764EFIAPI
766 IN INT32 Operand,
767 OUT UINTN *Result
768 );
769
790RETURN_STATUS
791EFIAPI
793 IN INT32 Operand,
794 OUT UINT64 *Result
795 );
796
817RETURN_STATUS
818EFIAPI
820 IN UINT32 Operand,
821 OUT INT8 *Result
822 );
823
844RETURN_STATUS
845EFIAPI
847 IN UINT32 Operand,
848 OUT CHAR8 *Result
849 );
850
871RETURN_STATUS
872EFIAPI
874 IN UINT32 Operand,
875 OUT UINT8 *Result
876 );
877
898RETURN_STATUS
899EFIAPI
901 IN UINT32 Operand,
902 OUT INT16 *Result
903 );
904
925RETURN_STATUS
926EFIAPI
928 IN UINT32 Operand,
929 OUT UINT16 *Result
930 );
931
952RETURN_STATUS
953EFIAPI
955 IN UINT32 Operand,
956 OUT INT32 *Result
957 );
958
979RETURN_STATUS
980EFIAPI
982 IN UINT32 Operand,
983 OUT INTN *Result
984 );
985
1006RETURN_STATUS
1007EFIAPI
1009 IN INTN Operand,
1010 OUT INT8 *Result
1011 );
1012
1033RETURN_STATUS
1034EFIAPI
1036 IN INTN Operand,
1037 OUT CHAR8 *Result
1038 );
1039
1060RETURN_STATUS
1061EFIAPI
1063 IN INTN Operand,
1064 OUT UINT8 *Result
1065 );
1066
1087RETURN_STATUS
1088EFIAPI
1090 IN INTN Operand,
1091 OUT INT16 *Result
1092 );
1093
1114RETURN_STATUS
1115EFIAPI
1117 IN INTN Operand,
1118 OUT UINT16 *Result
1119 );
1120
1141RETURN_STATUS
1142EFIAPI
1144 IN INTN Operand,
1145 OUT INT32 *Result
1146 );
1147
1168RETURN_STATUS
1169EFIAPI
1171 IN INTN Operand,
1172 OUT UINT32 *Result
1173 );
1174
1195RETURN_STATUS
1196EFIAPI
1198 IN INTN Operand,
1199 OUT UINTN *Result
1200 );
1201
1222RETURN_STATUS
1223EFIAPI
1225 IN INTN Operand,
1226 OUT UINT64 *Result
1227 );
1228
1249RETURN_STATUS
1250EFIAPI
1252 IN UINTN Operand,
1253 OUT INT8 *Result
1254 );
1255
1276RETURN_STATUS
1277EFIAPI
1279 IN UINTN Operand,
1280 OUT CHAR8 *Result
1281 );
1282
1303RETURN_STATUS
1304EFIAPI
1306 IN UINTN Operand,
1307 OUT UINT8 *Result
1308 );
1309
1330RETURN_STATUS
1331EFIAPI
1333 IN UINTN Operand,
1334 OUT INT16 *Result
1335 );
1336
1357RETURN_STATUS
1358EFIAPI
1360 IN UINTN Operand,
1361 OUT UINT16 *Result
1362 );
1363
1384RETURN_STATUS
1385EFIAPI
1387 IN UINTN Operand,
1388 OUT INT32 *Result
1389 );
1390
1411RETURN_STATUS
1412EFIAPI
1414 IN UINTN Operand,
1415 OUT UINT32 *Result
1416 );
1417
1438RETURN_STATUS
1439EFIAPI
1441 IN UINTN Operand,
1442 OUT INTN *Result
1443 );
1444
1465RETURN_STATUS
1466EFIAPI
1468 IN UINTN Operand,
1469 OUT INT64 *Result
1470 );
1471
1492RETURN_STATUS
1493EFIAPI
1495 IN INT64 Operand,
1496 OUT INT8 *Result
1497 );
1498
1519RETURN_STATUS
1520EFIAPI
1522 IN INT64 Operand,
1523 OUT CHAR8 *Result
1524 );
1525
1546RETURN_STATUS
1547EFIAPI
1549 IN INT64 Operand,
1550 OUT UINT8 *Result
1551 );
1552
1573RETURN_STATUS
1574EFIAPI
1576 IN INT64 Operand,
1577 OUT INT16 *Result
1578 );
1579
1600RETURN_STATUS
1601EFIAPI
1603 IN INT64 Operand,
1604 OUT UINT16 *Result
1605 );
1606
1627RETURN_STATUS
1628EFIAPI
1630 IN INT64 Operand,
1631 OUT INT32 *Result
1632 );
1633
1654RETURN_STATUS
1655EFIAPI
1657 IN INT64 Operand,
1658 OUT UINT32 *Result
1659 );
1660
1681RETURN_STATUS
1682EFIAPI
1684 IN INT64 Operand,
1685 OUT INTN *Result
1686 );
1687
1708RETURN_STATUS
1709EFIAPI
1711 IN INT64 Operand,
1712 OUT UINTN *Result
1713 );
1714
1735RETURN_STATUS
1736EFIAPI
1738 IN INT64 Operand,
1739 OUT UINT64 *Result
1740 );
1741
1762RETURN_STATUS
1763EFIAPI
1765 IN UINT64 Operand,
1766 OUT INT8 *Result
1767 );
1768
1789RETURN_STATUS
1790EFIAPI
1792 IN UINT64 Operand,
1793 OUT CHAR8 *Result
1794 );
1795
1816RETURN_STATUS
1817EFIAPI
1819 IN UINT64 Operand,
1820 OUT UINT8 *Result
1821 );
1822
1843RETURN_STATUS
1844EFIAPI
1846 IN UINT64 Operand,
1847 OUT INT16 *Result
1848 );
1849
1870RETURN_STATUS
1871EFIAPI
1873 IN UINT64 Operand,
1874 OUT UINT16 *Result
1875 );
1876
1897RETURN_STATUS
1898EFIAPI
1900 IN UINT64 Operand,
1901 OUT INT32 *Result
1902 );
1903
1924RETURN_STATUS
1925EFIAPI
1927 IN UINT64 Operand,
1928 OUT UINT32 *Result
1929 );
1930
1951RETURN_STATUS
1952EFIAPI
1954 IN UINT64 Operand,
1955 OUT INTN *Result
1956 );
1957
1978RETURN_STATUS
1979EFIAPI
1981 IN UINT64 Operand,
1982 OUT UINTN *Result
1983 );
1984
2005RETURN_STATUS
2006EFIAPI
2008 IN UINT64 Operand,
2009 OUT INT64 *Result
2010 );
2011
2012//
2013// Addition functions
2014//
2015
2037RETURN_STATUS
2038EFIAPI
2040 IN UINT8 Augend,
2041 IN UINT8 Addend,
2042 OUT UINT8 *Result
2043 );
2044
2066RETURN_STATUS
2067EFIAPI
2069 IN UINT16 Augend,
2070 IN UINT16 Addend,
2071 OUT UINT16 *Result
2072 );
2073
2095RETURN_STATUS
2096EFIAPI
2098 IN UINT32 Augend,
2099 IN UINT32 Addend,
2100 OUT UINT32 *Result
2101 );
2102
2124RETURN_STATUS
2125EFIAPI
2127 IN UINTN Augend,
2128 IN UINTN Addend,
2129 OUT UINTN *Result
2130 );
2131
2153RETURN_STATUS
2154EFIAPI
2156 IN UINT64 Augend,
2157 IN UINT64 Addend,
2158 OUT UINT64 *Result
2159 );
2160
2161//
2162// Subtraction functions
2163//
2164
2186RETURN_STATUS
2187EFIAPI
2189 IN UINT8 Minuend,
2190 IN UINT8 Subtrahend,
2191 OUT UINT8 *Result
2192 );
2193
2215RETURN_STATUS
2216EFIAPI
2218 IN UINT16 Minuend,
2219 IN UINT16 Subtrahend,
2220 OUT UINT16 *Result
2221 );
2222
2244RETURN_STATUS
2245EFIAPI
2247 IN UINT32 Minuend,
2248 IN UINT32 Subtrahend,
2249 OUT UINT32 *Result
2250 );
2251
2273RETURN_STATUS
2274EFIAPI
2276 IN UINTN Minuend,
2277 IN UINTN Subtrahend,
2278 OUT UINTN *Result
2279 );
2280
2302RETURN_STATUS
2303EFIAPI
2305 IN UINT64 Minuend,
2306 IN UINT64 Subtrahend,
2307 OUT UINT64 *Result
2308 );
2309
2310//
2311// Multiplication functions
2312//
2313
2335RETURN_STATUS
2336EFIAPI
2338 IN UINT8 Multiplicand,
2339 IN UINT8 Multiplier,
2340 OUT UINT8 *Result
2341 );
2342
2364RETURN_STATUS
2365EFIAPI
2367 IN UINT16 Multiplicand,
2368 IN UINT16 Multiplier,
2369 OUT UINT16 *Result
2370 );
2371
2393RETURN_STATUS
2394EFIAPI
2396 IN UINT32 Multiplicand,
2397 IN UINT32 Multiplier,
2398 OUT UINT32 *Result
2399 );
2400
2422RETURN_STATUS
2423EFIAPI
2425 IN UINTN Multiplicand,
2426 IN UINTN Multiplier,
2427 OUT UINTN *Result
2428 );
2429
2451RETURN_STATUS
2452EFIAPI
2454 IN UINT64 Multiplicand,
2455 IN UINT64 Multiplier,
2456 OUT UINT64 *Result
2457 );
2458
2459//
2460// Signed operations
2461//
2462// Strongly consider using unsigned numbers.
2463//
2464// Signed numbers are often used where unsigned numbers should be used.
2465// For example file sizes and array indices should always be unsigned.
2466// Subtracting a larger positive signed number from a smaller positive
2467// signed number with SafeInt32Sub will succeed, producing a negative number,
2468// that then must not be used as an array index (but can occasionally be
2469// used as a pointer index.) Similarly for adding a larger magnitude
2470// negative number to a smaller magnitude positive number.
2471//
2472// This library does not protect you from such errors. It tells you if your
2473// integer operations overflowed, not if you are doing the right thing
2474// with your non-overflowed integers.
2475//
2476// Likewise you can overflow a buffer with a non-overflowed unsigned index.
2477//
2478
2479//
2480// Signed addition functions
2481//
2482
2504RETURN_STATUS
2505EFIAPI
2507 IN INT8 Augend,
2508 IN INT8 Addend,
2509 OUT INT8 *Result
2510 );
2511
2533RETURN_STATUS
2534EFIAPI
2536 IN CHAR8 Augend,
2537 IN CHAR8 Addend,
2538 OUT CHAR8 *Result
2539 );
2540
2562RETURN_STATUS
2563EFIAPI
2565 IN INT16 Augend,
2566 IN INT16 Addend,
2567 OUT INT16 *Result
2568 );
2569
2591RETURN_STATUS
2592EFIAPI
2594 IN INT32 Augend,
2595 IN INT32 Addend,
2596 OUT INT32 *Result
2597 );
2598
2620RETURN_STATUS
2621EFIAPI
2623 IN INTN Augend,
2624 IN INTN Addend,
2625 OUT INTN *Result
2626 );
2627
2649RETURN_STATUS
2650EFIAPI
2652 IN INT64 Augend,
2653 IN INT64 Addend,
2654 OUT INT64 *Result
2655 );
2656
2657//
2658// Signed subtraction functions
2659//
2660
2682RETURN_STATUS
2683EFIAPI
2685 IN INT8 Minuend,
2686 IN INT8 Subtrahend,
2687 OUT INT8 *Result
2688 );
2689
2711RETURN_STATUS
2712EFIAPI
2714 IN CHAR8 Minuend,
2715 IN CHAR8 Subtrahend,
2716 OUT CHAR8 *Result
2717 );
2718
2740RETURN_STATUS
2741EFIAPI
2743 IN INT16 Minuend,
2744 IN INT16 Subtrahend,
2745 OUT INT16 *Result
2746 );
2747
2769RETURN_STATUS
2770EFIAPI
2772 IN INT32 Minuend,
2773 IN INT32 Subtrahend,
2774 OUT INT32 *Result
2775 );
2776
2798RETURN_STATUS
2799EFIAPI
2801 IN INTN Minuend,
2802 IN INTN Subtrahend,
2803 OUT INTN *Result
2804 );
2805
2827RETURN_STATUS
2828EFIAPI
2830 IN INT64 Minuend,
2831 IN INT64 Subtrahend,
2832 OUT INT64 *Result
2833 );
2834
2835//
2836// Signed multiplication functions
2837//
2838
2860RETURN_STATUS
2861EFIAPI
2863 IN INT8 Multiplicand,
2864 IN INT8 Multiplier,
2865 OUT INT8 *Result
2866 );
2867
2889RETURN_STATUS
2890EFIAPI
2892 IN CHAR8 Multiplicand,
2893 IN CHAR8 Multiplier,
2894 OUT CHAR8 *Result
2895 );
2896
2918RETURN_STATUS
2919EFIAPI
2921 IN INT16 Multiplicand,
2922 IN INT16 Multiplier,
2923 OUT INT16 *Result
2924 );
2925
2947RETURN_STATUS
2948EFIAPI
2950 IN INT32 Multiplicand,
2951 IN INT32 Multiplier,
2952 OUT INT32 *Result
2953 );
2954
2976RETURN_STATUS
2977EFIAPI
2979 IN INTN Multiplicand,
2980 IN INTN Multiplier,
2981 OUT INTN *Result
2982 );
2983
3005RETURN_STATUS
3006EFIAPI
3008 IN INT64 Multiplicand,
3009 IN INT64 Multiplier,
3010 OUT INT64 *Result
3011 );
3012
3013#endif // __INT_SAFE_LIB_H__
UINT64 UINTN
INT64 INTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFIAPI SafeInt16ToUint32(IN INT16 Operand, OUT UINT32 *Result)
Definition: SafeIntLib.c:586
RETURN_STATUS EFIAPI SafeUint64ToInt8(IN UINT64 Operand, OUT INT8 *Result)
Definition: SafeIntLib.c:2434
RETURN_STATUS EFIAPI SafeInt64ToInt32(IN INT64 Operand, OUT INT32 *Result)
Definition: SafeIntLib.c:2302
RETURN_STATUS EFIAPI SafeIntnToInt16(IN INTN Operand, OUT INT16 *Result)
Definition: SafeIntLib.c:1598
RETURN_STATUS EFIAPI SafeInt32Sub(IN INT32 Minuend, IN INT32 Subtrahend, OUT INT32 *Result)
Definition: SafeIntLib.c:3825
RETURN_STATUS EFIAPI SafeUint64ToInt32(IN UINT64 Operand, OUT INT32 *Result)
Definition: SafeIntLib.c:2654
RETURN_STATUS EFIAPI SafeChar8Sub(IN CHAR8 Minuend, IN CHAR8 Subtrahend, OUT CHAR8 *Result)
Definition: SafeIntLib.c:3742
RETURN_STATUS EFIAPI SafeIntnToInt8(IN INTN Operand, OUT INT8 *Result)
Definition: SafeIntLib.c:1466
RETURN_STATUS EFIAPI SafeUint16Sub(IN UINT16 Minuend, IN UINT16 Subtrahend, OUT UINT16 *Result)
Definition: SafeIntLib.c:3069
RETURN_STATUS EFIAPI SafeInt64ToIntn(IN INT64 Operand, OUT INTN *Result)
Definition: SafeIntLib32.c:247
RETURN_STATUS EFIAPI SafeInt8ToUintn(IN INT8 Operand, OUT UINTN *Result)
Definition: SafeIntLib.c:234
RETURN_STATUS EFIAPI SafeUint8Sub(IN UINT8 Minuend, IN UINT8 Subtrahend, OUT UINT8 *Result)
Definition: SafeIntLib.c:3023
RETURN_STATUS EFIAPI SafeInt8Mult(IN INT8 Multiplicand, IN INT8 Multiplier, OUT INT8 *Result)
Definition: SafeIntLib.c:3947
RETURN_STATUS EFIAPI SafeUint32ToIntn(IN UINT32 Operand, OUT INTN *Result)
Definition: SafeIntLib32.c:68
RETURN_STATUS EFIAPI SafeUint32ToInt32(IN UINT32 Operand, OUT INT32 *Result)
Definition: SafeIntLib.c:1422
RETURN_STATUS EFIAPI SafeUintnAdd(IN UINTN Augend, IN UINTN Addend, OUT UINTN *Result)
Definition: SafeIntLib32.c:338
RETURN_STATUS EFIAPI SafeUint32Add(IN UINT32 Augend, IN UINT32 Addend, OUT UINT32 *Result)
Definition: SafeIntLib.c:2927
RETURN_STATUS EFIAPI SafeUintnToInt32(IN UINTN Operand, OUT INT32 *Result)
Definition: SafeIntLib.c:1994
RETURN_STATUS EFIAPI SafeChar8Mult(IN CHAR8 Multiplicand, IN CHAR8 Multiplier, OUT CHAR8 *Result)
Definition: SafeIntLib.c:3979
RETURN_STATUS EFIAPI SafeInt32ToUint32(IN INT32 Operand, OUT UINT32 *Result)
Definition: SafeIntLib.c:1114
RETURN_STATUS EFIAPI SafeUint64ToUint16(IN UINT64 Operand, OUT UINT16 *Result)
Definition: SafeIntLib.c:2610
RETURN_STATUS EFIAPI SafeIntnToChar8(IN INTN Operand, OUT CHAR8 *Result)
Definition: SafeIntLib.c:1510
RETURN_STATUS EFIAPI SafeInt32ToInt16(IN INT32 Operand, OUT INT16 *Result)
Definition: SafeIntLib.c:1026
RETURN_STATUS EFIAPI SafeUint32Mult(IN UINT32 Multiplicand, IN UINT32 Multiplier, OUT UINT32 *Result)
Definition: SafeIntLib.c:3283
RETURN_STATUS EFIAPI SafeInt16ToChar8(IN INT16 Operand, OUT CHAR8 *Result)
Definition: SafeIntLib.c:454
RETURN_STATUS EFIAPI SafeInt8ToUint64(IN INT8 Operand, OUT UINT64 *Result)
Definition: SafeIntLib.c:278
RETURN_STATUS EFIAPI SafeInt16ToUint64(IN INT16 Operand, OUT UINT64 *Result)
Definition: SafeIntLib.c:674
RETURN_STATUS EFIAPI SafeIntnToInt32(IN INTN Operand, OUT INT32 *Result)
Definition: SafeIntLib32.c:98
RETURN_STATUS EFIAPI SafeInt16ToUintn(IN INT16 Operand, OUT UINTN *Result)
Definition: SafeIntLib.c:630
RETURN_STATUS EFIAPI SafeUintnToInt8(IN UINTN Operand, OUT INT8 *Result)
Definition: SafeIntLib.c:1774
RETURN_STATUS EFIAPI SafeUintnMult(IN UINTN Multiplicand, IN UINTN Multiplier, OUT UINTN *Result)
Definition: SafeIntLib32.c:430
RETURN_STATUS EFIAPI SafeUint16Mult(IN UINT16 Multiplicand, IN UINT16 Multiplier, OUT UINT16 *Result)
Definition: SafeIntLib.c:3247
RETURN_STATUS EFIAPI SafeInt32ToUint64(IN INT32 Operand, OUT UINT64 *Result)
Definition: SafeIntLib.c:1158
RETURN_STATUS EFIAPI SafeUint64ToUint8(IN UINT64 Operand, OUT UINT8 *Result)
Definition: SafeIntLib.c:2522
RETURN_STATUS EFIAPI SafeUint16ToInt16(IN UINT16 Operand, OUT INT16 *Result)
Definition: SafeIntLib.c:850
RETURN_STATUS EFIAPI SafeInt64ToUint32(IN INT64 Operand, OUT UINT32 *Result)
Definition: SafeIntLib.c:2346
RETURN_STATUS EFIAPI SafeUintnToIntn(IN UINTN Operand, OUT INTN *Result)
Definition: SafeIntLib.c:2038
RETURN_STATUS EFIAPI SafeUint64ToChar8(IN UINT64 Operand, OUT CHAR8 *Result)
Definition: SafeIntLib.c:2478
RETURN_STATUS EFIAPI SafeIntnToUint32(IN INTN Operand, OUT UINT32 *Result)
Definition: SafeIntLib32.c:133
RETURN_STATUS EFIAPI SafeInt64ToInt16(IN INT64 Operand, OUT INT16 *Result)
Definition: SafeIntLib.c:2214
RETURN_STATUS EFIAPI SafeUint8ToInt8(IN UINT8 Operand, OUT INT8 *Result)
Definition: SafeIntLib.c:322
RETURN_STATUS EFIAPI SafeUintnToUint32(IN UINTN Operand, OUT UINT32 *Result)
Definition: SafeIntLib32.c:177
RETURN_STATUS EFIAPI SafeUint16Add(IN UINT16 Augend, IN UINT16 Addend, OUT UINT16 *Result)
Definition: SafeIntLib.c:2881
RETURN_STATUS EFIAPI SafeUintnToUint16(IN UINTN Operand, OUT UINT16 *Result)
Definition: SafeIntLib.c:1950
RETURN_STATUS EFIAPI SafeIntnMult(IN INTN Multiplicand, IN INTN Multiplier, OUT INTN *Result)
Definition: SafeIntLib32.c:530
RETURN_STATUS EFIAPI SafeInt32Mult(IN INT32 Multiplicand, IN INT32 Multiplier, OUT INT32 *Result)
Definition: SafeIntLib.c:4062
RETURN_STATUS EFIAPI SafeInt64Mult(IN INT64 Multiplicand, IN INT64 Multiplier, OUT INT64 *Result)
Definition: SafeIntLib.c:4094
RETURN_STATUS EFIAPI SafeUint32ToChar8(IN UINT32 Operand, OUT CHAR8 *Result)
Definition: SafeIntLib.c:1246
RETURN_STATUS EFIAPI SafeInt16Mult(IN INT16 Multiplicand, IN INT16 Multiplier, OUT INT16 *Result)
Definition: SafeIntLib.c:4030
RETURN_STATUS EFIAPI SafeInt32ToUint8(IN INT32 Operand, OUT UINT8 *Result)
Definition: SafeIntLib.c:982
RETURN_STATUS EFIAPI SafeIntnToUint8(IN INTN Operand, OUT UINT8 *Result)
Definition: SafeIntLib.c:1554
RETURN_STATUS EFIAPI SafeUint64Sub(IN UINT64 Minuend, IN UINT64 Subtrahend, OUT UINT64 *Result)
Definition: SafeIntLib.c:3161
RETURN_STATUS EFIAPI SafeIntnSub(IN INTN Minuend, IN INTN Subtrahend, OUT INTN *Result)
Definition: SafeIntLib32.c:498
RETURN_STATUS EFIAPI SafeInt8Add(IN INT8 Augend, IN INT8 Addend, OUT INT8 *Result)
Definition: SafeIntLib.c:3466
RETURN_STATUS EFIAPI SafeInt64ToInt8(IN INT64 Operand, OUT INT8 *Result)
Definition: SafeIntLib.c:2082
RETURN_STATUS EFIAPI SafeUint64Add(IN UINT64 Augend, IN UINT64 Addend, OUT UINT64 *Result)
Definition: SafeIntLib.c:2973
RETURN_STATUS EFIAPI SafeInt16ToUint8(IN INT16 Operand, OUT UINT8 *Result)
Definition: SafeIntLib.c:498
RETURN_STATUS EFIAPI SafeUint32ToUint16(IN UINT32 Operand, OUT UINT16 *Result)
Definition: SafeIntLib.c:1378
RETURN_STATUS EFIAPI SafeInt16ToInt8(IN INT16 Operand, OUT INT8 *Result)
Definition: SafeIntLib.c:410
RETURN_STATUS EFIAPI SafeInt32ToInt8(IN INT32 Operand, OUT INT8 *Result)
Definition: SafeIntLib.c:894
RETURN_STATUS EFIAPI SafeUintnToChar8(IN UINTN Operand, OUT CHAR8 *Result)
Definition: SafeIntLib.c:1818
RETURN_STATUS EFIAPI SafeUint64ToIntn(IN UINT64 Operand, OUT INTN *Result)
Definition: SafeIntLib.c:2742
RETURN_STATUS EFIAPI SafeInt64ToChar8(IN INT64 Operand, OUT CHAR8 *Result)
Definition: SafeIntLib.c:2126
RETURN_STATUS EFIAPI SafeUintnToInt64(IN UINTN Operand, OUT INT64 *Result)
Definition: SafeIntLib32.c:212
RETURN_STATUS EFIAPI SafeUint64Mult(IN UINT64 Multiplicand, IN UINT64 Multiplier, OUT UINT64 *Result)
Definition: SafeIntLib.c:3319
RETURN_STATUS EFIAPI SafeIntnToUint64(IN INTN Operand, OUT UINT64 *Result)
Definition: SafeIntLib.c:1730
RETURN_STATUS EFIAPI SafeUint32ToInt8(IN UINT32 Operand, OUT INT8 *Result)
Definition: SafeIntLib.c:1202
RETURN_STATUS EFIAPI SafeInt8ToUint8(IN INT8 Operand, OUT UINT8 *Result)
Definition: SafeIntLib.c:58
RETURN_STATUS EFIAPI SafeUint8Mult(IN UINT8 Multiplicand, IN UINT8 Multiplier, OUT UINT8 *Result)
Definition: SafeIntLib.c:3211
RETURN_STATUS EFIAPI SafeInt32ToUintn(IN INT32 Operand, OUT UINTN *Result)
Definition: SafeIntLib32.c:38
RETURN_STATUS EFIAPI SafeChar8Add(IN CHAR8 Augend, IN CHAR8 Addend, OUT CHAR8 *Result)
Definition: SafeIntLib.c:3498
RETURN_STATUS EFIAPI SafeInt64Add(IN INT64 Augend, IN INT64 Addend, OUT INT64 *Result)
Definition: SafeIntLib.c:3613
RETURN_STATUS EFIAPI SafeUint16ToChar8(IN UINT16 Operand, OUT CHAR8 *Result)
Definition: SafeIntLib.c:762
RETURN_STATUS EFIAPI SafeInt8ToUint32(IN INT8 Operand, OUT UINT32 *Result)
Definition: SafeIntLib.c:190
RETURN_STATUS EFIAPI SafeInt64ToUint64(IN INT64 Operand, OUT UINT64 *Result)
Definition: SafeIntLib.c:2390
RETURN_STATUS EFIAPI SafeInt8Sub(IN INT8 Minuend, IN INT8 Subtrahend, OUT INT8 *Result)
Definition: SafeIntLib.c:3710
RETURN_STATUS EFIAPI SafeInt8ToChar8(IN INT8 Operand, OUT CHAR8 *Result)
Definition: SafeIntLib.c:102
RETURN_STATUS EFIAPI SafeUint16ToInt8(IN UINT16 Operand, OUT INT8 *Result)
Definition: SafeIntLib.c:718
RETURN_STATUS EFIAPI SafeUint64ToInt64(IN UINT64 Operand, OUT INT64 *Result)
Definition: SafeIntLib.c:2786
RETURN_STATUS EFIAPI SafeIntnAdd(IN INTN Augend, IN INTN Addend, OUT INTN *Result)
Definition: SafeIntLib32.c:466
RETURN_STATUS EFIAPI SafeInt32ToChar8(IN INT32 Operand, OUT CHAR8 *Result)
Definition: SafeIntLib.c:938
RETURN_STATUS EFIAPI SafeInt32ToUint16(IN INT32 Operand, OUT UINT16 *Result)
Definition: SafeIntLib.c:1070
RETURN_STATUS EFIAPI SafeInt64ToUintn(IN INT64 Operand, OUT UINTN *Result)
Definition: SafeIntLib32.c:277
RETURN_STATUS EFIAPI SafeUint32Sub(IN UINT32 Minuend, IN UINT32 Subtrahend, OUT UINT32 *Result)
Definition: SafeIntLib.c:3115
RETURN_STATUS EFIAPI SafeUint64ToUintn(IN UINT64 Operand, OUT UINTN *Result)
Definition: SafeIntLib32.c:307
RETURN_STATUS EFIAPI SafeInt64ToUint8(IN INT64 Operand, OUT UINT8 *Result)
Definition: SafeIntLib.c:2170
RETURN_STATUS EFIAPI SafeUintnToInt16(IN UINTN Operand, OUT INT16 *Result)
Definition: SafeIntLib.c:1906
RETURN_STATUS EFIAPI SafeInt16Sub(IN INT16 Minuend, IN INT16 Subtrahend, OUT INT16 *Result)
Definition: SafeIntLib.c:3793
RETURN_STATUS EFIAPI SafeInt64ToUint16(IN INT64 Operand, OUT UINT16 *Result)
Definition: SafeIntLib.c:2258
RETURN_STATUS EFIAPI SafeUint16ToUint8(IN UINT16 Operand, OUT UINT8 *Result)
Definition: SafeIntLib.c:806
RETURN_STATUS EFIAPI SafeIntnToUint16(IN INTN Operand, OUT UINT16 *Result)
Definition: SafeIntLib.c:1642
RETURN_STATUS EFIAPI SafeUint32ToInt16(IN UINT32 Operand, OUT INT16 *Result)
Definition: SafeIntLib.c:1334
RETURN_STATUS EFIAPI SafeUint64ToInt16(IN UINT64 Operand, OUT INT16 *Result)
Definition: SafeIntLib.c:2566
RETURN_STATUS EFIAPI SafeIntnToUintn(IN INTN Operand, OUT UINTN *Result)
Definition: SafeIntLib.c:1686
RETURN_STATUS EFIAPI SafeInt8ToUint16(IN INT8 Operand, OUT UINT16 *Result)
Definition: SafeIntLib.c:146
RETURN_STATUS EFIAPI SafeInt16ToUint16(IN INT16 Operand, OUT UINT16 *Result)
Definition: SafeIntLib.c:542
RETURN_STATUS EFIAPI SafeUint32ToUint8(IN UINT32 Operand, OUT UINT8 *Result)
Definition: SafeIntLib.c:1290
RETURN_STATUS EFIAPI SafeUintnSub(IN UINTN Minuend, IN UINTN Subtrahend, OUT UINTN *Result)
Definition: SafeIntLib32.c:384
RETURN_STATUS EFIAPI SafeUintnToUint8(IN UINTN Operand, OUT UINT8 *Result)
Definition: SafeIntLib.c:1862
RETURN_STATUS EFIAPI SafeUint64ToUint32(IN UINT64 Operand, OUT UINT32 *Result)
Definition: SafeIntLib.c:2698
RETURN_STATUS EFIAPI SafeUint8Add(IN UINT8 Augend, IN UINT8 Addend, OUT UINT8 *Result)
Definition: SafeIntLib.c:2835
RETURN_STATUS EFIAPI SafeInt16Add(IN INT16 Augend, IN INT16 Addend, OUT INT16 *Result)
Definition: SafeIntLib.c:3549
RETURN_STATUS EFIAPI SafeUint8ToChar8(IN UINT8 Operand, OUT CHAR8 *Result)
Definition: SafeIntLib.c:366
RETURN_STATUS EFIAPI SafeInt32Add(IN INT32 Augend, IN INT32 Addend, OUT INT32 *Result)
Definition: SafeIntLib.c:3581
RETURN_STATUS EFIAPI SafeInt64Sub(IN INT64 Minuend, IN INT64 Subtrahend, OUT INT64 *Result)
Definition: SafeIntLib.c:3857