TianoCore EDK2 master
BaseLib.h
Go to the documentation of this file.
1
14#ifndef __BASE_LIB__
15#define __BASE_LIB__
16
17//
18// Definitions for architecture-specific types
19//
20#if defined (MDE_CPU_IA32)
24typedef struct {
25 UINT32 Ebx;
26 UINT32 Esi;
27 UINT32 Edi;
28 UINT32 Ebp;
29 UINT32 Esp;
30 UINT32 Eip;
31 UINT32 Ssp;
32} BASE_LIBRARY_JUMP_BUFFER;
33
34#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4
35
36#endif // defined (MDE_CPU_IA32)
37
38#if defined (MDE_CPU_X64)
42typedef struct {
43 UINT64 Rbx;
44 UINT64 Rsp;
45 UINT64 Rbp;
46 UINT64 Rdi;
47 UINT64 Rsi;
48 UINT64 R12;
49 UINT64 R13;
50 UINT64 R14;
51 UINT64 R15;
52 UINT64 Rip;
53 UINT64 MxCsr;
54 UINT8 XmmBuffer[160];
55 UINT64 Ssp;
56} BASE_LIBRARY_JUMP_BUFFER;
57
58#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
59
60#endif // defined (MDE_CPU_X64)
61
62#if defined (MDE_CPU_EBC)
66typedef struct {
67 UINT64 R0;
68 UINT64 R1;
69 UINT64 R2;
70 UINT64 R3;
71 UINT64 IP;
72} BASE_LIBRARY_JUMP_BUFFER;
73
74#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
75
76#endif // defined (MDE_CPU_EBC)
77
78#if defined (MDE_CPU_ARM)
79
80typedef struct {
81 UINT32 R3;
82 UINT32 R4;
83 UINT32 R5;
84 UINT32 R6;
85 UINT32 R7;
86 UINT32 R8;
87 UINT32 R9;
88 UINT32 R10;
89 UINT32 R11;
90 UINT32 R12;
91 UINT32 R14;
92} BASE_LIBRARY_JUMP_BUFFER;
93
94#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4
95
96#endif // defined (MDE_CPU_ARM)
97
98#if defined (MDE_CPU_AARCH64)
99typedef struct {
100 // GP regs
101 UINT64 X19;
102 UINT64 X20;
103 UINT64 X21;
104 UINT64 X22;
105 UINT64 X23;
106 UINT64 X24;
107 UINT64 X25;
108 UINT64 X26;
109 UINT64 X27;
110 UINT64 X28;
111 UINT64 FP;
112 UINT64 LR;
113 UINT64 IP0;
114
115 // FP regs
116 UINT64 D8;
117 UINT64 D9;
118 UINT64 D10;
119 UINT64 D11;
120 UINT64 D12;
121 UINT64 D13;
122 UINT64 D14;
123 UINT64 D15;
124} BASE_LIBRARY_JUMP_BUFFER;
125
126#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
127
128#endif // defined (MDE_CPU_AARCH64)
129
130#if defined (MDE_CPU_RISCV64)
134typedef struct {
135 UINT64 RA;
136 UINT64 S0;
137 UINT64 S1;
138 UINT64 S2;
139 UINT64 S3;
140 UINT64 S4;
141 UINT64 S5;
142 UINT64 S6;
143 UINT64 S7;
144 UINT64 S8;
145 UINT64 S9;
146 UINT64 S10;
147 UINT64 S11;
148 UINT64 SP;
149} BASE_LIBRARY_JUMP_BUFFER;
150
151#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
152
153#endif // defined (MDE_CPU_RISCV64)
154
155//
156// String Services
157//
158
175UINTN
176EFIAPI
177StrnLenS (
178 IN CONST CHAR16 *String,
179 IN UINTN MaxSize
180 );
181
203UINTN
204EFIAPI
205StrnSizeS (
206 IN CONST CHAR16 *String,
207 IN UINTN MaxSize
208 );
209
236RETURN_STATUS
237EFIAPI
238StrCpyS (
239 OUT CHAR16 *Destination,
240 IN UINTN DestMax,
241 IN CONST CHAR16 *Source
242 );
243
273RETURN_STATUS
274EFIAPI
275StrnCpyS (
276 OUT CHAR16 *Destination,
277 IN UINTN DestMax,
278 IN CONST CHAR16 *Source,
279 IN UINTN Length
280 );
281
311RETURN_STATUS
312EFIAPI
313StrCatS (
314 IN OUT CHAR16 *Destination,
315 IN UINTN DestMax,
316 IN CONST CHAR16 *Source
317 );
318
351RETURN_STATUS
352EFIAPI
353StrnCatS (
354 IN OUT CHAR16 *Destination,
355 IN UINTN DestMax,
356 IN CONST CHAR16 *Source,
357 IN UINTN Length
358 );
359
403RETURN_STATUS
404EFIAPI
406 IN CONST CHAR16 *String,
407 OUT CHAR16 **EndPointer OPTIONAL,
408 OUT UINTN *Data
409 );
410
454RETURN_STATUS
455EFIAPI
457 IN CONST CHAR16 *String,
458 OUT CHAR16 **EndPointer OPTIONAL,
459 OUT UINT64 *Data
460 );
461
510RETURN_STATUS
511EFIAPI
513 IN CONST CHAR16 *String,
514 OUT CHAR16 **EndPointer OPTIONAL,
515 OUT UINTN *Data
516 );
517
566RETURN_STATUS
567EFIAPI
569 IN CONST CHAR16 *String,
570 OUT CHAR16 **EndPointer OPTIONAL,
571 OUT UINT64 *Data
572 );
573
588UINTN
589EFIAPI
591 IN CONST CHAR8 *String,
592 IN UINTN MaxSize
593 );
594
614UINTN
615EFIAPI
617 IN CONST CHAR8 *String,
618 IN UINTN MaxSize
619 );
620
644RETURN_STATUS
645EFIAPI
647 OUT CHAR8 *Destination,
648 IN UINTN DestMax,
649 IN CONST CHAR8 *Source
650 );
651
678RETURN_STATUS
679EFIAPI
681 OUT CHAR8 *Destination,
682 IN UINTN DestMax,
683 IN CONST CHAR8 *Source,
684 IN UINTN Length
685 );
686
713RETURN_STATUS
714EFIAPI
716 IN OUT CHAR8 *Destination,
717 IN UINTN DestMax,
718 IN CONST CHAR8 *Source
719 );
720
750RETURN_STATUS
751EFIAPI
753 IN OUT CHAR8 *Destination,
754 IN UINTN DestMax,
755 IN CONST CHAR8 *Source,
756 IN UINTN Length
757 );
758
800RETURN_STATUS
801EFIAPI
803 IN CONST CHAR8 *String,
804 OUT CHAR8 **EndPointer OPTIONAL,
805 OUT UINTN *Data
806 );
807
849RETURN_STATUS
850EFIAPI
852 IN CONST CHAR8 *String,
853 OUT CHAR8 **EndPointer OPTIONAL,
854 OUT UINT64 *Data
855 );
856
902RETURN_STATUS
903EFIAPI
905 IN CONST CHAR8 *String,
906 OUT CHAR8 **EndPointer OPTIONAL,
907 OUT UINTN *Data
908 );
909
955RETURN_STATUS
956EFIAPI
958 IN CONST CHAR8 *String,
959 OUT CHAR8 **EndPointer OPTIONAL,
960 OUT UINT64 *Data
961 );
962
980UINTN
981EFIAPI
982StrLen (
983 IN CONST CHAR16 *String
984 );
985
1004UINTN
1005EFIAPI
1006StrSize (
1007 IN CONST CHAR16 *String
1008 );
1009
1038INTN
1039EFIAPI
1040StrCmp (
1041 IN CONST CHAR16 *FirstString,
1042 IN CONST CHAR16 *SecondString
1043 );
1044
1077INTN
1078EFIAPI
1079StrnCmp (
1080 IN CONST CHAR16 *FirstString,
1081 IN CONST CHAR16 *SecondString,
1082 IN UINTN Length
1083 );
1084
1110CHAR16 *
1111EFIAPI
1112StrStr (
1113 IN CONST CHAR16 *String,
1114 IN CONST CHAR16 *SearchString
1115 );
1116
1151UINTN
1152EFIAPI
1154 IN CONST CHAR16 *String
1155 );
1156
1191UINT64
1192EFIAPI
1194 IN CONST CHAR16 *String
1195 );
1196
1232UINTN
1233EFIAPI
1235 IN CONST CHAR16 *String
1236 );
1237
1273UINT64
1274EFIAPI
1276 IN CONST CHAR16 *String
1277 );
1278
1329RETURN_STATUS
1330EFIAPI
1332 IN CONST CHAR16 *String,
1333 OUT CHAR16 **EndPointer OPTIONAL,
1334 OUT IPv6_ADDRESS *Address,
1335 OUT UINT8 *PrefixLength OPTIONAL
1336 );
1337
1379RETURN_STATUS
1380EFIAPI
1382 IN CONST CHAR16 *String,
1383 OUT CHAR16 **EndPointer OPTIONAL,
1384 OUT IPv4_ADDRESS *Address,
1385 OUT UINT8 *PrefixLength OPTIONAL
1386 );
1387
1388#define GUID_STRING_LENGTH 36
1389
1432RETURN_STATUS
1433EFIAPI
1434StrToGuid (
1435 IN CONST CHAR16 *String,
1436 OUT GUID *Guid
1437 );
1438
1472RETURN_STATUS
1473EFIAPI
1475 IN CONST CHAR16 *String,
1476 IN UINTN Length,
1477 OUT UINT8 *Buffer,
1478 IN UINTN MaxBufferSize
1479 );
1480
1521RETURN_STATUS
1522EFIAPI
1524 IN CONST CHAR16 *Source,
1525 OUT CHAR8 *Destination,
1526 IN UINTN DestMax
1527 );
1528
1572RETURN_STATUS
1573EFIAPI
1575 IN CONST CHAR16 *Source,
1576 IN UINTN Length,
1577 OUT CHAR8 *Destination,
1578 IN UINTN DestMax,
1579 OUT UINTN *DestinationLength
1580 );
1581
1599UINTN
1600EFIAPI
1602 IN CONST CHAR8 *String
1603 );
1604
1622UINTN
1623EFIAPI
1625 IN CONST CHAR8 *String
1626 );
1627
1654INTN
1655EFIAPI
1657 IN CONST CHAR8 *FirstString,
1658 IN CONST CHAR8 *SecondString
1659 );
1660
1690INTN
1691EFIAPI
1693 IN CONST CHAR8 *FirstString,
1694 IN CONST CHAR8 *SecondString
1695 );
1696
1727INTN
1728EFIAPI
1730 IN CONST CHAR8 *FirstString,
1731 IN CONST CHAR8 *SecondString,
1732 IN UINTN Length
1733 );
1734
1759CHAR8 *
1760EFIAPI
1762 IN CONST CHAR8 *String,
1763 IN CONST CHAR8 *SearchString
1764 );
1765
1796UINTN
1797EFIAPI
1799 IN CONST CHAR8 *String
1800 );
1801
1832UINT64
1833EFIAPI
1835 IN CONST CHAR8 *String
1836 );
1837
1872UINTN
1873EFIAPI
1875 IN CONST CHAR8 *String
1876 );
1877
1912UINT64
1913EFIAPI
1915 IN CONST CHAR8 *String
1916 );
1917
1966RETURN_STATUS
1967EFIAPI
1969 IN CONST CHAR8 *String,
1970 OUT CHAR8 **EndPointer OPTIONAL,
1971 OUT IPv6_ADDRESS *Address,
1972 OUT UINT8 *PrefixLength OPTIONAL
1973 );
1974
2014RETURN_STATUS
2015EFIAPI
2017 IN CONST CHAR8 *String,
2018 OUT CHAR8 **EndPointer OPTIONAL,
2019 OUT IPv4_ADDRESS *Address,
2020 OUT UINT8 *PrefixLength OPTIONAL
2021 );
2022
2063RETURN_STATUS
2064EFIAPI
2066 IN CONST CHAR8 *String,
2067 OUT GUID *Guid
2068 );
2069
2101RETURN_STATUS
2102EFIAPI
2104 IN CONST CHAR8 *String,
2105 IN UINTN Length,
2106 OUT UINT8 *Buffer,
2107 IN UINTN MaxBufferSize
2108 );
2109
2146RETURN_STATUS
2147EFIAPI
2149 IN CONST CHAR8 *Source,
2150 OUT CHAR16 *Destination,
2151 IN UINTN DestMax
2152 );
2153
2196RETURN_STATUS
2197EFIAPI
2199 IN CONST CHAR8 *Source,
2200 IN UINTN Length,
2201 OUT CHAR16 *Destination,
2202 IN UINTN DestMax,
2203 OUT UINTN *DestinationLength
2204 );
2205
2221CHAR16
2222EFIAPI
2224 IN CHAR16 Char
2225 );
2226
2240CHAR8
2241EFIAPI
2243 IN CHAR8 Chr
2244 );
2245
2265RETURN_STATUS
2266EFIAPI
2268 IN CONST UINT8 *Source,
2269 IN UINTN SourceLength,
2270 OUT CHAR8 *Destination OPTIONAL,
2271 IN OUT UINTN *DestinationSize
2272 );
2273
2356RETURN_STATUS
2357EFIAPI
2359 IN CONST CHAR8 *Source OPTIONAL,
2360 IN UINTN SourceSize,
2361 OUT UINT8 *Destination OPTIONAL,
2362 IN OUT UINTN *DestinationSize
2363 );
2364
2378UINT8
2379EFIAPI
2381 IN UINT8 Value
2382 );
2383
2398UINT8
2399EFIAPI
2401 IN UINT8 Value
2402 );
2403
2404//
2405// File Path Manipulation Functions
2406//
2407
2416BOOLEAN
2417EFIAPI
2419 IN OUT CHAR16 *Path
2420 );
2421
2435CHAR16 *
2436EFIAPI
2438 IN CHAR16 *Path
2439 );
2440
2441//
2442// Linked List Functions and Macros
2443//
2444
2459#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&(ListHead), &(ListHead)}
2460
2468#define BASE_LIST_FOR_EACH(Entry, ListHead) \
2469 for(Entry = (ListHead)->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)
2470
2484#define BASE_LIST_FOR_EACH_SAFE(Entry, NextEntry, ListHead) \
2485 for(Entry = (ListHead)->ForwardLink, NextEntry = Entry->ForwardLink;\
2486 Entry != (ListHead); Entry = NextEntry, NextEntry = Entry->ForwardLink)
2487
2507BOOLEAN
2508EFIAPI
2510 IN CONST LIST_ENTRY *FirstEntry,
2511 IN CONST LIST_ENTRY *SecondEntry
2512 );
2513
2530LIST_ENTRY *
2531EFIAPI
2533 IN OUT LIST_ENTRY *ListHead
2534 );
2535
2558LIST_ENTRY *
2559EFIAPI
2561 IN OUT LIST_ENTRY *ListHead,
2562 IN OUT LIST_ENTRY *Entry
2563 );
2564
2587LIST_ENTRY *
2588EFIAPI
2590 IN OUT LIST_ENTRY *ListHead,
2591 IN OUT LIST_ENTRY *Entry
2592 );
2593
2614LIST_ENTRY *
2615EFIAPI
2617 IN CONST LIST_ENTRY *List
2618 );
2619
2641LIST_ENTRY *
2642EFIAPI
2644 IN CONST LIST_ENTRY *List,
2645 IN CONST LIST_ENTRY *Node
2646 );
2647
2669LIST_ENTRY *
2670EFIAPI
2672 IN CONST LIST_ENTRY *List,
2673 IN CONST LIST_ENTRY *Node
2674 );
2675
2695BOOLEAN
2696EFIAPI
2698 IN CONST LIST_ENTRY *ListHead
2699 );
2700
2727BOOLEAN
2728EFIAPI
2729IsNull (
2730 IN CONST LIST_ENTRY *List,
2731 IN CONST LIST_ENTRY *Node
2732 );
2733
2757BOOLEAN
2758EFIAPI
2760 IN CONST LIST_ENTRY *List,
2761 IN CONST LIST_ENTRY *Node
2762 );
2763
2790LIST_ENTRY *
2791EFIAPI
2793 IN OUT LIST_ENTRY *FirstEntry,
2794 IN OUT LIST_ENTRY *SecondEntry
2795 );
2796
2818LIST_ENTRY *
2819EFIAPI
2821 IN CONST LIST_ENTRY *Entry
2822 );
2823
2824//
2825// Math Services
2826//
2827
2838typedef
2840(EFIAPI *BASE_SORT_COMPARE)(
2841 IN CONST VOID *Buffer1,
2842 IN CONST VOID *Buffer2
2843 );
2844
2868VOID
2869EFIAPI
2870QuickSort (
2871 IN OUT VOID *BufferToSort,
2872 IN CONST UINTN Count,
2873 IN CONST UINTN ElementSize,
2874 IN BASE_SORT_COMPARE CompareFunction,
2875 OUT VOID *BufferOneElement
2876 );
2877
2893UINT64
2894EFIAPI
2895LShiftU64 (
2896 IN UINT64 Operand,
2897 IN UINTN Count
2898 );
2899
2915UINT64
2916EFIAPI
2917RShiftU64 (
2918 IN UINT64 Operand,
2919 IN UINTN Count
2920 );
2921
2937UINT64
2938EFIAPI
2939ARShiftU64 (
2940 IN UINT64 Operand,
2941 IN UINTN Count
2942 );
2943
2960UINT32
2961EFIAPI
2962LRotU32 (
2963 IN UINT32 Operand,
2964 IN UINTN Count
2965 );
2966
2983UINT32
2984EFIAPI
2985RRotU32 (
2986 IN UINT32 Operand,
2987 IN UINTN Count
2988 );
2989
3006UINT64
3007EFIAPI
3008LRotU64 (
3009 IN UINT64 Operand,
3010 IN UINTN Count
3011 );
3012
3029UINT64
3030EFIAPI
3031RRotU64 (
3032 IN UINT64 Operand,
3033 IN UINTN Count
3034 );
3035
3049INTN
3050EFIAPI
3052 IN UINT32 Operand
3053 );
3054
3069INTN
3070EFIAPI
3072 IN UINT64 Operand
3073 );
3074
3089INTN
3090EFIAPI
3092 IN UINT32 Operand
3093 );
3094
3109INTN
3110EFIAPI
3112 IN UINT64 Operand
3113 );
3114
3128UINT32
3129EFIAPI
3131 IN UINT32 Operand
3132 );
3133
3147UINT64
3148EFIAPI
3150 IN UINT64 Operand
3151 );
3152
3165UINT16
3166EFIAPI
3168 IN UINT16 Value
3169 );
3170
3183UINT32
3184EFIAPI
3186 IN UINT32 Value
3187 );
3188
3201UINT64
3202EFIAPI
3204 IN UINT64 Value
3205 );
3206
3221UINT64
3222EFIAPI
3223MultU64x32 (
3224 IN UINT64 Multiplicand,
3225 IN UINT32 Multiplier
3226 );
3227
3242UINT64
3243EFIAPI
3244MultU64x64 (
3245 IN UINT64 Multiplicand,
3246 IN UINT64 Multiplier
3247 );
3248
3263INT64
3264EFIAPI
3265MultS64x64 (
3266 IN INT64 Multiplicand,
3267 IN INT64 Multiplier
3268 );
3269
3286UINT64
3287EFIAPI
3288DivU64x32 (
3289 IN UINT64 Dividend,
3290 IN UINT32 Divisor
3291 );
3292
3309UINT32
3310EFIAPI
3311ModU64x32 (
3312 IN UINT64 Dividend,
3313 IN UINT32 Divisor
3314 );
3315
3335UINT64
3336EFIAPI
3338 IN UINT64 Dividend,
3339 IN UINT32 Divisor,
3340 OUT UINT32 *Remainder OPTIONAL
3341 );
3342
3362UINT64
3363EFIAPI
3365 IN UINT64 Dividend,
3366 IN UINT64 Divisor,
3367 OUT UINT64 *Remainder OPTIONAL
3368 );
3369
3393INT64
3394EFIAPI
3396 IN INT64 Dividend,
3397 IN INT64 Divisor,
3398 OUT INT64 *Remainder OPTIONAL
3399 );
3400
3414UINT16
3415EFIAPI
3417 IN CONST UINT16 *Buffer
3418 );
3419
3435UINT16
3436EFIAPI
3438 OUT UINT16 *Buffer,
3439 IN UINT16 Value
3440 );
3441
3455UINT32
3456EFIAPI
3458 IN CONST UINT32 *Buffer
3459 );
3460
3476UINT32
3477EFIAPI
3479 OUT UINT32 *Buffer,
3480 IN UINT32 Value
3481 );
3482
3496UINT32
3497EFIAPI
3499 IN CONST UINT32 *Buffer
3500 );
3501
3517UINT32
3518EFIAPI
3520 OUT UINT32 *Buffer,
3521 IN UINT32 Value
3522 );
3523
3537UINT64
3538EFIAPI
3540 IN CONST UINT64 *Buffer
3541 );
3542
3558UINT64
3559EFIAPI
3561 OUT UINT64 *Buffer,
3562 IN UINT64 Value
3563 );
3564
3565//
3566// Bit Field Functions
3567//
3568
3588UINT8
3589EFIAPI
3591 IN UINT8 Operand,
3592 IN UINTN StartBit,
3593 IN UINTN EndBit
3594 );
3595
3619UINT8
3620EFIAPI
3622 IN UINT8 Operand,
3623 IN UINTN StartBit,
3624 IN UINTN EndBit,
3625 IN UINT8 Value
3626 );
3627
3652UINT8
3653EFIAPI
3655 IN UINT8 Operand,
3656 IN UINTN StartBit,
3657 IN UINTN EndBit,
3658 IN UINT8 OrData
3659 );
3660
3685UINT8
3686EFIAPI
3688 IN UINT8 Operand,
3689 IN UINTN StartBit,
3690 IN UINTN EndBit,
3691 IN UINT8 AndData
3692 );
3693
3721UINT8
3722EFIAPI
3724 IN UINT8 Operand,
3725 IN UINTN StartBit,
3726 IN UINTN EndBit,
3727 IN UINT8 AndData,
3728 IN UINT8 OrData
3729 );
3730
3750UINT16
3751EFIAPI
3753 IN UINT16 Operand,
3754 IN UINTN StartBit,
3755 IN UINTN EndBit
3756 );
3757
3781UINT16
3782EFIAPI
3784 IN UINT16 Operand,
3785 IN UINTN StartBit,
3786 IN UINTN EndBit,
3787 IN UINT16 Value
3788 );
3789
3814UINT16
3815EFIAPI
3817 IN UINT16 Operand,
3818 IN UINTN StartBit,
3819 IN UINTN EndBit,
3820 IN UINT16 OrData
3821 );
3822
3847UINT16
3848EFIAPI
3850 IN UINT16 Operand,
3851 IN UINTN StartBit,
3852 IN UINTN EndBit,
3853 IN UINT16 AndData
3854 );
3855
3883UINT16
3884EFIAPI
3886 IN UINT16 Operand,
3887 IN UINTN StartBit,
3888 IN UINTN EndBit,
3889 IN UINT16 AndData,
3890 IN UINT16 OrData
3891 );
3892
3912UINT32
3913EFIAPI
3915 IN UINT32 Operand,
3916 IN UINTN StartBit,
3917 IN UINTN EndBit
3918 );
3919
3943UINT32
3944EFIAPI
3946 IN UINT32 Operand,
3947 IN UINTN StartBit,
3948 IN UINTN EndBit,
3949 IN UINT32 Value
3950 );
3951
3976UINT32
3977EFIAPI
3979 IN UINT32 Operand,
3980 IN UINTN StartBit,
3981 IN UINTN EndBit,
3982 IN UINT32 OrData
3983 );
3984
4009UINT32
4010EFIAPI
4012 IN UINT32 Operand,
4013 IN UINTN StartBit,
4014 IN UINTN EndBit,
4015 IN UINT32 AndData
4016 );
4017
4045UINT32
4046EFIAPI
4048 IN UINT32 Operand,
4049 IN UINTN StartBit,
4050 IN UINTN EndBit,
4051 IN UINT32 AndData,
4052 IN UINT32 OrData
4053 );
4054
4074UINT64
4075EFIAPI
4077 IN UINT64 Operand,
4078 IN UINTN StartBit,
4079 IN UINTN EndBit
4080 );
4081
4105UINT64
4106EFIAPI
4108 IN UINT64 Operand,
4109 IN UINTN StartBit,
4110 IN UINTN EndBit,
4111 IN UINT64 Value
4112 );
4113
4138UINT64
4139EFIAPI
4141 IN UINT64 Operand,
4142 IN UINTN StartBit,
4143 IN UINTN EndBit,
4144 IN UINT64 OrData
4145 );
4146
4171UINT64
4172EFIAPI
4174 IN UINT64 Operand,
4175 IN UINTN StartBit,
4176 IN UINTN EndBit,
4177 IN UINT64 AndData
4178 );
4179
4207UINT64
4208EFIAPI
4210 IN UINT64 Operand,
4211 IN UINTN StartBit,
4212 IN UINTN EndBit,
4213 IN UINT64 AndData,
4214 IN UINT64 OrData
4215 );
4216
4237UINT8
4238EFIAPI
4240 IN UINT32 Operand,
4241 IN UINTN StartBit,
4242 IN UINTN EndBit
4243 );
4244
4265UINT8
4266EFIAPI
4268 IN UINT64 Operand,
4269 IN UINTN StartBit,
4270 IN UINTN EndBit
4271 );
4272
4273//
4274// Base Library Checksum Functions
4275//
4276
4295UINT8
4296EFIAPI
4298 IN CONST UINT8 *Buffer,
4299 IN UINTN Length
4300 );
4301
4320UINT8
4321EFIAPI
4323 IN CONST UINT8 *Buffer,
4324 IN UINTN Length
4325 );
4326
4346UINT16
4347EFIAPI
4349 IN CONST UINT16 *Buffer,
4350 IN UINTN Length
4351 );
4352
4373UINT16
4374EFIAPI
4376 IN CONST UINT16 *Buffer,
4377 IN UINTN Length
4378 );
4379
4399UINT32
4400EFIAPI
4402 IN CONST UINT32 *Buffer,
4403 IN UINTN Length
4404 );
4405
4426UINT32
4427EFIAPI
4429 IN CONST UINT32 *Buffer,
4430 IN UINTN Length
4431 );
4432
4452UINT64
4453EFIAPI
4455 IN CONST UINT64 *Buffer,
4456 IN UINTN Length
4457 );
4458
4479UINT64
4480EFIAPI
4482 IN CONST UINT64 *Buffer,
4483 IN UINTN Length
4484 );
4485
4499UINT32
4500EFIAPI
4502 IN VOID *Buffer,
4503 IN UINTN Length
4504 );
4505
4506//
4507// Base Library CPU Functions
4508//
4509
4517typedef
4518VOID
4519(EFIAPI *SWITCH_STACK_ENTRY_POINT)(
4520 IN VOID *Context1 OPTIONAL,
4521 IN VOID *Context2 OPTIONAL
4522 );
4523
4531VOID
4532EFIAPI
4534 VOID
4535 );
4536
4559UINTN
4560EFIAPI
4561SetJump (
4562 OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
4563 );
4564
4581VOID
4582EFIAPI
4583LongJump (
4584 IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
4585 IN UINTN Value
4586 );
4587
4592VOID
4593EFIAPI
4595 VOID
4596 );
4597
4602VOID
4603EFIAPI
4605 VOID
4606 );
4607
4616BOOLEAN
4617EFIAPI
4619 VOID
4620 );
4621
4627VOID
4628EFIAPI
4630 VOID
4631 );
4632
4643BOOLEAN
4644EFIAPI
4646 VOID
4647 );
4648
4663BOOLEAN
4664EFIAPI
4666 IN BOOLEAN InterruptState
4667 );
4668
4676VOID
4677EFIAPI
4678CpuPause (
4679 VOID
4680 );
4681
4711VOID
4712EFIAPI
4714 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
4715 IN VOID *Context1 OPTIONAL,
4716 IN VOID *Context2 OPTIONAL,
4717 IN VOID *NewStack,
4718 ...
4719 );
4720
4728VOID
4729EFIAPI
4731 VOID
4732 );
4733
4743VOID
4744EFIAPI
4746 VOID
4747 );
4748
4756VOID
4757EFIAPI
4759 VOID
4760 );
4761
4762#if defined (MDE_CPU_X64) || defined (MDE_CPU_IA32)
4763
4778UINTN
4779EFIAPI
4780TdCall (
4781 IN UINT64 Leaf,
4782 IN UINT64 Arg1,
4783 IN UINT64 Arg2,
4784 IN UINT64 Arg3,
4785 IN OUT VOID *Results
4786 );
4787
4803UINTN
4804EFIAPI
4805TdVmCall (
4806 IN UINT64 Leaf,
4807 IN UINT64 Arg1,
4808 IN UINT64 Arg2,
4809 IN UINT64 Arg3,
4810 IN UINT64 Arg4,
4811 IN OUT VOID *Results
4812 );
4813
4820BOOLEAN
4821EFIAPI
4823 VOID
4824 );
4825
4826#endif
4827
4828#if defined (MDE_CPU_X64)
4829//
4830// The page size for the PVALIDATE instruction
4831//
4832typedef enum {
4833 PvalidatePageSize4K = 0,
4834 PvalidatePageSize2MB,
4835} PVALIDATE_PAGE_SIZE;
4836
4837//
4838// PVALIDATE Return Code.
4839//
4840#define PVALIDATE_RET_SUCCESS 0
4841#define PVALIDATE_RET_FAIL_INPUT 1
4842#define PVALIDATE_RET_SIZE_MISMATCH 6
4843
4844//
4845// The PVALIDATE instruction did not make any changes to the RMP entry.
4846//
4847#define PVALIDATE_RET_NO_RMPUPDATE 255
4848
4869UINT32
4870EFIAPI
4871AsmPvalidate (
4872 IN PVALIDATE_PAGE_SIZE PageSize,
4873 IN BOOLEAN Validate,
4874 IN PHYSICAL_ADDRESS Address
4875 );
4876
4877//
4878// RDX settings for RMPADJUST
4879//
4880#define RMPADJUST_VMPL_MAX 3
4881#define RMPADJUST_VMPL_MASK 0xFF
4882#define RMPADJUST_VMPL_SHIFT 0
4883#define RMPADJUST_PERMISSION_MASK_MASK 0xFF
4884#define RMPADJUST_PERMISSION_MASK_SHIFT 8
4885#define RMPADJUST_VMSA_PAGE_BIT BIT16
4886
4904UINT32
4905EFIAPI
4906AsmRmpAdjust (
4907 IN UINT64 Rax,
4908 IN UINT64 Rcx,
4909 IN UINT64 Rdx
4910 );
4911
4912#endif
4913
4914#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
4919typedef union {
4920 struct {
4921 UINT32 CF : 1;
4922 UINT32 Reserved_0 : 1;
4923 UINT32 PF : 1;
4924 UINT32 Reserved_1 : 1;
4925 UINT32 AF : 1;
4926 UINT32 Reserved_2 : 1;
4927 UINT32 ZF : 1;
4928 UINT32 SF : 1;
4929 UINT32 TF : 1;
4930 UINT32 IF : 1;
4931 UINT32 DF : 1;
4932 UINT32 OF : 1;
4933 UINT32 IOPL : 2;
4934 UINT32 NT : 1;
4935 UINT32 Reserved_3 : 1;
4936 } Bits;
4937 UINT16 Uint16;
4938} IA32_FLAGS16;
4939
4945typedef union {
4946 struct {
4947 UINT32 CF : 1;
4948 UINT32 Reserved_0 : 1;
4949 UINT32 PF : 1;
4950 UINT32 Reserved_1 : 1;
4951 UINT32 AF : 1;
4952 UINT32 Reserved_2 : 1;
4953 UINT32 ZF : 1;
4954 UINT32 SF : 1;
4955 UINT32 TF : 1;
4956 UINT32 IF : 1;
4957 UINT32 DF : 1;
4958 UINT32 OF : 1;
4959 UINT32 IOPL : 2;
4960 UINT32 NT : 1;
4961 UINT32 Reserved_3 : 1;
4962 UINT32 RF : 1;
4963 UINT32 VM : 1;
4964 UINT32 AC : 1;
4965 UINT32 VIF : 1;
4966 UINT32 VIP : 1;
4967 UINT32 ID : 1;
4968 UINT32 Reserved_4 : 10;
4969 } Bits;
4970 UINTN UintN;
4971} IA32_EFLAGS32;
4972
4978typedef union {
4979 struct {
4980 UINT32 PE : 1;
4981 UINT32 MP : 1;
4982 UINT32 EM : 1;
4983 UINT32 TS : 1;
4984 UINT32 ET : 1;
4985 UINT32 NE : 1;
4986 UINT32 Reserved_0 : 10;
4987 UINT32 WP : 1;
4988 UINT32 Reserved_1 : 1;
4989 UINT32 AM : 1;
4990 UINT32 Reserved_2 : 10;
4991 UINT32 NW : 1;
4992 UINT32 CD : 1;
4993 UINT32 PG : 1;
4994 } Bits;
4995 UINTN UintN;
4996} IA32_CR0;
4997
5003typedef union {
5004 struct {
5005 UINT32 VME : 1;
5006 UINT32 PVI : 1;
5007 UINT32 TSD : 1;
5008 UINT32 DE : 1;
5009 UINT32 PSE : 1;
5010 UINT32 PAE : 1;
5011 UINT32 MCE : 1;
5012 UINT32 PGE : 1;
5013 UINT32 PCE : 1;
5015 UINT32 OSFXSR : 1;
5017 UINT32 OSXMMEXCPT : 1;
5020 UINT32 UMIP : 1;
5021 UINT32 LA57 : 1;
5022 UINT32 VMXE : 1;
5023 UINT32 SMXE : 1;
5024 UINT32 Reserved_3 : 1;
5025 UINT32 FSGSBASE : 1;
5026 UINT32 PCIDE : 1;
5027 UINT32 OSXSAVE : 1;
5028 UINT32 Reserved_4 : 1;
5029 UINT32 SMEP : 1;
5030 UINT32 SMAP : 1;
5031 UINT32 PKE : 1;
5032 UINT32 Reserved_5 : 9;
5033 } Bits;
5034 UINTN UintN;
5035} IA32_CR4;
5036
5040typedef union {
5041 struct {
5042 UINT32 LimitLow : 16;
5043 UINT32 BaseLow : 16;
5044 UINT32 BaseMid : 8;
5045 UINT32 Type : 4;
5046 UINT32 S : 1;
5047 UINT32 DPL : 2;
5048 UINT32 P : 1;
5049 UINT32 LimitHigh : 4;
5050 UINT32 AVL : 1;
5051 UINT32 L : 1;
5052 UINT32 DB : 1;
5053 UINT32 G : 1;
5054 UINT32 BaseHigh : 8;
5055 } Bits;
5056 UINT64 Uint64;
5057} IA32_SEGMENT_DESCRIPTOR;
5058
5062 #pragma pack (1)
5063typedef struct {
5064 UINT16 Limit;
5065 UINTN Base;
5066} IA32_DESCRIPTOR;
5067 #pragma pack ()
5068
5069#define IA32_IDT_GATE_TYPE_TASK 0x85
5070#define IA32_IDT_GATE_TYPE_INTERRUPT_16 0x86
5071#define IA32_IDT_GATE_TYPE_TRAP_16 0x87
5072#define IA32_IDT_GATE_TYPE_INTERRUPT_32 0x8E
5073#define IA32_IDT_GATE_TYPE_TRAP_32 0x8F
5074
5075#define IA32_GDT_TYPE_TSS 0x9
5076#define IA32_GDT_ALIGNMENT 8
5077
5078 #if defined (MDE_CPU_IA32)
5082typedef union {
5083 struct {
5084 UINT32 OffsetLow : 16;
5085 UINT32 Selector : 16;
5086 UINT32 Reserved_0 : 8;
5087 UINT32 GateType : 8;
5088 UINT32 OffsetHigh : 16;
5089 } Bits;
5090 UINT64 Uint64;
5091} IA32_IDT_GATE_DESCRIPTOR;
5092
5093 #pragma pack (1)
5094//
5095// IA32 Task-State Segment Definition
5096//
5097typedef struct {
5098 UINT16 PreviousTaskLink;
5099 UINT16 Reserved_2;
5100 UINT32 ESP0;
5101 UINT16 SS0;
5102 UINT16 Reserved_10;
5103 UINT32 ESP1;
5104 UINT16 SS1;
5105 UINT16 Reserved_18;
5106 UINT32 ESP2;
5107 UINT16 SS2;
5108 UINT16 Reserved_26;
5109 UINT32 CR3;
5110 UINT32 EIP;
5111 UINT32 EFLAGS;
5112 UINT32 EAX;
5113 UINT32 ECX;
5114 UINT32 EDX;
5115 UINT32 EBX;
5116 UINT32 ESP;
5117 UINT32 EBP;
5118 UINT32 ESI;
5119 UINT32 EDI;
5120 UINT16 ES;
5121 UINT16 Reserved_74;
5122 UINT16 CS;
5123 UINT16 Reserved_78;
5124 UINT16 SS;
5125 UINT16 Reserved_82;
5126 UINT16 DS;
5127 UINT16 Reserved_86;
5128 UINT16 FS;
5129 UINT16 Reserved_90;
5130 UINT16 GS;
5131 UINT16 Reserved_94;
5132 UINT16 LDTSegmentSelector;
5133 UINT16 Reserved_98;
5134 UINT16 T;
5135 UINT16 IOMapBaseAddress;
5136} IA32_TASK_STATE_SEGMENT;
5137
5138typedef union {
5139 struct {
5140 UINT32 LimitLow : 16;
5141 UINT32 BaseLow : 16;
5142 UINT32 BaseMid : 8;
5143 UINT32 Type : 4;
5144 UINT32 Reserved_43 : 1;
5145 UINT32 DPL : 2;
5146 UINT32 P : 1;
5147 UINT32 LimitHigh : 4;
5148 UINT32 AVL : 1;
5149 UINT32 Reserved_52 : 2;
5150 UINT32 G : 1;
5151 UINT32 BaseHigh : 8;
5152 } Bits;
5153 UINT64 Uint64;
5154} IA32_TSS_DESCRIPTOR;
5155 #pragma pack ()
5156
5157 #endif // defined (MDE_CPU_IA32)
5158
5159 #if defined (MDE_CPU_X64)
5163typedef union {
5164 struct {
5165 UINT32 OffsetLow : 16;
5166 UINT32 Selector : 16;
5167 UINT32 Reserved_0 : 8;
5168 UINT32 GateType : 8;
5169 UINT32 OffsetHigh : 16;
5170 UINT32 OffsetUpper : 32;
5171 UINT32 Reserved_1 : 32;
5172 } Bits;
5173 struct {
5174 UINT64 Uint64;
5175 UINT64 Uint64_1;
5176 } Uint128;
5177} IA32_IDT_GATE_DESCRIPTOR;
5178
5179 #pragma pack (1)
5180//
5181// IA32 Task-State Segment Definition
5182//
5183typedef struct {
5184 UINT32 Reserved_0;
5185 UINT64 RSP0;
5186 UINT64 RSP1;
5187 UINT64 RSP2;
5188 UINT64 Reserved_28;
5189 UINT64 IST[7];
5190 UINT64 Reserved_92;
5191 UINT16 Reserved_100;
5192 UINT16 IOMapBaseAddress;
5193} IA32_TASK_STATE_SEGMENT;
5194
5195typedef union {
5196 struct {
5197 UINT32 LimitLow : 16;
5198 UINT32 BaseLow : 16;
5199 UINT32 BaseMidl : 8;
5200 UINT32 Type : 4;
5201 UINT32 Reserved_43 : 1;
5202 UINT32 DPL : 2;
5203 UINT32 P : 1;
5204 UINT32 LimitHigh : 4;
5205 UINT32 AVL : 1;
5206 UINT32 Reserved_52 : 2;
5207 UINT32 G : 1;
5208 UINT32 BaseMidh : 8;
5209 UINT32 BaseHigh : 32;
5210 UINT32 Reserved_96 : 32;
5211 } Bits;
5212 struct {
5213 UINT64 Uint64;
5214 UINT64 Uint64_1;
5215 } Uint128;
5216} IA32_TSS_DESCRIPTOR;
5217 #pragma pack ()
5218
5219 #endif // defined (MDE_CPU_X64)
5220
5224typedef struct {
5225 UINT8 Buffer[512];
5226} IA32_FX_BUFFER;
5227
5231typedef struct {
5232 UINT32 Reserved1;
5233 UINT32 Reserved2;
5234 UINT32 Reserved3;
5235 UINT32 Reserved4;
5236 UINT8 BL;
5237 UINT8 BH;
5238 UINT16 Reserved5;
5239 UINT8 DL;
5240 UINT8 DH;
5241 UINT16 Reserved6;
5242 UINT8 CL;
5243 UINT8 CH;
5244 UINT16 Reserved7;
5245 UINT8 AL;
5246 UINT8 AH;
5247 UINT16 Reserved8;
5248} IA32_BYTE_REGS;
5249
5250typedef struct {
5251 UINT16 DI;
5252 UINT16 Reserved1;
5253 UINT16 SI;
5254 UINT16 Reserved2;
5255 UINT16 BP;
5256 UINT16 Reserved3;
5257 UINT16 SP;
5258 UINT16 Reserved4;
5259 UINT16 BX;
5260 UINT16 Reserved5;
5261 UINT16 DX;
5262 UINT16 Reserved6;
5263 UINT16 CX;
5264 UINT16 Reserved7;
5265 UINT16 AX;
5266 UINT16 Reserved8;
5267} IA32_WORD_REGS;
5268
5269typedef struct {
5270 UINT32 EDI;
5271 UINT32 ESI;
5272 UINT32 EBP;
5273 UINT32 ESP;
5274 UINT32 EBX;
5275 UINT32 EDX;
5276 UINT32 ECX;
5277 UINT32 EAX;
5278 UINT16 DS;
5279 UINT16 ES;
5280 UINT16 FS;
5281 UINT16 GS;
5282 IA32_EFLAGS32 EFLAGS;
5283 UINT32 Eip;
5284 UINT16 CS;
5285 UINT16 SS;
5286} IA32_DWORD_REGS;
5287
5288typedef union {
5289 IA32_DWORD_REGS E;
5290 IA32_WORD_REGS X;
5291 IA32_BYTE_REGS H;
5292} IA32_REGISTER_SET;
5293
5297typedef struct {
5298 IA32_REGISTER_SET *RealModeState;
5299 VOID *RealModeBuffer;
5300 UINT32 RealModeBufferSize;
5301 UINT32 ThunkAttributes;
5302} THUNK_CONTEXT;
5303
5304#define THUNK_ATTRIBUTE_BIG_REAL_MODE 0x00000001
5305#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 0x00000002
5306#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL 0x00000004
5307
5320typedef VOID (X86_ASSEMBLY_PATCH_LABEL) (
5321 VOID
5322 );
5323
5349UINT32
5350EFIAPI
5351AsmCpuid (
5352 IN UINT32 Index,
5353 OUT UINT32 *Eax OPTIONAL,
5354 OUT UINT32 *Ebx OPTIONAL,
5355 OUT UINT32 *Ecx OPTIONAL,
5356 OUT UINT32 *Edx OPTIONAL
5357 );
5358
5391UINT32
5392EFIAPI
5393AsmCpuidEx (
5394 IN UINT32 Index,
5395 IN UINT32 SubIndex,
5396 OUT UINT32 *Eax OPTIONAL,
5397 OUT UINT32 *Ebx OPTIONAL,
5398 OUT UINT32 *Ecx OPTIONAL,
5399 OUT UINT32 *Edx OPTIONAL
5400 );
5401
5409VOID
5410EFIAPI
5412 VOID
5413 );
5414
5422VOID
5423EFIAPI
5425 VOID
5426 );
5427
5442UINT32
5443EFIAPI
5445 IN UINT32 Index
5446 );
5447
5465UINT32
5466EFIAPI
5468 IN UINT32 Index,
5469 IN UINT32 Value
5470 );
5471
5491UINT32
5492EFIAPI
5493AsmMsrOr32 (
5494 IN UINT32 Index,
5495 IN UINT32 OrData
5496 );
5497
5517UINT32
5518EFIAPI
5520 IN UINT32 Index,
5521 IN UINT32 AndData
5522 );
5523
5546UINT32
5547EFIAPI
5549 IN UINT32 Index,
5550 IN UINT32 AndData,
5551 IN UINT32 OrData
5552 );
5553
5576UINT32
5577EFIAPI
5579 IN UINT32 Index,
5580 IN UINTN StartBit,
5581 IN UINTN EndBit
5582 );
5583
5609UINT32
5610EFIAPI
5612 IN UINT32 Index,
5613 IN UINTN StartBit,
5614 IN UINTN EndBit,
5615 IN UINT32 Value
5616 );
5617
5645UINT32
5646EFIAPI
5648 IN UINT32 Index,
5649 IN UINTN StartBit,
5650 IN UINTN EndBit,
5651 IN UINT32 OrData
5652 );
5653
5681UINT32
5682EFIAPI
5684 IN UINT32 Index,
5685 IN UINTN StartBit,
5686 IN UINTN EndBit,
5687 IN UINT32 AndData
5688 );
5689
5721UINT32
5722EFIAPI
5724 IN UINT32 Index,
5725 IN UINTN StartBit,
5726 IN UINTN EndBit,
5727 IN UINT32 AndData,
5728 IN UINT32 OrData
5729 );
5730
5745UINT64
5746EFIAPI
5748 IN UINT32 Index
5749 );
5750
5768UINT64
5769EFIAPI
5771 IN UINT32 Index,
5772 IN UINT64 Value
5773 );
5774
5793UINT64
5794EFIAPI
5795AsmMsrOr64 (
5796 IN UINT32 Index,
5797 IN UINT64 OrData
5798 );
5799
5818UINT64
5819EFIAPI
5821 IN UINT32 Index,
5822 IN UINT64 AndData
5823 );
5824
5846UINT64
5847EFIAPI
5849 IN UINT32 Index,
5850 IN UINT64 AndData,
5851 IN UINT64 OrData
5852 );
5853
5876UINT64
5877EFIAPI
5879 IN UINT32 Index,
5880 IN UINTN StartBit,
5881 IN UINTN EndBit
5882 );
5883
5908UINT64
5909EFIAPI
5911 IN UINT32 Index,
5912 IN UINTN StartBit,
5913 IN UINTN EndBit,
5914 IN UINT64 Value
5915 );
5916
5944UINT64
5945EFIAPI
5947 IN UINT32 Index,
5948 IN UINTN StartBit,
5949 IN UINTN EndBit,
5950 IN UINT64 OrData
5951 );
5952
5980UINT64
5981EFIAPI
5983 IN UINT32 Index,
5984 IN UINTN StartBit,
5985 IN UINTN EndBit,
5986 IN UINT64 AndData
5987 );
5988
6019UINT64
6020EFIAPI
6022 IN UINT32 Index,
6023 IN UINTN StartBit,
6024 IN UINTN EndBit,
6025 IN UINT64 AndData,
6026 IN UINT64 OrData
6027 );
6028
6039UINTN
6040EFIAPI
6042 VOID
6043 );
6044
6055UINTN
6056EFIAPI
6057AsmReadCr0 (
6058 VOID
6059 );
6060
6071UINTN
6072EFIAPI
6073AsmReadCr2 (
6074 VOID
6075 );
6076
6087UINTN
6088EFIAPI
6089AsmReadCr3 (
6090 VOID
6091 );
6092
6103UINTN
6104EFIAPI
6105AsmReadCr4 (
6106 VOID
6107 );
6108
6120UINTN
6121EFIAPI
6123 UINTN Cr0
6124 );
6125
6137UINTN
6138EFIAPI
6140 UINTN Cr2
6141 );
6142
6154UINTN
6155EFIAPI
6157 UINTN Cr3
6158 );
6159
6171UINTN
6172EFIAPI
6174 UINTN Cr4
6175 );
6176
6187UINTN
6188EFIAPI
6189AsmReadDr0 (
6190 VOID
6191 );
6192
6203UINTN
6204EFIAPI
6205AsmReadDr1 (
6206 VOID
6207 );
6208
6219UINTN
6220EFIAPI
6221AsmReadDr2 (
6222 VOID
6223 );
6224
6235UINTN
6236EFIAPI
6237AsmReadDr3 (
6238 VOID
6239 );
6240
6251UINTN
6252EFIAPI
6253AsmReadDr4 (
6254 VOID
6255 );
6256
6267UINTN
6268EFIAPI
6269AsmReadDr5 (
6270 VOID
6271 );
6272
6283UINTN
6284EFIAPI
6285AsmReadDr6 (
6286 VOID
6287 );
6288
6299UINTN
6300EFIAPI
6301AsmReadDr7 (
6302 VOID
6303 );
6304
6316UINTN
6317EFIAPI
6319 UINTN Dr0
6320 );
6321
6333UINTN
6334EFIAPI
6336 UINTN Dr1
6337 );
6338
6350UINTN
6351EFIAPI
6353 UINTN Dr2
6354 );
6355
6367UINTN
6368EFIAPI
6370 UINTN Dr3
6371 );
6372
6384UINTN
6385EFIAPI
6387 UINTN Dr4
6388 );
6389
6401UINTN
6402EFIAPI
6404 UINTN Dr5
6405 );
6406
6418UINTN
6419EFIAPI
6421 UINTN Dr6
6422 );
6423
6435UINTN
6436EFIAPI
6438 UINTN Dr7
6439 );
6440
6450UINT16
6451EFIAPI
6452AsmReadCs (
6453 VOID
6454 );
6455
6465UINT16
6466EFIAPI
6467AsmReadDs (
6468 VOID
6469 );
6470
6480UINT16
6481EFIAPI
6482AsmReadEs (
6483 VOID
6484 );
6485
6495UINT16
6496EFIAPI
6497AsmReadFs (
6498 VOID
6499 );
6500
6510UINT16
6511EFIAPI
6512AsmReadGs (
6513 VOID
6514 );
6515
6525UINT16
6526EFIAPI
6527AsmReadSs (
6528 VOID
6529 );
6530
6540UINT16
6541EFIAPI
6542AsmReadTr (
6543 VOID
6544 );
6545
6557VOID
6558EFIAPI
6560 OUT IA32_DESCRIPTOR *Gdtr
6561 );
6562
6574VOID
6575EFIAPI
6577 IN CONST IA32_DESCRIPTOR *Gdtr
6578 );
6579
6591VOID
6592EFIAPI
6594 OUT IA32_DESCRIPTOR *Idtr
6595 );
6596
6608VOID
6609EFIAPI
6611 IN CONST IA32_DESCRIPTOR *Idtr
6612 );
6613
6623UINT16
6624EFIAPI
6626 VOID
6627 );
6628
6638VOID
6639EFIAPI
6641 IN UINT16 Ldtr
6642 );
6643
6657VOID
6658EFIAPI
6659AsmFxSave (
6660 OUT IA32_FX_BUFFER *Buffer
6661 );
6662
6677VOID
6678EFIAPI
6680 IN CONST IA32_FX_BUFFER *Buffer
6681 );
6682
6692UINT64
6693EFIAPI
6694AsmReadMm0 (
6695 VOID
6696 );
6697
6707UINT64
6708EFIAPI
6709AsmReadMm1 (
6710 VOID
6711 );
6712
6722UINT64
6723EFIAPI
6724AsmReadMm2 (
6725 VOID
6726 );
6727
6737UINT64
6738EFIAPI
6739AsmReadMm3 (
6740 VOID
6741 );
6742
6752UINT64
6753EFIAPI
6754AsmReadMm4 (
6755 VOID
6756 );
6757
6767UINT64
6768EFIAPI
6769AsmReadMm5 (
6770 VOID
6771 );
6772
6782UINT64
6783EFIAPI
6784AsmReadMm6 (
6785 VOID
6786 );
6787
6797UINT64
6798EFIAPI
6799AsmReadMm7 (
6800 VOID
6801 );
6802
6812VOID
6813EFIAPI
6815 IN UINT64 Value
6816 );
6817
6827VOID
6828EFIAPI
6830 IN UINT64 Value
6831 );
6832
6842VOID
6843EFIAPI
6845 IN UINT64 Value
6846 );
6847
6857VOID
6858EFIAPI
6860 IN UINT64 Value
6861 );
6862
6872VOID
6873EFIAPI
6875 IN UINT64 Value
6876 );
6877
6887VOID
6888EFIAPI
6890 IN UINT64 Value
6891 );
6892
6902VOID
6903EFIAPI
6905 IN UINT64 Value
6906 );
6907
6917VOID
6918EFIAPI
6920 IN UINT64 Value
6921 );
6922
6932UINT64
6933EFIAPI
6934AsmReadTsc (
6935 VOID
6936 );
6937
6949UINT64
6950EFIAPI
6951AsmReadPmc (
6952 IN UINT32 Index
6953 );
6954
6971UINTN
6972EFIAPI
6973AsmMonitor (
6974 IN UINTN Eax,
6975 IN UINTN Ecx,
6976 IN UINTN Edx
6977 );
6978
6993UINTN
6994EFIAPI
6995AsmMwait (
6996 IN UINTN Eax,
6997 IN UINTN Ecx
6998 );
6999
7007VOID
7008EFIAPI
7009AsmWbinvd (
7010 VOID
7011 );
7012
7020VOID
7021EFIAPI
7022AsmInvd (
7023 VOID
7024 );
7025
7041VOID *
7042EFIAPI
7044 IN VOID *LinearAddress
7045 );
7046
7084VOID
7085EFIAPI
7087 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
7088 IN VOID *Context1 OPTIONAL,
7089 IN VOID *Context2 OPTIONAL,
7090 IN VOID *NewStack
7091 );
7092
7127VOID
7128EFIAPI
7130 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
7131 IN VOID *Context1 OPTIONAL,
7132 IN VOID *Context2 OPTIONAL,
7133 IN VOID *NewStack
7134 );
7135
7168VOID
7169EFIAPI
7171 IN UINT16 Cs,
7172 IN UINT64 EntryPoint,
7173 IN UINT64 Context1 OPTIONAL,
7174 IN UINT64 Context2 OPTIONAL,
7175 IN UINT64 NewStack
7176 );
7177
7208VOID
7209EFIAPI
7211 IN UINT16 Cs,
7212 IN UINT32 EntryPoint,
7213 IN UINT32 Context1 OPTIONAL,
7214 IN UINT32 Context2 OPTIONAL,
7215 IN UINT32 NewStack
7216 );
7217
7218//
7219// 16-bit thunking services
7220//
7221
7243VOID
7244EFIAPI
7246 OUT UINT32 *RealModeBufferSize,
7247 OUT UINT32 *ExtraStackSize
7248 );
7249
7264VOID
7265EFIAPI
7267 IN OUT THUNK_CONTEXT *ThunkContext
7268 );
7269
7323VOID
7324EFIAPI
7325AsmThunk16 (
7326 IN OUT THUNK_CONTEXT *ThunkContext
7327 );
7328
7349VOID
7350EFIAPI
7352 IN OUT THUNK_CONTEXT *ThunkContext
7353 );
7354
7366BOOLEAN
7367EFIAPI
7369 OUT UINT16 *Rand
7370 );
7371
7383BOOLEAN
7384EFIAPI
7386 OUT UINT32 *Rand
7387 );
7388
7400BOOLEAN
7401EFIAPI
7403 OUT UINT64 *Rand
7404 );
7405
7411VOID
7412EFIAPI
7413AsmWriteTr (
7414 IN UINT16 Selector
7415 );
7416
7424VOID
7425EFIAPI
7426AsmLfence (
7427 VOID
7428 );
7429
7440UINT64
7441EFIAPI
7442AsmXGetBv (
7443 IN UINT32 Index
7444 );
7445
7463UINT64
7464EFIAPI
7465AsmXSetBv (
7466 IN UINT32 Index,
7467 IN UINT64 Value
7468 );
7469
7477VOID
7478EFIAPI
7479AsmVmgExit (
7480 VOID
7481 );
7482
7517VOID
7518EFIAPI
7520 OUT X86_ASSEMBLY_PATCH_LABEL *InstructionEnd,
7521 IN UINT64 PatchValue,
7522 IN UINTN ValueSize
7523 );
7524
7525#endif // defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
7526#endif // !defined (__BASE_LIB__)
UINT64 UINTN
INT64 INTN
#define CONST
Definition: Base.h:259
#define RETURNS_TWICE
Definition: Base.h:177
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
VOID EFIAPI AsmWriteMm3(IN UINT64 Value)
Definition: GccInline.c:445
UINT64 EFIAPI AsmReadMm7(VOID)
Definition: GccInline.c:350
UINTN EFIAPI AsmReadEflags(VOID)
Definition: GccInline.c:75
UINT64 EFIAPI AsmReadTsc(VOID)
Definition: GccInline.c:555
VOID EFIAPI AsmWriteMm7(IN UINT64 Value)
Definition: GccInline.c:533
UINT64 EFIAPI AsmReadMm2(VOID)
Definition: GccInline.c:205
UINT64 EFIAPI AsmReadMm5(VOID)
Definition: GccInline.c:292
VOID EFIAPI AsmWriteMm5(IN UINT64 Value)
Definition: GccInline.c:489
UINT64 EFIAPI AsmReadMm1(VOID)
Definition: GccInline.c:176
VOID EFIAPI AsmWriteMm6(IN UINT64 Value)
Definition: GccInline.c:511
VOID EFIAPI AsmWriteMm0(IN UINT64 Value)
Definition: GccInline.c:379
UINT64 EFIAPI AsmReadMm3(VOID)
Definition: GccInline.c:234
VOID EFIAPI AsmWriteMm2(IN UINT64 Value)
Definition: GccInline.c:423
UINT64 EFIAPI AsmReadMm6(VOID)
Definition: GccInline.c:321
VOID EFIAPI AsmWriteMm4(IN UINT64 Value)
Definition: GccInline.c:467
UINT64 EFIAPI AsmReadMm0(VOID)
Definition: GccInline.c:147
UINT64 EFIAPI AsmReadMm4(VOID)
Definition: GccInline.c:263
VOID EFIAPI AsmWriteMm1(IN UINT64 Value)
Definition: GccInline.c:401
UINT32 EFIAPI BitFieldAnd32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData)
Definition: BitField.c:639
UINTN EFIAPI AsciiStrnLenS(IN CONST CHAR8 *String, IN UINTN MaxSize)
Definition: SafeString.c:1687
UINT64 EFIAPI BitFieldOr64(IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 OrData)
Definition: BitField.c:793
UINT8 EFIAPI BitFieldCountOnes64(IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit)
Definition: BitField.c:984
UINT16 EFIAPI BitFieldAnd16(IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData)
Definition: BitField.c:447
UINT64 EFIAPI CalculateCheckSum64(IN CONST UINT64 *Buffer, IN UINTN Length)
Definition: CheckSum.c:310
INTN EFIAPI AsciiStriCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
Definition: String.c:794
UINT32 EFIAPI RRotU32(IN UINT32 Operand, IN UINTN Count)
Definition: RRotU32.c:29
UINT64 EFIAPI StrHexToUint64(IN CONST CHAR16 *String)
Definition: String.c:545
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
Definition: LinkedList.c:443
UINT8 EFIAPI BcdToDecimal8(IN UINT8 Value)
Definition: String.c:1637
LIST_ENTRY *EFIAPI GetPreviousNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
Definition: LinkedList.c:369
BOOLEAN EFIAPI SetInterruptState(IN BOOLEAN InterruptState)
Definition: Cpu.c:48
UINT64 EFIAPI BitFieldAndThenOr64(IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 AndData, IN UINT64 OrData)
Definition: BitField.c:900
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
Definition: String.c:72
UINT8 EFIAPI BitFieldAndThenOr8(IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData, IN UINT8 OrData)
Definition: BitField.c:296
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
Definition: LinkedList.c:403
RETURN_STATUS EFIAPI AsciiStrnCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source, IN UINTN Length)
Definition: SafeString.c:1866
UINT32 EFIAPI BitFieldAndThenOr32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData, IN UINT32 OrData)
Definition: BitField.c:680
INTN EFIAPI LowBitSet32(IN UINT32 Operand)
Definition: LowBitSet32.c:26
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
Definition: SafeString.c:226
CHAR16 EFIAPI CharToUpper(IN CHAR16 Char)
Definition: String.c:307
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
Definition: LinkedList.c:333
BOOLEAN EFIAPI GetInterruptState(VOID)
Definition: CpuBreakpoint.c:86
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
Definition: DivU64x32.c:29
UINTN EFIAPI StrDecimalToUintn(IN CONST CHAR16 *String)
Definition: String.c:405
UINT32 EFIAPI WriteUnaligned24(OUT UINT32 *Buffer, IN UINT32 Value)
Definition: Unaligned.c:118
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
Definition: String.c:109
RETURNS_TWICE UINTN EFIAPI SetJump(OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer)
UINT64 EFIAPI MultU64x64(IN UINT64 Multiplicand, IN UINT64 Multiplier)
Definition: MultU64x64.c:27
UINT32 EFIAPI CalculateSum32(IN CONST UINT32 *Buffer, IN UINTN Length)
Definition: CheckSum.c:186
INTN(EFIAPI * BASE_SORT_COMPARE)(IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
Definition: BaseLib.h:2840
BOOLEAN EFIAPI SaveAndDisableInterrupts(VOID)
Definition: Cpu.c:21
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
Definition: SwapBytes16.c:25
BOOLEAN EFIAPI IsNodeAtEnd(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
Definition: LinkedList.c:481
RETURN_STATUS EFIAPI AsciiStrHexToUint64S(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:2514
UINT64 EFIAPI ReadUnaligned64(IN CONST UINT64 *Buffer)
Definition: Unaligned.c:204
VOID EFIAPI SwitchStack(IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL, IN VOID *NewStack,...)
Definition: SwitchStack.c:42
UINT32 EFIAPI CalculateCrc32(IN VOID *Buffer, IN UINTN Length)
Definition: CheckSum.c:599
INT64 EFIAPI DivS64x64Remainder(IN INT64 Dividend, IN INT64 Divisor, OUT INT64 *Remainder OPTIONAL)
UINT64 EFIAPI AsciiStrDecimalToUint64(IN CONST CHAR8 *String)
Definition: String.c:1028
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
Definition: String.c:621
UINT64 EFIAPI StrDecimalToUint64(IN CONST CHAR16 *String)
Definition: String.c:451
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
Definition: LinkedList.c:218
RETURN_STATUS EFIAPI AsciiStrCatS(IN OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source)
Definition: SafeString.c:1955
RETURN_STATUS EFIAPI StrDecimalToUint64S(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:743
UINT32 EFIAPI GetPowerOfTwo32(IN UINT32 Operand)
UINT32 EFIAPI BitFieldWrite32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 Value)
Definition: BitField.c:563
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
Definition: LinkedList.c:298
UINT16 EFIAPI BitFieldAndThenOr16(IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData, IN UINT16 OrData)
Definition: BitField.c:488
UINT16 EFIAPI CalculateSum16(IN CONST UINT16 *Buffer, IN UINTN Length)
Definition: CheckSum.c:106
UINT32 EFIAPI BitFieldOr32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
Definition: BitField.c:601
UINT16 EFIAPI ReadUnaligned16(IN CONST UINT16 *Buffer)
Definition: Unaligned.c:29
UINT64 EFIAPI BitFieldWrite64(IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 Value)
Definition: BitField.c:755
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
Definition: String.c:696
UINTN EFIAPI StrnSizeS(IN CONST CHAR16 *String, IN UINTN MaxSize)
Definition: SafeString.c:176
VOID EFIAPI CpuDeadLoop(VOID)
Definition: CpuDeadLoop.c:23
VOID EFIAPI QuickSort(IN OUT VOID *BufferToSort, IN CONST UINTN Count, IN CONST UINTN ElementSize, IN BASE_SORT_COMPARE CompareFunction, OUT VOID *BufferOneElement)
Definition: QuickSort.c:36
UINT8 EFIAPI CalculateSum8(IN CONST UINT8 *Buffer, IN UINTN Length)
Definition: CheckSum.c:32
INTN EFIAPI AsciiStrnCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString, IN UINTN Length)
Definition: String.c:852
RETURN_STATUS EFIAPI UnicodeStrToAsciiStrS(IN CONST CHAR16 *Source, OUT CHAR8 *Destination, IN UINTN DestMax)
Definition: SafeString.c:2633
VOID EFIAPI MemoryFence(VOID)
Definition: CpuBreakpoint.c:42
VOID EFIAPI CpuPause(VOID)
UINT8 EFIAPI CalculateCheckSum8(IN CONST UINT8 *Buffer, IN UINTN Length)
Definition: CheckSum.c:70
RETURN_STATUS EFIAPI Base64Decode(IN CONST CHAR8 *Source OPTIONAL, IN UINTN SourceSize, OUT UINT8 *Destination OPTIONAL, IN OUT UINTN *DestinationSize)
Definition: String.c:1339
VOID EFIAPI EnableInterrupts(VOID)
Definition: CpuBreakpoint.c:67
UINTN EFIAPI AsciiStrDecimalToUintn(IN CONST CHAR8 *String)
Definition: String.c:986
LIST_ENTRY *EFIAPI SwapListEntries(IN OUT LIST_ENTRY *FirstEntry, IN OUT LIST_ENTRY *SecondEntry)
Definition: LinkedList.c:522
RETURN_STATUS EFIAPI StrCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
Definition: SafeString.c:405
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
Definition: SwapBytes32.c:25
UINT32 EFIAPI ModU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
Definition: ModU64x32.c:29
VOID EFIAPI DisableInterrupts(VOID)
Definition: CpuBreakpoint.c:54
RETURN_STATUS EFIAPI AsciiStrDecimalToUintnS(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:2170
UINT8 EFIAPI BitFieldWrite8(IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 Value)
Definition: BitField.c:179
UINTN EFIAPI StrHexToUintn(IN CONST CHAR16 *String)
Definition: String.c:498
RETURN_STATUS EFIAPI AsciiStrHexToUintnS(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:2390
UINTN EFIAPI StrnLenS(IN CONST CHAR16 *String, IN UINTN MaxSize)
Definition: SafeString.c:119
RETURN_STATUS EFIAPI StrToIpv6Address(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT IPv6_ADDRESS *Address, OUT UINT8 *PrefixLength OPTIONAL)
Definition: SafeString.c:1120
RETURN_STATUS EFIAPI StrToIpv4Address(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT IPv4_ADDRESS *Address, OUT UINT8 *PrefixLength OPTIONAL)
Definition: SafeString.c:1342
INTN EFIAPI StrnCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString, IN UINTN Length)
Definition: String.c:162
RETURN_STATUS EFIAPI AsciiStrDecimalToUint64S(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:2278
UINT8 EFIAPI BitFieldRead8(IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit)
Definition: BitField.c:143
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
Definition: LinkedList.c:590
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
Definition: RShiftU64.c:28
UINT64 EFIAPI ARShiftU64(IN UINT64 Operand, IN UINTN Count)
Definition: ARShiftU64.c:28
RETURN_STATUS EFIAPI AsciiStrToGuid(IN CONST CHAR8 *String, OUT GUID *Guid)
Definition: SafeString.c:3441
UINT64 EFIAPI MultU64x32(IN UINT64 Multiplicand, IN UINT32 Multiplier)
Definition: MultU64x32.c:27
RETURN_STATUS EFIAPI StrToGuid(IN CONST CHAR16 *String, OUT GUID *Guid)
Definition: SafeString.c:1491
RETURN_STATUS EFIAPI AsciiStrToIpv4Address(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT IPv4_ADDRESS *Address, OUT UINT8 *PrefixLength OPTIONAL)
Definition: SafeString.c:3296
CHAR16 *EFIAPI PathCleanUpDirectories(IN CHAR16 *Path)
Definition: FilePaths.c:68
UINT16 EFIAPI CalculateCheckSum16(IN CONST UINT16 *Buffer, IN UINTN Length)
Definition: CheckSum.c:150
UINT64 EFIAPI DivU64x32Remainder(IN UINT64 Dividend, IN UINT32 Divisor, OUT UINT32 *Remainder OPTIONAL)
RETURN_STATUS EFIAPI StrHexToUintnS(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:860
UINT8 EFIAPI BitFieldAnd8(IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData)
Definition: BitField.c:255
UINTN EFIAPI AsciiStrnSizeS(IN CONST CHAR8 *String, IN UINTN MaxSize)
Definition: SafeString.c:1740
UINT64 EFIAPI DivU64x64Remainder(IN UINT64 Dividend, IN UINT64 Divisor, OUT UINT64 *Remainder OPTIONAL)
UINT64 EFIAPI GetPowerOfTwo64(IN UINT64 Operand)
UINT32 EFIAPI WriteUnaligned32(OUT UINT32 *Buffer, IN UINT32 Value)
Definition: Unaligned.c:177
BOOLEAN EFIAPI PathRemoveLastItem(IN OUT CHAR16 *Path)
Definition: FilePaths.c:22
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
Definition: LinkedList.c:182
UINT16 EFIAPI BitFieldWrite16(IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 Value)
Definition: BitField.c:371
RETURN_STATUS EFIAPI StrHexToBytes(IN CONST CHAR16 *String, IN UINTN Length, OUT UINT8 *Buffer, IN UINTN MaxBufferSize)
Definition: SafeString.c:1606
UINT64 EFIAPI RRotU64(IN UINT64 Operand, IN UINTN Count)
Definition: RRotU64.c:29
UINTN EFIAPI AsciiStrHexToUintn(IN CONST CHAR8 *String)
Definition: String.c:1074
INT64 EFIAPI MultS64x64(IN INT64 Multiplicand, IN INT64 Multiplier)
Definition: MultS64x64.c:27
RETURN_STATUS EFIAPI AsciiStrToIpv6Address(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT IPv6_ADDRESS *Address, OUT UINT8 *PrefixLength OPTIONAL)
Definition: SafeString.c:3078
INTN EFIAPI LowBitSet64(IN UINT64 Operand)
Definition: LowBitSet64.c:27
RETURN_STATUS EFIAPI StrnCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
Definition: SafeString.c:507
VOID EFIAPI CpuBreakpoint(VOID)
Definition: CpuBreakpoint.c:26
UINT8 EFIAPI DecimalToBcd8(IN UINT8 Value)
Definition: String.c:1613
UINT16 EFIAPI WriteUnaligned16(OUT UINT16 *Buffer, IN UINT16 Value)
Definition: Unaligned.c:61
RETURN_STATUS EFIAPI StrDecimalToUintnS(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:631
UINT64 EFIAPI BitFieldRead64(IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit)
Definition: BitField.c:719
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
Definition: LShiftU64.c:28
UINT64 EFIAPI BitFieldAnd64(IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 AndData)
Definition: BitField.c:845
RETURN_STATUS EFIAPI AsciiStrToUnicodeStrS(IN CONST CHAR8 *Source, OUT CHAR16 *Destination, IN UINTN DestMax)
Definition: SafeString.c:2856
UINT32 EFIAPI ReadUnaligned24(IN CONST UINT32 *Buffer)
Definition: Unaligned.c:89
UINT64 EFIAPI SwapBytes64(IN UINT64 Value)
Definition: SwapBytes64.c:25
UINT16 EFIAPI BitFieldOr16(IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 OrData)
Definition: BitField.c:409
UINT64 EFIAPI CalculateSum64(IN CONST UINT64 *Buffer, IN UINTN Length)
Definition: CheckSum.c:266
UINT8 EFIAPI BitFieldCountOnes32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit)
Definition: BitField.c:940
VOID(EFIAPI * SWITCH_STACK_ENTRY_POINT)(IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL)
Definition: BaseLib.h:4519
RETURN_STATUS EFIAPI StrHexToUint64S(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:989
UINT16 EFIAPI BitFieldRead16(IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit)
Definition: BitField.c:335
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
Definition: String.c:661
UINT32 EFIAPI LRotU32(IN UINT32 Operand, IN UINTN Count)
Definition: LRotU32.c:29
VOID EFIAPI LongJump(IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, IN UINTN Value)
Definition: LongJump.c:29
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
Definition: SafeString.c:310
INTN EFIAPI HighBitSet64(IN UINT64 Operand)
Definition: HighBitSet64.c:27
RETURN_STATUS EFIAPI AsciiStrHexToBytes(IN CONST CHAR8 *String, IN UINTN Length, OUT UINT8 *Buffer, IN UINTN MaxBufferSize)
Definition: SafeString.c:3552
UINT8 EFIAPI BitFieldOr8(IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 OrData)
Definition: BitField.c:217
UINT32 EFIAPI CalculateCheckSum32(IN CONST UINT32 *Buffer, IN UINTN Length)
Definition: CheckSum.c:230
RETURN_STATUS EFIAPI AsciiStrnCatS(IN OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source, IN UINTN Length)
Definition: SafeString.c:2051
UINT64 EFIAPI WriteUnaligned64(OUT UINT64 *Buffer, IN UINT64 Value)
Definition: Unaligned.c:236
UINT64 EFIAPI LRotU64(IN UINT64 Operand, IN UINTN Count)
Definition: LRotU64.c:29
RETURN_STATUS EFIAPI AsciiStrnToUnicodeStrS(IN CONST CHAR8 *Source, IN UINTN Length, OUT CHAR16 *Destination, IN UINTN DestMax, OUT UINTN *DestinationLength)
Definition: SafeString.c:2955
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
CHAR8 *EFIAPI AsciiStrStr(IN CONST CHAR8 *String, IN CONST CHAR8 *SearchString)
Definition: String.c:911
BOOLEAN EFIAPI IsNodeInList(IN CONST LIST_ENTRY *FirstEntry, IN CONST LIST_ENTRY *SecondEntry)
Definition: LinkedList.c:121
CHAR8 EFIAPI AsciiCharToUpper(IN CHAR8 Chr)
Definition: String.c:730
UINT64 EFIAPI AsciiStrHexToUint64(IN CONST CHAR8 *String)
Definition: String.c:1120
RETURN_STATUS EFIAPI UnicodeStrnToAsciiStrS(IN CONST CHAR16 *Source, IN UINTN Length, OUT CHAR8 *Destination, IN UINTN DestMax, OUT UINTN *DestinationLength)
Definition: SafeString.c:2740
RETURN_STATUS EFIAPI AsciiStrCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source)
Definition: SafeString.c:1788
VOID EFIAPI EnableDisableInterrupts(VOID)
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
Definition: String.c:224
INTN EFIAPI HighBitSet32(IN UINT32 Operand)
Definition: HighBitSet32.c:27
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
Definition: LinkedList.c:259
RETURN_STATUS EFIAPI Base64Encode(IN CONST UINT8 *Source, IN UINTN SourceLength, OUT CHAR8 *Destination OPTIONAL, IN OUT UINTN *DestinationSize)
Definition: String.c:1155
UINT32 EFIAPI BitFieldRead32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit)
Definition: BitField.c:527
UINT32 EFIAPI ReadUnaligned32(IN CONST UINT32 *Buffer)
Definition: Unaligned.c:145
VOID EFIAPI SpeculationBarrier(VOID)
UINT32 EFIAPI AsmCpuidEx(IN UINT32 Index, IN UINT32 SubIndex, OUT UINT32 *RegisterEax OPTIONAL, OUT UINT32 *RegisterEbx OPTIONAL, OUT UINT32 *RegisterEcx OPTIONAL, OUT UINT32 *RegisterEdx OPTIONAL)
Definition: CpuIdEx.c:43
VOID EFIAPI AsmDisableCache(VOID)
Definition: DisableCache.c:18
VOID EFIAPI AsmEnableCache(VOID)
Definition: EnableCache.c:18
VOID *EFIAPI AsmFlushCacheLine(IN VOID *LinearAddress)
UINTN EFIAPI AsmWriteDr1(UINTN Dr1)
UINT16 EFIAPI AsmReadTr(VOID)
UINT16 EFIAPI AsmReadLdtr(VOID)
UINTN EFIAPI AsmWriteDr4(UINTN Dr4)
UINTN EFIAPI AsmReadDr1(VOID)
VOID EFIAPI AsmInvd(VOID)
UINTN EFIAPI AsmReadDr0(VOID)
UINT16 EFIAPI AsmReadFs(VOID)
UINTN EFIAPI AsmWriteDr7(UINTN Dr7)
UINTN EFIAPI AsmWriteDr3(UINTN Dr3)
UINT16 EFIAPI AsmReadEs(VOID)
UINTN EFIAPI AsmReadCr3(VOID)
UINTN EFIAPI AsmReadDr2(VOID)
UINTN EFIAPI AsmWriteCr2(UINTN Cr2)
UINT64 EFIAPI AsmReadMsr64(IN UINT32 Index)
Definition: GccInlinePriv.c:60
UINTN EFIAPI AsmWriteCr3(UINTN Cr3)
UINTN EFIAPI AsmWriteCr4(UINTN Cr4)
VOID EFIAPI AsmWbinvd(VOID)
UINTN EFIAPI AsmReadCr0(VOID)
UINTN EFIAPI AsmWriteDr2(UINTN Dr2)
UINTN EFIAPI AsmWriteDr0(UINTN Dr0)
UINT16 EFIAPI AsmReadGs(VOID)
UINTN EFIAPI AsmWriteCr0(UINTN Cr0)
UINTN EFIAPI AsmWriteDr5(UINTN Dr5)
UINTN EFIAPI AsmReadCr2(VOID)
UINT16 EFIAPI AsmReadSs(VOID)
UINT16 EFIAPI AsmReadCs(VOID)
UINT64 EFIAPI AsmWriteMsr64(IN UINT32 Index, IN UINT64 Value)
UINTN EFIAPI AsmReadDr3(VOID)
VOID EFIAPI AsmWriteLdtr(IN UINT16 Ldtr)
UINTN EFIAPI AsmReadCr4(VOID)
UINTN EFIAPI AsmReadDr6(VOID)
UINTN EFIAPI AsmWriteDr6(UINTN Dr6)
UINT64 EFIAPI AsmReadPmc(IN UINT32 Index)
UINT16 EFIAPI AsmReadDs(VOID)
UINTN EFIAPI AsmReadDr4(VOID)
UINTN EFIAPI AsmReadDr7(VOID)
UINTN EFIAPI AsmReadDr5(VOID)
UINT32 EFIAPI AsmCpuid(IN UINT32 Index, OUT UINT32 *RegisterEax OPTIONAL, OUT UINT32 *RegisterEbx OPTIONAL, OUT UINT32 *RegisterEcx OPTIONAL, OUT UINT32 *RegisterEdx OPTIONAL)
Definition: CpuId.c:36
UINTN EFIAPI TdCall(IN UINT64 Leaf, IN UINT64 Arg1, IN UINT64 Arg2, IN UINT64 Arg3, IN OUT VOID *Results)
Definition: IntelTdxNull.c:31
BOOLEAN EFIAPI TdIsEnabled()
Definition: IntelTdxNull.c:79
UINTN EFIAPI TdVmCall(IN UINT64 Leaf, IN UINT64 Arg1, IN UINT64 Arg2, IN UINT64 Arg3, IN UINT64 Arg4, IN OUT VOID *Results)
Definition: IntelTdxNull.c:59
UINTN EFIAPI AsmMonitor(IN UINTN RegisterEax, IN UINTN RegisterEcx, IN UINTN RegisterEdx)
Definition: Monitor.c:27
UINTN EFIAPI AsmMwait(IN UINTN RegisterEax, IN UINTN RegisterEcx)
Definition: Mwait.c:25
UINTN Rand(VOID)
Definition: Support.c:37
VOID EFIAPI AsmDisablePaging32(IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL, IN VOID *NewStack)
VOID EFIAPI AsmDisablePaging64(IN UINT16 Cs, IN UINT32 EntryPoint, IN UINT32 Context1 OPTIONAL, IN UINT32 Context2 OPTIONAL, IN UINT32 NewStack)
VOID EFIAPI AsmEnablePaging32(IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL, IN VOID *NewStack)
VOID EFIAPI AsmEnablePaging64(IN UINT16 Cs, IN UINT64 EntryPoint, IN UINT64 Context1 OPTIONAL, IN UINT64 Context2 OPTIONAL, IN UINT64 NewStack)
VOID EFIAPI AsmFxRestore(IN CONST IA32_FX_BUFFER *Buffer)
Definition: X86FxRestore.c:27
VOID EFIAPI AsmFxSave(OUT IA32_FX_BUFFER *Buffer)
Definition: X86FxSave.c:26
UINT32 EFIAPI AsmWriteMsr32(IN UINT32 Index, IN UINT32 Value)
Definition: X86Msr.c:53
UINT64 EFIAPI AsmMsrAnd64(IN UINT32 Index, IN UINT64 AndData)
Definition: X86Msr.c:406
UINT64 EFIAPI AsmMsrBitFieldOr64(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 OrData)
Definition: X86Msr.c:547
UINT32 EFIAPI AsmMsrBitFieldAndThenOr32(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData, IN UINT32 OrData)
Definition: X86Msr.c:339
UINT64 EFIAPI AsmMsrOr64(IN UINT32 Index, IN UINT64 OrData)
Definition: X86Msr.c:378
UINT32 EFIAPI AsmMsrAnd32(IN UINT32 Index, IN UINT32 AndData)
Definition: X86Msr.c:111
UINT32 EFIAPI AsmMsrAndThenOr32(IN UINT32 Index, IN UINT32 AndData, IN UINT32 OrData)
Definition: X86Msr.c:143
UINT64 EFIAPI AsmMsrBitFieldWrite64(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 Value)
Definition: X86Msr.c:505
UINT64 EFIAPI AsmMsrBitFieldAnd64(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 AndData)
Definition: X86Msr.c:589
UINT32 EFIAPI AsmMsrBitFieldOr32(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
Definition: X86Msr.c:253
UINT32 EFIAPI AsmMsrOr32(IN UINT32 Index, IN UINT32 OrData)
Definition: X86Msr.c:82
UINT32 EFIAPI AsmReadMsr32(IN UINT32 Index)
Definition: X86Msr.c:27
UINT64 EFIAPI AsmMsrBitFieldRead64(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit)
Definition: X86Msr.c:470
UINT64 EFIAPI AsmMsrBitFieldAndThenOr64(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 AndData, IN UINT64 OrData)
Definition: X86Msr.c:634
UINT64 EFIAPI AsmMsrAndThenOr64(IN UINT32 Index, IN UINT64 AndData, IN UINT64 OrData)
Definition: X86Msr.c:437
UINT32 EFIAPI AsmMsrBitFieldRead32(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit)
Definition: X86Msr.c:176
UINT32 EFIAPI AsmMsrBitFieldWrite32(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 Value)
Definition: X86Msr.c:212
UINT32 EFIAPI AsmMsrBitFieldAnd32(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData)
Definition: X86Msr.c:294
VOID EFIAPI PatchInstructionX86(OUT X86_ASSEMBLY_PATCH_LABEL *InstructionEnd, IN UINT64 PatchValue, IN UINTN ValueSize)
BOOLEAN EFIAPI AsmRdRand32(OUT UINT32 *Rand)
Definition: X86RdRand.c:46
BOOLEAN EFIAPI AsmRdRand64(OUT UINT64 *Rand)
Definition: X86RdRand.c:67
BOOLEAN EFIAPI AsmRdRand16(OUT UINT16 *Rand)
Definition: X86RdRand.c:25
VOID EFIAPI AsmReadGdtr(OUT IA32_DESCRIPTOR *Gdtr)
Definition: X86ReadGdtr.c:24
VOID EFIAPI AsmReadIdtr(OUT IA32_DESCRIPTOR *Idtr)
Definition: X86ReadIdtr.c:24
VOID EFIAPI AsmGetThunk16Properties(OUT UINT32 *RealModeBufferSize, OUT UINT32 *ExtraStackSize)
Definition: X86Thunk.c:62
VOID EFIAPI AsmPrepareThunk16(IN OUT THUNK_CONTEXT *ThunkContext)
Definition: X86Thunk.c:94
VOID EFIAPI AsmPrepareAndThunk16(IN OUT THUNK_CONTEXT *ThunkContext)
Definition: X86Thunk.c:257
VOID EFIAPI AsmThunk16(IN OUT THUNK_CONTEXT *ThunkContext)
Definition: X86Thunk.c:212
VOID EFIAPI AsmWriteTr(IN UINT16 Selector)
VOID EFIAPI AsmWriteGdtr(IN CONST IA32_DESCRIPTOR *Gdtr)
VOID EFIAPI AsmWriteIdtr(IN CONST IA32_DESCRIPTOR *Idtr)
VOID EFIAPI AsmLfence(VOID)
Definition: Base.h:213