TianoCore EDK2 master
Loading...
Searching...
No Matches
BaseLib.h
Go to the documentation of this file.
1
16#ifndef __BASE_LIB__
17#define __BASE_LIB__
18
19//
20// Definitions for architecture-specific types
21//
22#if defined (MDE_CPU_IA32)
26typedef struct {
27 UINT32 Ebx;
28 UINT32 Esi;
29 UINT32 Edi;
30 UINT32 Ebp;
31 UINT32 Esp;
32 UINT32 Eip;
33 UINT32 Ssp;
34} BASE_LIBRARY_JUMP_BUFFER;
35
36#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4
37
38#endif // defined (MDE_CPU_IA32)
39
40#if defined (MDE_CPU_X64)
44typedef struct {
45 UINT64 Rbx;
46 UINT64 Rsp;
47 UINT64 Rbp;
48 UINT64 Rdi;
49 UINT64 Rsi;
50 UINT64 R12;
51 UINT64 R13;
52 UINT64 R14;
53 UINT64 R15;
54 UINT64 Rip;
55 UINT64 MxCsr;
56 UINT8 XmmBuffer[160];
57 UINT64 Ssp;
58} BASE_LIBRARY_JUMP_BUFFER;
59
60#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
61
62#endif // defined (MDE_CPU_X64)
63
64#if defined (MDE_CPU_EBC)
68typedef struct {
69 UINT64 R0;
70 UINT64 R1;
71 UINT64 R2;
72 UINT64 R3;
73 UINT64 IP;
74} BASE_LIBRARY_JUMP_BUFFER;
75
76#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
77
78#endif // defined (MDE_CPU_EBC)
79
80#if defined (MDE_CPU_ARM)
81
82typedef struct {
83 UINT32 R3;
84 UINT32 R4;
85 UINT32 R5;
86 UINT32 R6;
87 UINT32 R7;
88 UINT32 R8;
89 UINT32 R9;
90 UINT32 R10;
91 UINT32 R11;
92 UINT32 R12;
93 UINT32 R14;
94} BASE_LIBRARY_JUMP_BUFFER;
95
96#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4
97
98#endif // defined (MDE_CPU_ARM)
99
100#if defined (MDE_CPU_AARCH64)
101typedef struct {
102 // GP regs
103 UINT64 X19;
104 UINT64 X20;
105 UINT64 X21;
106 UINT64 X22;
107 UINT64 X23;
108 UINT64 X24;
109 UINT64 X25;
110 UINT64 X26;
111 UINT64 X27;
112 UINT64 X28;
113 UINT64 FP;
114 UINT64 LR;
115 UINT64 IP0;
116
117 // FP regs
118 UINT64 D8;
119 UINT64 D9;
120 UINT64 D10;
121 UINT64 D11;
122 UINT64 D12;
123 UINT64 D13;
124 UINT64 D14;
125 UINT64 D15;
126} BASE_LIBRARY_JUMP_BUFFER;
127
128#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
129
138UINT64
139EFIAPI
140ArmReadCntPctReg (
141 VOID
142 );
143
144//
145// Bit shifts for the ID_AA64ISAR0_EL1 register.
146//
147#define ARM_ID_AA64ISAR0_EL1_AES_SHIFT (4U)
148#define ARM_ID_AA64ISAR0_EL1_SHA1_SHIFT (8U)
149#define ARM_ID_AA64ISAR0_EL1_SHA2_SHIFT (12U)
150#define ARM_ID_AA64ISAR0_EL1_CRC32_SHIFT (16U)
151#define ARM_ID_AA64ISAR0_EL1_ATOMIC_SHIFT (20U)
152#define ARM_ID_AA64ISAR0_EL1_RDM_SHIFT (28U)
153#define ARM_ID_AA64ISAR0_EL1_SHA3_SHIFT (32U)
154#define ARM_ID_AA64ISAR0_EL1_SM3_SHIFT (36U)
155#define ARM_ID_AA64ISAR0_EL1_SM4_SHIFT (40U)
156#define ARM_ID_AA64ISAR0_EL1_DP_SHIFT (44U)
157#define ARM_ID_AA64ISAR0_EL1_FHM_SHIFT (48U)
158#define ARM_ID_AA64ISAR0_EL1_TS_SHIFT (52U)
159#define ARM_ID_AA64ISAR0_EL1_TLB_SHIFT (56U)
160#define ARM_ID_AA64ISAR0_EL1_RNDR_SHIFT (60U)
161
162//
163// Bit masks for the ID_AA64ISAR0_EL1 fields.
164//
165#define ARM_ID_AA64ISAR0_EL1_AES_MASK (0xFU)
166#define ARM_ID_AA64ISAR0_EL1_SHA1_MASK (0xFU)
167#define ARM_ID_AA64ISAR0_EL1_SHA2_MASK (0xFU)
168#define ARM_ID_AA64ISAR0_EL1_CRC32_MASK (0xFU)
169#define ARM_ID_AA64ISAR0_EL1_ATOMIC_MASK (0xFU)
170#define ARM_ID_AA64ISAR0_EL1_RDM_MASK (0xFU)
171#define ARM_ID_AA64ISAR0_EL1_SHA3_MASK (0xFU)
172#define ARM_ID_AA64ISAR0_EL1_SM3_MASK (0xFU)
173#define ARM_ID_AA64ISAR0_EL1_SM4_MASK (0xFU)
174#define ARM_ID_AA64ISAR0_EL1_DP_MASK (0xFU)
175#define ARM_ID_AA64ISAR0_EL1_FHM_MASK (0xFU)
176#define ARM_ID_AA64ISAR0_EL1_TS_MASK (0xFU)
177#define ARM_ID_AA64ISAR0_EL1_TLB_MASK (0xFU)
178#define ARM_ID_AA64ISAR0_EL1_RNDR_MASK (0xFU)
179
180//
181// Bit masks for the ID_AA64ISAR0_EL1 field values.
182//
183#define ARM_ID_AA64ISAR0_EL1_AES_FEAT_AES_MASK (0x1U)
184#define ARM_ID_AA64ISAR0_EL1_AES_FEAT_PMULL_MASK (0x2U)
185#define ARM_ID_AA64ISAR0_EL1_SHA1_FEAT_SHA1_MASK (0x1U)
186#define ARM_ID_AA64ISAR0_EL1_SHA2_FEAT_SHA256_MASK (0x1U)
187#define ARM_ID_AA64ISAR0_EL1_SHA2_FEAT_SHA512_MASK (0x2U)
188#define ARM_ID_AA64ISAR0_EL1_CRC32_HAVE_CRC32_MASK (0x1U)
189#define ARM_ID_AA64ISAR0_EL1_ATOMIC_FEAT_LSE_MASK (0x2U)
190#define ARM_ID_AA64ISAR0_EL1_RDM_FEAT_RDM_MASK (0x1U)
191#define ARM_ID_AA64ISAR0_EL1_SHA3_FEAT_SHA3_MASK (0x1U)
192#define ARM_ID_AA64ISAR0_EL1_SM3_FEAT_SM3_MASK (0x1U)
193#define ARM_ID_AA64ISAR0_EL1_SM4_FEAT_SM4_MASK (0x1U)
194#define ARM_ID_AA64ISAR0_EL1_DP_FEAT_DOTPROD_MASK (0x1U)
195#define ARM_ID_AA64ISAR0_EL1_FHM_FEAT_FHM_MASK (0x1U)
196#define ARM_ID_AA64ISAR0_EL1_TS_FEAT_FLAGM_MASK (0x1U)
197#define ARM_ID_AA64ISAR0_EL1_TS_FEAT_FLAGM2_MASK (0x2U)
198#define ARM_ID_AA64ISAR0_EL1_TLB_FEAT_TLBIOS_MASK (0x1U)
199#define ARM_ID_AA64ISAR0_EL1_TLB_FEAT_TLBIRANGE_MASK (0x2U)
200#define ARM_ID_AA64ISAR0_EL1_RNDR_FEAT_RNG_MASK (0x1U)
201
210UINT64
211EFIAPI
212ArmReadIdAA64Isar0Reg (
213 VOID
214 );
215
216#endif // defined (MDE_CPU_AARCH64)
217
218#if defined (MDE_CPU_RISCV64)
222typedef struct {
223 UINT64 RA;
224 UINT64 S0;
225 UINT64 S1;
226 UINT64 S2;
227 UINT64 S3;
228 UINT64 S4;
229 UINT64 S5;
230 UINT64 S6;
231 UINT64 S7;
232 UINT64 S8;
233 UINT64 S9;
234 UINT64 S10;
235 UINT64 S11;
236 UINT64 SP;
237} BASE_LIBRARY_JUMP_BUFFER;
238
239#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
240
241VOID
242RiscVSetSupervisorScratch (
243 IN UINT64
244 );
245
246UINT64
247RiscVGetSupervisorScratch (
248 VOID
249 );
250
251VOID
252RiscVSetSupervisorStvec (
253 IN UINT64
254 );
255
256UINT64
257RiscVGetSupervisorStvec (
258 VOID
259 );
260
261UINT64
262RiscVGetSupervisorTrapCause (
263 VOID
264 );
265
266VOID
267RiscVSetSupervisorAddressTranslationRegister (
268 IN UINT64
269 );
270
271UINT64
272RiscVGetSupervisorAddressTranslationRegister (
273 VOID
274 );
275
276UINT64
277RiscVReadTimer (
278 VOID
279 );
280
281VOID
282RiscVSetSupervisorTimeCompareRegister (
283 IN UINT64
284 );
285
286VOID
287RiscVEnableTimerInterrupt (
288 VOID
289 );
290
291VOID
292RiscVDisableTimerInterrupt (
293 VOID
294 );
295
296VOID
297RiscVClearPendingTimerInterrupt (
298 VOID
299 );
300
305VOID
306EFIAPI
307RiscVInvalidateInstCacheFenceAsm (
308 VOID
309 );
310
315VOID
316EFIAPI
317RiscVInvalidateDataCacheFenceAsm (
318 VOID
319 );
320
326VOID
327EFIAPI
328RiscVCpuCacheFlushCmoAsm (
329 IN UINTN
330 );
331
338VOID
339EFIAPI
340RiscVCpuCacheCleanCmoAsm (
341 IN UINTN
342 );
343
348VOID
349EFIAPI
350RiscVCpuCacheInvalCmoAsm (
351 IN UINTN
352 );
353
354#endif // defined (MDE_CPU_RISCV64)
355
356#if defined (MDE_CPU_LOONGARCH64)
360typedef struct {
361 UINT64 S0;
362 UINT64 S1;
363 UINT64 S2;
364 UINT64 S3;
365 UINT64 S4;
366 UINT64 S5;
367 UINT64 S6;
368 UINT64 S7;
369 UINT64 S8;
370 UINT64 SP;
371 UINT64 FP;
372 UINT64 RA;
373} BASE_LIBRARY_JUMP_BUFFER;
374
375#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
376
377/*
378 * Set the exception base address for LoongArch.
379 *
380 * @param ExceptionBaseAddress The exception base address, must be aligned greater than or qeual to 4K .
381 */
382VOID
383SetExceptionBaseAddress (
384 IN UINT64
385 );
386
387/*
388 * Set the TlbRebase address for LoongArch.
389 *
390 * @param TlbRebaseAddress The TlbRebase address, must be aligned greater than or qeual to 4K .
391 */
392VOID
393SetTlbRebaseAddress (
394 IN UINT64
395 );
396
402VOID
403EnableLocalInterrupts (
404 IN UINT16
405 );
406
412VOID
413DisableLocalInterrupts (
414 IN UINT16
415 );
416
423VOID
424AsmCpucfg (
425 IN UINT32 Index,
426 OUT UINT32 *Data
427 );
428
436UINTN
437AsmReadStableCounter (
438 VOID
439 );
440
449UINTN
450CsrRead (
451 IN UINT16 Select
452 );
453
463UINTN
464CsrWrite (
465 IN UINT16 Select,
466 IN UINTN Value
467 );
468
479UINTN
480CsrXChg (
481 IN UINT16 Select,
482 IN UINTN Value,
483 IN UINTN Mask
484 );
485
494UINT8
495IoCsrRead8 (
496 IN UINTN Select
497 );
498
507UINT16
508IoCsrRead16 (
509 IN UINTN Select
510 );
511
520UINT32
521IoCsrRead32 (
522 IN UINTN Select
523 );
524
533UINT64
534IoCsrRead64 (
535 IN UINTN Select
536 );
537
547VOID
548IoCsrWrite8 (
549 IN UINTN Select,
550 IN UINT8 Value
551 );
552
562VOID
563IoCsrWrite16 (
564 IN UINTN Select,
565 IN UINT16 Value
566 );
567
577VOID
578IoCsrWrite32 (
579 IN UINTN Select,
580 IN UINT32 Value
581 );
582
592VOID
593IoCsrWrite64 (
594 IN UINTN Select,
595 IN UINT64 Value
596 );
597
598#endif // defined (MDE_CPU_LOONGARCH64)
599
600//
601// String Services
602//
603
620UINTN
621EFIAPI
622StrnLenS (
623 IN CONST CHAR16 *String,
624 IN UINTN MaxSize
625 );
626
648UINTN
649EFIAPI
650StrnSizeS (
651 IN CONST CHAR16 *String,
652 IN UINTN MaxSize
653 );
654
681RETURN_STATUS
682EFIAPI
683StrCpyS (
684 OUT CHAR16 *Destination,
685 IN UINTN DestMax,
686 IN CONST CHAR16 *Source
687 );
688
718RETURN_STATUS
719EFIAPI
720StrnCpyS (
721 OUT CHAR16 *Destination,
722 IN UINTN DestMax,
723 IN CONST CHAR16 *Source,
724 IN UINTN Length
725 );
726
756RETURN_STATUS
757EFIAPI
758StrCatS (
759 IN OUT CHAR16 *Destination,
760 IN UINTN DestMax,
761 IN CONST CHAR16 *Source
762 );
763
796RETURN_STATUS
797EFIAPI
798StrnCatS (
799 IN OUT CHAR16 *Destination,
800 IN UINTN DestMax,
801 IN CONST CHAR16 *Source,
802 IN UINTN Length
803 );
804
848RETURN_STATUS
849EFIAPI
851 IN CONST CHAR16 *String,
852 OUT CHAR16 **EndPointer OPTIONAL,
853 OUT UINTN *Data
854 );
855
899RETURN_STATUS
900EFIAPI
902 IN CONST CHAR16 *String,
903 OUT CHAR16 **EndPointer OPTIONAL,
904 OUT UINT64 *Data
905 );
906
955RETURN_STATUS
956EFIAPI
958 IN CONST CHAR16 *String,
959 OUT CHAR16 **EndPointer OPTIONAL,
960 OUT UINTN *Data
961 );
962
1011RETURN_STATUS
1012EFIAPI
1014 IN CONST CHAR16 *String,
1015 OUT CHAR16 **EndPointer OPTIONAL,
1016 OUT UINT64 *Data
1017 );
1018
1033UINTN
1034EFIAPI
1036 IN CONST CHAR8 *String,
1037 IN UINTN MaxSize
1038 );
1039
1059UINTN
1060EFIAPI
1062 IN CONST CHAR8 *String,
1063 IN UINTN MaxSize
1064 );
1065
1089RETURN_STATUS
1090EFIAPI
1092 OUT CHAR8 *Destination,
1093 IN UINTN DestMax,
1094 IN CONST CHAR8 *Source
1095 );
1096
1123RETURN_STATUS
1124EFIAPI
1126 OUT CHAR8 *Destination,
1127 IN UINTN DestMax,
1128 IN CONST CHAR8 *Source,
1129 IN UINTN Length
1130 );
1131
1158RETURN_STATUS
1159EFIAPI
1161 IN OUT CHAR8 *Destination,
1162 IN UINTN DestMax,
1163 IN CONST CHAR8 *Source
1164 );
1165
1195RETURN_STATUS
1196EFIAPI
1198 IN OUT CHAR8 *Destination,
1199 IN UINTN DestMax,
1200 IN CONST CHAR8 *Source,
1201 IN UINTN Length
1202 );
1203
1245RETURN_STATUS
1246EFIAPI
1248 IN CONST CHAR8 *String,
1249 OUT CHAR8 **EndPointer OPTIONAL,
1250 OUT UINTN *Data
1251 );
1252
1294RETURN_STATUS
1295EFIAPI
1297 IN CONST CHAR8 *String,
1298 OUT CHAR8 **EndPointer OPTIONAL,
1299 OUT UINT64 *Data
1300 );
1301
1347RETURN_STATUS
1348EFIAPI
1350 IN CONST CHAR8 *String,
1351 OUT CHAR8 **EndPointer OPTIONAL,
1352 OUT UINTN *Data
1353 );
1354
1400RETURN_STATUS
1401EFIAPI
1403 IN CONST CHAR8 *String,
1404 OUT CHAR8 **EndPointer OPTIONAL,
1405 OUT UINT64 *Data
1406 );
1407
1425UINTN
1426EFIAPI
1427StrLen (
1428 IN CONST CHAR16 *String
1429 );
1430
1449UINTN
1450EFIAPI
1451StrSize (
1452 IN CONST CHAR16 *String
1453 );
1454
1483INTN
1484EFIAPI
1485StrCmp (
1486 IN CONST CHAR16 *FirstString,
1487 IN CONST CHAR16 *SecondString
1488 );
1489
1522INTN
1523EFIAPI
1524StrnCmp (
1525 IN CONST CHAR16 *FirstString,
1526 IN CONST CHAR16 *SecondString,
1527 IN UINTN Length
1528 );
1529
1555CHAR16 *
1556EFIAPI
1557StrStr (
1558 IN CONST CHAR16 *String,
1559 IN CONST CHAR16 *SearchString
1560 );
1561
1596UINTN
1597EFIAPI
1599 IN CONST CHAR16 *String
1600 );
1601
1636UINT64
1637EFIAPI
1639 IN CONST CHAR16 *String
1640 );
1641
1677UINTN
1678EFIAPI
1680 IN CONST CHAR16 *String
1681 );
1682
1718UINT64
1719EFIAPI
1721 IN CONST CHAR16 *String
1722 );
1723
1774RETURN_STATUS
1775EFIAPI
1777 IN CONST CHAR16 *String,
1778 OUT CHAR16 **EndPointer OPTIONAL,
1779 OUT IPv6_ADDRESS *Address,
1780 OUT UINT8 *PrefixLength OPTIONAL
1781 );
1782
1824RETURN_STATUS
1825EFIAPI
1827 IN CONST CHAR16 *String,
1828 OUT CHAR16 **EndPointer OPTIONAL,
1829 OUT IPv4_ADDRESS *Address,
1830 OUT UINT8 *PrefixLength OPTIONAL
1831 );
1832
1833#define GUID_STRING_LENGTH 36
1834
1877RETURN_STATUS
1878EFIAPI
1879StrToGuid (
1880 IN CONST CHAR16 *String,
1881 OUT GUID *Guid
1882 );
1883
1917RETURN_STATUS
1918EFIAPI
1920 IN CONST CHAR16 *String,
1921 IN UINTN Length,
1922 OUT UINT8 *Buffer,
1923 IN UINTN MaxBufferSize
1924 );
1925
1966RETURN_STATUS
1967EFIAPI
1969 IN CONST CHAR16 *Source,
1970 OUT CHAR8 *Destination,
1971 IN UINTN DestMax
1972 );
1973
2017RETURN_STATUS
2018EFIAPI
2020 IN CONST CHAR16 *Source,
2021 IN UINTN Length,
2022 OUT CHAR8 *Destination,
2023 IN UINTN DestMax,
2024 OUT UINTN *DestinationLength
2025 );
2026
2044UINTN
2045EFIAPI
2047 IN CONST CHAR8 *String
2048 );
2049
2067UINTN
2068EFIAPI
2070 IN CONST CHAR8 *String
2071 );
2072
2099INTN
2100EFIAPI
2102 IN CONST CHAR8 *FirstString,
2103 IN CONST CHAR8 *SecondString
2104 );
2105
2135INTN
2136EFIAPI
2138 IN CONST CHAR8 *FirstString,
2139 IN CONST CHAR8 *SecondString
2140 );
2141
2172INTN
2173EFIAPI
2175 IN CONST CHAR8 *FirstString,
2176 IN CONST CHAR8 *SecondString,
2177 IN UINTN Length
2178 );
2179
2204CHAR8 *
2205EFIAPI
2207 IN CONST CHAR8 *String,
2208 IN CONST CHAR8 *SearchString
2209 );
2210
2241UINTN
2242EFIAPI
2244 IN CONST CHAR8 *String
2245 );
2246
2277UINT64
2278EFIAPI
2280 IN CONST CHAR8 *String
2281 );
2282
2317UINTN
2318EFIAPI
2320 IN CONST CHAR8 *String
2321 );
2322
2357UINT64
2358EFIAPI
2360 IN CONST CHAR8 *String
2361 );
2362
2411RETURN_STATUS
2412EFIAPI
2414 IN CONST CHAR8 *String,
2415 OUT CHAR8 **EndPointer OPTIONAL,
2416 OUT IPv6_ADDRESS *Address,
2417 OUT UINT8 *PrefixLength OPTIONAL
2418 );
2419
2459RETURN_STATUS
2460EFIAPI
2462 IN CONST CHAR8 *String,
2463 OUT CHAR8 **EndPointer OPTIONAL,
2464 OUT IPv4_ADDRESS *Address,
2465 OUT UINT8 *PrefixLength OPTIONAL
2466 );
2467
2508RETURN_STATUS
2509EFIAPI
2511 IN CONST CHAR8 *String,
2512 OUT GUID *Guid
2513 );
2514
2546RETURN_STATUS
2547EFIAPI
2549 IN CONST CHAR8 *String,
2550 IN UINTN Length,
2551 OUT UINT8 *Buffer,
2552 IN UINTN MaxBufferSize
2553 );
2554
2591RETURN_STATUS
2592EFIAPI
2594 IN CONST CHAR8 *Source,
2595 OUT CHAR16 *Destination,
2596 IN UINTN DestMax
2597 );
2598
2641RETURN_STATUS
2642EFIAPI
2644 IN CONST CHAR8 *Source,
2645 IN UINTN Length,
2646 OUT CHAR16 *Destination,
2647 IN UINTN DestMax,
2648 OUT UINTN *DestinationLength
2649 );
2650
2666CHAR16
2667EFIAPI
2669 IN CHAR16 Char
2670 );
2671
2685CHAR8
2686EFIAPI
2688 IN CHAR8 Chr
2689 );
2690
2710RETURN_STATUS
2711EFIAPI
2713 IN CONST UINT8 *Source,
2714 IN UINTN SourceLength,
2715 OUT CHAR8 *Destination OPTIONAL,
2716 IN OUT UINTN *DestinationSize
2717 );
2718
2801RETURN_STATUS
2802EFIAPI
2804 IN CONST CHAR8 *Source OPTIONAL,
2805 IN UINTN SourceSize,
2806 OUT UINT8 *Destination OPTIONAL,
2807 IN OUT UINTN *DestinationSize
2808 );
2809
2823UINT8
2824EFIAPI
2826 IN UINT8 Value
2827 );
2828
2843UINT8
2844EFIAPI
2846 IN UINT8 Value
2847 );
2848
2849//
2850// File Path Manipulation Functions
2851//
2852
2861BOOLEAN
2862EFIAPI
2864 IN OUT CHAR16 *Path
2865 );
2866
2880CHAR16 *
2881EFIAPI
2883 IN CHAR16 *Path
2884 );
2885
2886//
2887// Linked List Functions and Macros
2888//
2889
2904#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&(ListHead), &(ListHead)}
2905
2913#define BASE_LIST_FOR_EACH(Entry, ListHead) \
2914 for(Entry = (ListHead)->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)
2915
2929#define BASE_LIST_FOR_EACH_SAFE(Entry, NextEntry, ListHead) \
2930 for(Entry = (ListHead)->ForwardLink, NextEntry = Entry->ForwardLink;\
2931 Entry != (ListHead); Entry = NextEntry, NextEntry = Entry->ForwardLink)
2932
2952BOOLEAN
2953EFIAPI
2955 IN CONST LIST_ENTRY *FirstEntry,
2956 IN CONST LIST_ENTRY *SecondEntry
2957 );
2958
2975LIST_ENTRY *
2976EFIAPI
2978 IN OUT LIST_ENTRY *ListHead
2979 );
2980
3003LIST_ENTRY *
3004EFIAPI
3006 IN OUT LIST_ENTRY *ListHead,
3007 IN OUT LIST_ENTRY *Entry
3008 );
3009
3032LIST_ENTRY *
3033EFIAPI
3035 IN OUT LIST_ENTRY *ListHead,
3036 IN OUT LIST_ENTRY *Entry
3037 );
3038
3059LIST_ENTRY *
3060EFIAPI
3062 IN CONST LIST_ENTRY *List
3063 );
3064
3086LIST_ENTRY *
3087EFIAPI
3089 IN CONST LIST_ENTRY *List,
3090 IN CONST LIST_ENTRY *Node
3091 );
3092
3114LIST_ENTRY *
3115EFIAPI
3117 IN CONST LIST_ENTRY *List,
3118 IN CONST LIST_ENTRY *Node
3119 );
3120
3140BOOLEAN
3141EFIAPI
3143 IN CONST LIST_ENTRY *ListHead
3144 );
3145
3172BOOLEAN
3173EFIAPI
3174IsNull (
3175 IN CONST LIST_ENTRY *List,
3176 IN CONST LIST_ENTRY *Node
3177 );
3178
3202BOOLEAN
3203EFIAPI
3205 IN CONST LIST_ENTRY *List,
3206 IN CONST LIST_ENTRY *Node
3207 );
3208
3235LIST_ENTRY *
3236EFIAPI
3238 IN OUT LIST_ENTRY *FirstEntry,
3239 IN OUT LIST_ENTRY *SecondEntry
3240 );
3241
3263LIST_ENTRY *
3264EFIAPI
3266 IN CONST LIST_ENTRY *Entry
3267 );
3268
3269//
3270// Math Services
3271//
3272
3283typedef
3285(EFIAPI *BASE_SORT_COMPARE)(
3286 IN CONST VOID *Buffer1,
3287 IN CONST VOID *Buffer2
3288 );
3289
3313VOID
3314EFIAPI
3315QuickSort (
3316 IN OUT VOID *BufferToSort,
3317 IN CONST UINTN Count,
3318 IN CONST UINTN ElementSize,
3319 IN BASE_SORT_COMPARE CompareFunction,
3320 OUT VOID *BufferOneElement
3321 );
3322
3338UINT64
3339EFIAPI
3340LShiftU64 (
3341 IN UINT64 Operand,
3342 IN UINTN Count
3343 );
3344
3360UINT64
3361EFIAPI
3362RShiftU64 (
3363 IN UINT64 Operand,
3364 IN UINTN Count
3365 );
3366
3382UINT64
3383EFIAPI
3384ARShiftU64 (
3385 IN UINT64 Operand,
3386 IN UINTN Count
3387 );
3388
3405UINT32
3406EFIAPI
3407LRotU32 (
3408 IN UINT32 Operand,
3409 IN UINTN Count
3410 );
3411
3428UINT32
3429EFIAPI
3430RRotU32 (
3431 IN UINT32 Operand,
3432 IN UINTN Count
3433 );
3434
3451UINT64
3452EFIAPI
3453LRotU64 (
3454 IN UINT64 Operand,
3455 IN UINTN Count
3456 );
3457
3474UINT64
3475EFIAPI
3476RRotU64 (
3477 IN UINT64 Operand,
3478 IN UINTN Count
3479 );
3480
3494INTN
3495EFIAPI
3497 IN UINT32 Operand
3498 );
3499
3514INTN
3515EFIAPI
3517 IN UINT64 Operand
3518 );
3519
3534INTN
3535EFIAPI
3537 IN UINT32 Operand
3538 );
3539
3554INTN
3555EFIAPI
3557 IN UINT64 Operand
3558 );
3559
3573UINT32
3574EFIAPI
3576 IN UINT32 Operand
3577 );
3578
3592UINT64
3593EFIAPI
3595 IN UINT64 Operand
3596 );
3597
3610UINT16
3611EFIAPI
3613 IN UINT16 Value
3614 );
3615
3628UINT32
3629EFIAPI
3631 IN UINT32 Value
3632 );
3633
3646UINT64
3647EFIAPI
3649 IN UINT64 Value
3650 );
3651
3666UINT64
3667EFIAPI
3668MultU64x32 (
3669 IN UINT64 Multiplicand,
3670 IN UINT32 Multiplier
3671 );
3672
3687UINT64
3688EFIAPI
3689MultU64x64 (
3690 IN UINT64 Multiplicand,
3691 IN UINT64 Multiplier
3692 );
3693
3708INT64
3709EFIAPI
3710MultS64x64 (
3711 IN INT64 Multiplicand,
3712 IN INT64 Multiplier
3713 );
3714
3731UINT64
3732EFIAPI
3733DivU64x32 (
3734 IN UINT64 Dividend,
3735 IN UINT32 Divisor
3736 );
3737
3754UINT32
3755EFIAPI
3756ModU64x32 (
3757 IN UINT64 Dividend,
3758 IN UINT32 Divisor
3759 );
3760
3780UINT64
3781EFIAPI
3783 IN UINT64 Dividend,
3784 IN UINT32 Divisor,
3785 OUT UINT32 *Remainder OPTIONAL
3786 );
3787
3807UINT64
3808EFIAPI
3810 IN UINT64 Dividend,
3811 IN UINT64 Divisor,
3812 OUT UINT64 *Remainder OPTIONAL
3813 );
3814
3838INT64
3839EFIAPI
3841 IN INT64 Dividend,
3842 IN INT64 Divisor,
3843 OUT INT64 *Remainder OPTIONAL
3844 );
3845
3859UINT16
3860EFIAPI
3862 IN CONST UINT16 *Buffer
3863 );
3864
3880UINT16
3881EFIAPI
3883 OUT UINT16 *Buffer,
3884 IN UINT16 Value
3885 );
3886
3900UINT32
3901EFIAPI
3903 IN CONST UINT32 *Buffer
3904 );
3905
3921UINT32
3922EFIAPI
3924 OUT UINT32 *Buffer,
3925 IN UINT32 Value
3926 );
3927
3941UINT32
3942EFIAPI
3944 IN CONST UINT32 *Buffer
3945 );
3946
3962UINT32
3963EFIAPI
3965 OUT UINT32 *Buffer,
3966 IN UINT32 Value
3967 );
3968
3982UINT64
3983EFIAPI
3985 IN CONST UINT64 *Buffer
3986 );
3987
4003UINT64
4004EFIAPI
4006 OUT UINT64 *Buffer,
4007 IN UINT64 Value
4008 );
4009
4010//
4011// Bit Field Functions
4012//
4013
4033UINT8
4034EFIAPI
4036 IN UINT8 Operand,
4037 IN UINTN StartBit,
4038 IN UINTN EndBit
4039 );
4040
4064UINT8
4065EFIAPI
4067 IN UINT8 Operand,
4068 IN UINTN StartBit,
4069 IN UINTN EndBit,
4070 IN UINT8 Value
4071 );
4072
4097UINT8
4098EFIAPI
4100 IN UINT8 Operand,
4101 IN UINTN StartBit,
4102 IN UINTN EndBit,
4103 IN UINT8 OrData
4104 );
4105
4130UINT8
4131EFIAPI
4133 IN UINT8 Operand,
4134 IN UINTN StartBit,
4135 IN UINTN EndBit,
4136 IN UINT8 AndData
4137 );
4138
4166UINT8
4167EFIAPI
4169 IN UINT8 Operand,
4170 IN UINTN StartBit,
4171 IN UINTN EndBit,
4172 IN UINT8 AndData,
4173 IN UINT8 OrData
4174 );
4175
4195UINT16
4196EFIAPI
4198 IN UINT16 Operand,
4199 IN UINTN StartBit,
4200 IN UINTN EndBit
4201 );
4202
4226UINT16
4227EFIAPI
4229 IN UINT16 Operand,
4230 IN UINTN StartBit,
4231 IN UINTN EndBit,
4232 IN UINT16 Value
4233 );
4234
4259UINT16
4260EFIAPI
4262 IN UINT16 Operand,
4263 IN UINTN StartBit,
4264 IN UINTN EndBit,
4265 IN UINT16 OrData
4266 );
4267
4292UINT16
4293EFIAPI
4295 IN UINT16 Operand,
4296 IN UINTN StartBit,
4297 IN UINTN EndBit,
4298 IN UINT16 AndData
4299 );
4300
4328UINT16
4329EFIAPI
4331 IN UINT16 Operand,
4332 IN UINTN StartBit,
4333 IN UINTN EndBit,
4334 IN UINT16 AndData,
4335 IN UINT16 OrData
4336 );
4337
4357UINT32
4358EFIAPI
4360 IN UINT32 Operand,
4361 IN UINTN StartBit,
4362 IN UINTN EndBit
4363 );
4364
4388UINT32
4389EFIAPI
4391 IN UINT32 Operand,
4392 IN UINTN StartBit,
4393 IN UINTN EndBit,
4394 IN UINT32 Value
4395 );
4396
4421UINT32
4422EFIAPI
4424 IN UINT32 Operand,
4425 IN UINTN StartBit,
4426 IN UINTN EndBit,
4427 IN UINT32 OrData
4428 );
4429
4454UINT32
4455EFIAPI
4457 IN UINT32 Operand,
4458 IN UINTN StartBit,
4459 IN UINTN EndBit,
4460 IN UINT32 AndData
4461 );
4462
4490UINT32
4491EFIAPI
4493 IN UINT32 Operand,
4494 IN UINTN StartBit,
4495 IN UINTN EndBit,
4496 IN UINT32 AndData,
4497 IN UINT32 OrData
4498 );
4499
4519UINT64
4520EFIAPI
4522 IN UINT64 Operand,
4523 IN UINTN StartBit,
4524 IN UINTN EndBit
4525 );
4526
4550UINT64
4551EFIAPI
4553 IN UINT64 Operand,
4554 IN UINTN StartBit,
4555 IN UINTN EndBit,
4556 IN UINT64 Value
4557 );
4558
4583UINT64
4584EFIAPI
4586 IN UINT64 Operand,
4587 IN UINTN StartBit,
4588 IN UINTN EndBit,
4589 IN UINT64 OrData
4590 );
4591
4616UINT64
4617EFIAPI
4619 IN UINT64 Operand,
4620 IN UINTN StartBit,
4621 IN UINTN EndBit,
4622 IN UINT64 AndData
4623 );
4624
4652UINT64
4653EFIAPI
4655 IN UINT64 Operand,
4656 IN UINTN StartBit,
4657 IN UINTN EndBit,
4658 IN UINT64 AndData,
4659 IN UINT64 OrData
4660 );
4661
4682UINT8
4683EFIAPI
4685 IN UINT32 Operand,
4686 IN UINTN StartBit,
4687 IN UINTN EndBit
4688 );
4689
4710UINT8
4711EFIAPI
4713 IN UINT64 Operand,
4714 IN UINTN StartBit,
4715 IN UINTN EndBit
4716 );
4717
4718//
4719// Base Library Checksum Functions
4720//
4721
4740UINT8
4741EFIAPI
4743 IN CONST UINT8 *Buffer,
4744 IN UINTN Length
4745 );
4746
4765UINT8
4766EFIAPI
4768 IN CONST UINT8 *Buffer,
4769 IN UINTN Length
4770 );
4771
4791UINT16
4792EFIAPI
4794 IN CONST UINT16 *Buffer,
4795 IN UINTN Length
4796 );
4797
4818UINT16
4819EFIAPI
4821 IN CONST UINT16 *Buffer,
4822 IN UINTN Length
4823 );
4824
4844UINT32
4845EFIAPI
4847 IN CONST UINT32 *Buffer,
4848 IN UINTN Length
4849 );
4850
4871UINT32
4872EFIAPI
4874 IN CONST UINT32 *Buffer,
4875 IN UINTN Length
4876 );
4877
4897UINT64
4898EFIAPI
4900 IN CONST UINT64 *Buffer,
4901 IN UINTN Length
4902 );
4903
4924UINT64
4925EFIAPI
4927 IN CONST UINT64 *Buffer,
4928 IN UINTN Length
4929 );
4930
4944UINT32
4945EFIAPI
4947 IN VOID *Buffer,
4948 IN UINTN Length
4949 );
4950
4960UINT16
4961EFIAPI
4963 IN CONST VOID *Buffer,
4964 IN UINTN Length,
4965 IN UINT16 InitialValue
4966 );
4967
4968//
4969// Initial value for the CRC16-ANSI algorithm, when no prior checksum has been calculated.
4970//
4971#define CRC16ANSI_INIT 0xffff
4972
4982UINT32
4983EFIAPI
4985 IN CONST VOID *Buffer,
4986 IN UINTN Length,
4987 IN UINT32 InitialValue
4988 );
4989
4999UINT16
5000EFIAPI
5002 IN CONST VOID *Buffer,
5003 IN UINTN Length,
5004 IN UINT16 InitialValue
5005 );
5006
5007//
5008// Base Library CPU Functions
5009//
5010
5017typedef
5018VOID
5019(EFIAPI *SWITCH_STACK_ENTRY_POINT)(
5020 IN VOID *Context1 OPTIONAL,
5021 IN VOID *Context2 OPTIONAL
5022 );
5023
5031VOID
5032EFIAPI
5034 VOID
5035 );
5036
5059UINTN
5060EFIAPI
5061SetJump (
5062 OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
5063 );
5064
5081VOID
5082EFIAPI
5083LongJump (
5084 IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
5085 IN UINTN Value
5086 );
5087
5092VOID
5093EFIAPI
5095 VOID
5096 );
5097
5102VOID
5103EFIAPI
5105 VOID
5106 );
5107
5116BOOLEAN
5117EFIAPI
5119 VOID
5120 );
5121
5127VOID
5128EFIAPI
5130 VOID
5131 );
5132
5143BOOLEAN
5144EFIAPI
5146 VOID
5147 );
5148
5163BOOLEAN
5164EFIAPI
5166 IN BOOLEAN InterruptState
5167 );
5168
5176VOID
5177EFIAPI
5178CpuPause (
5179 VOID
5180 );
5181
5211VOID
5212EFIAPI
5214 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
5215 IN VOID *Context1 OPTIONAL,
5216 IN VOID *Context2 OPTIONAL,
5217 IN VOID *NewStack,
5218 ...
5219 );
5220
5228VOID
5229EFIAPI
5231 VOID
5232 );
5233
5243VOID
5244EFIAPI
5246 VOID
5247 );
5248
5256VOID
5257EFIAPI
5259 VOID
5260 );
5261
5276UINTN
5277EFIAPI
5278TdCall (
5279 IN UINT64 Leaf,
5280 IN UINT64 Arg1,
5281 IN UINT64 Arg2,
5282 IN UINT64 Arg3,
5283 IN OUT VOID *Results
5284 );
5285
5301UINTN
5302EFIAPI
5303TdVmCall (
5304 IN UINT64 Leaf,
5305 IN UINT64 Arg1,
5306 IN UINT64 Arg2,
5307 IN UINT64 Arg3,
5308 IN UINT64 Arg4,
5309 IN OUT VOID *Results
5310 );
5311
5318BOOLEAN
5319EFIAPI
5321 VOID
5322 );
5323
5324#if defined (MDE_CPU_X64)
5325//
5326// The page size for the PVALIDATE instruction
5327//
5328typedef enum {
5329 PvalidatePageSize4K = 0,
5330 PvalidatePageSize2MB,
5331} PVALIDATE_PAGE_SIZE;
5332
5333//
5334// PVALIDATE Return Code.
5335//
5336#define PVALIDATE_RET_SUCCESS 0
5337#define PVALIDATE_RET_FAIL_INPUT 1
5338#define PVALIDATE_RET_SIZE_MISMATCH 6
5339
5340//
5341// The PVALIDATE instruction did not make any changes to the RMP entry.
5342//
5343#define PVALIDATE_RET_NO_RMPUPDATE 255
5344
5365UINT32
5366EFIAPI
5367AsmPvalidate (
5368 IN PVALIDATE_PAGE_SIZE PageSize,
5369 IN BOOLEAN Validate,
5370 IN PHYSICAL_ADDRESS Address
5371 );
5372
5373//
5374// RDX settings for RMPADJUST
5375//
5376#define RMPADJUST_VMPL_MAX 3
5377#define RMPADJUST_VMPL_MASK 0xFF
5378#define RMPADJUST_VMPL_SHIFT 0
5379#define RMPADJUST_PERMISSION_MASK_MASK 0xFF
5380#define RMPADJUST_PERMISSION_MASK_SHIFT 8
5381#define RMPADJUST_VMSA_PAGE_BIT BIT16
5382
5400UINT32
5401EFIAPI
5402AsmRmpAdjust (
5403 IN UINT64 Rax,
5404 IN UINT64 Rcx,
5405 IN UINT64 Rdx
5406 );
5407
5408#endif
5409
5410#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
5415typedef union {
5416 struct {
5417 UINT32 CF : 1;
5418 UINT32 Reserved_0 : 1;
5419 UINT32 PF : 1;
5420 UINT32 Reserved_1 : 1;
5421 UINT32 AF : 1;
5422 UINT32 Reserved_2 : 1;
5423 UINT32 ZF : 1;
5424 UINT32 SF : 1;
5425 UINT32 TF : 1;
5426 UINT32 IF : 1;
5427 UINT32 DF : 1;
5428 UINT32 OF : 1;
5429 UINT32 IOPL : 2;
5430 UINT32 NT : 1;
5431 UINT32 Reserved_3 : 1;
5432 } Bits;
5433 UINT16 Uint16;
5434} IA32_FLAGS16;
5435
5441typedef union {
5442 struct {
5443 UINT32 CF : 1;
5444 UINT32 Reserved_0 : 1;
5445 UINT32 PF : 1;
5446 UINT32 Reserved_1 : 1;
5447 UINT32 AF : 1;
5448 UINT32 Reserved_2 : 1;
5449 UINT32 ZF : 1;
5450 UINT32 SF : 1;
5451 UINT32 TF : 1;
5452 UINT32 IF : 1;
5453 UINT32 DF : 1;
5454 UINT32 OF : 1;
5455 UINT32 IOPL : 2;
5456 UINT32 NT : 1;
5457 UINT32 Reserved_3 : 1;
5458 UINT32 RF : 1;
5459 UINT32 VM : 1;
5460 UINT32 AC : 1;
5461 UINT32 VIF : 1;
5462 UINT32 VIP : 1;
5463 UINT32 ID : 1;
5464 UINT32 Reserved_4 : 10;
5465 } Bits;
5466 UINTN UintN;
5467} IA32_EFLAGS32;
5468
5474typedef union {
5475 struct {
5476 UINT32 PE : 1;
5477 UINT32 MP : 1;
5478 UINT32 EM : 1;
5479 UINT32 TS : 1;
5480 UINT32 ET : 1;
5481 UINT32 NE : 1;
5482 UINT32 Reserved_0 : 10;
5483 UINT32 WP : 1;
5484 UINT32 Reserved_1 : 1;
5485 UINT32 AM : 1;
5486 UINT32 Reserved_2 : 10;
5487 UINT32 NW : 1;
5488 UINT32 CD : 1;
5489 UINT32 PG : 1;
5490 } Bits;
5491 UINTN UintN;
5492} IA32_CR0;
5493
5499typedef union {
5500 struct {
5501 UINT32 VME : 1;
5502 UINT32 PVI : 1;
5503 UINT32 TSD : 1;
5504 UINT32 DE : 1;
5505 UINT32 PSE : 1;
5506 UINT32 PAE : 1;
5507 UINT32 MCE : 1;
5508 UINT32 PGE : 1;
5509 UINT32 PCE : 1;
5511 UINT32 OSFXSR : 1;
5513 UINT32 OSXMMEXCPT : 1;
5516 UINT32 UMIP : 1;
5517 UINT32 LA57 : 1;
5518 UINT32 VMXE : 1;
5519 UINT32 SMXE : 1;
5520 UINT32 Reserved_3 : 1;
5521 UINT32 FSGSBASE : 1;
5522 UINT32 PCIDE : 1;
5523 UINT32 OSXSAVE : 1;
5524 UINT32 Reserved_4 : 1;
5525 UINT32 SMEP : 1;
5526 UINT32 SMAP : 1;
5527 UINT32 PKE : 1;
5528 UINT32 Reserved_5 : 9;
5529 } Bits;
5530 UINTN UintN;
5531} IA32_CR4;
5532
5536typedef union {
5537 struct {
5538 UINT32 LimitLow : 16;
5539 UINT32 BaseLow : 16;
5540 UINT32 BaseMid : 8;
5541 UINT32 Type : 4;
5542 UINT32 S : 1;
5543 UINT32 DPL : 2;
5544 UINT32 P : 1;
5545 UINT32 LimitHigh : 4;
5546 UINT32 AVL : 1;
5547 UINT32 L : 1;
5548 UINT32 DB : 1;
5549 UINT32 G : 1;
5550 UINT32 BaseHigh : 8;
5551 } Bits;
5552 UINT64 Uint64;
5553} IA32_SEGMENT_DESCRIPTOR;
5554
5558 #pragma pack (1)
5559typedef struct {
5560 UINT16 Limit;
5561 UINTN Base;
5562} IA32_DESCRIPTOR;
5563 #pragma pack ()
5564
5565#define IA32_IDT_GATE_TYPE_TASK 0x85
5566#define IA32_IDT_GATE_TYPE_INTERRUPT_16 0x86
5567#define IA32_IDT_GATE_TYPE_TRAP_16 0x87
5568#define IA32_IDT_GATE_TYPE_INTERRUPT_32 0x8E
5569#define IA32_IDT_GATE_TYPE_TRAP_32 0x8F
5570
5571#define IA32_GDT_TYPE_TSS 0x9
5572#define IA32_GDT_ALIGNMENT 8
5573
5574 #if defined (MDE_CPU_IA32)
5578typedef union {
5579 struct {
5580 UINT32 OffsetLow : 16;
5581 UINT32 Selector : 16;
5582 UINT32 Reserved_0 : 8;
5583 UINT32 GateType : 8;
5584 UINT32 OffsetHigh : 16;
5585 } Bits;
5586 UINT64 Uint64;
5587} IA32_IDT_GATE_DESCRIPTOR;
5588
5589 #pragma pack (1)
5590//
5591// IA32 Task-State Segment Definition
5592//
5593typedef struct {
5594 UINT16 PreviousTaskLink;
5595 UINT16 Reserved_2;
5596 UINT32 ESP0;
5597 UINT16 SS0;
5598 UINT16 Reserved_10;
5599 UINT32 ESP1;
5600 UINT16 SS1;
5601 UINT16 Reserved_18;
5602 UINT32 ESP2;
5603 UINT16 SS2;
5604 UINT16 Reserved_26;
5605 UINT32 CR3;
5606 UINT32 EIP;
5607 UINT32 EFLAGS;
5608 UINT32 EAX;
5609 UINT32 ECX;
5610 UINT32 EDX;
5611 UINT32 EBX;
5612 UINT32 ESP;
5613 UINT32 EBP;
5614 UINT32 ESI;
5615 UINT32 EDI;
5616 UINT16 ES;
5617 UINT16 Reserved_74;
5618 UINT16 CS;
5619 UINT16 Reserved_78;
5620 UINT16 SS;
5621 UINT16 Reserved_82;
5622 UINT16 DS;
5623 UINT16 Reserved_86;
5624 UINT16 FS;
5625 UINT16 Reserved_90;
5626 UINT16 GS;
5627 UINT16 Reserved_94;
5628 UINT16 LDTSegmentSelector;
5629 UINT16 Reserved_98;
5630 UINT16 T;
5631 UINT16 IOMapBaseAddress;
5632} IA32_TASK_STATE_SEGMENT;
5633
5634typedef union {
5635 struct {
5636 UINT32 LimitLow : 16;
5637 UINT32 BaseLow : 16;
5638 UINT32 BaseMid : 8;
5639 UINT32 Type : 4;
5640 UINT32 Reserved_43 : 1;
5641 UINT32 DPL : 2;
5642 UINT32 P : 1;
5643 UINT32 LimitHigh : 4;
5644 UINT32 AVL : 1;
5645 UINT32 Reserved_52 : 2;
5646 UINT32 G : 1;
5647 UINT32 BaseHigh : 8;
5648 } Bits;
5649 UINT64 Uint64;
5650} IA32_TSS_DESCRIPTOR;
5651 #pragma pack ()
5652
5653 #endif // defined (MDE_CPU_IA32)
5654
5655 #if defined (MDE_CPU_X64)
5659typedef union {
5660 struct {
5661 UINT32 OffsetLow : 16;
5662 UINT32 Selector : 16;
5663 UINT32 Reserved_0 : 8;
5664 UINT32 GateType : 8;
5665 UINT32 OffsetHigh : 16;
5666 UINT32 OffsetUpper : 32;
5667 UINT32 Reserved_1 : 32;
5668 } Bits;
5669 struct {
5670 UINT64 Uint64;
5671 UINT64 Uint64_1;
5672 } Uint128;
5673} IA32_IDT_GATE_DESCRIPTOR;
5674
5675 #pragma pack (1)
5676//
5677// IA32 Task-State Segment Definition
5678//
5679typedef struct {
5680 UINT32 Reserved_0;
5681 UINT64 RSP0;
5682 UINT64 RSP1;
5683 UINT64 RSP2;
5684 UINT64 Reserved_28;
5685 UINT64 IST[7];
5686 UINT64 Reserved_92;
5687 UINT16 Reserved_100;
5688 UINT16 IOMapBaseAddress;
5689} IA32_TASK_STATE_SEGMENT;
5690
5691typedef union {
5692 struct {
5693 UINT32 LimitLow : 16;
5694 UINT32 BaseLow : 16;
5695 UINT32 BaseMidl : 8;
5696 UINT32 Type : 4;
5697 UINT32 Reserved_43 : 1;
5698 UINT32 DPL : 2;
5699 UINT32 P : 1;
5700 UINT32 LimitHigh : 4;
5701 UINT32 AVL : 1;
5702 UINT32 Reserved_52 : 2;
5703 UINT32 G : 1;
5704 UINT32 BaseMidh : 8;
5705 UINT32 BaseHigh : 32;
5706 UINT32 Reserved_96 : 32;
5707 } Bits;
5708 struct {
5709 UINT64 Uint64;
5710 UINT64 Uint64_1;
5711 } Uint128;
5712} IA32_TSS_DESCRIPTOR;
5713 #pragma pack ()
5714
5715 #endif // defined (MDE_CPU_X64)
5716
5720typedef struct {
5721 UINT8 Buffer[512];
5722} IA32_FX_BUFFER;
5723
5727typedef struct {
5728 UINT32 Reserved1;
5729 UINT32 Reserved2;
5730 UINT32 Reserved3;
5731 UINT32 Reserved4;
5732 UINT8 BL;
5733 UINT8 BH;
5734 UINT16 Reserved5;
5735 UINT8 DL;
5736 UINT8 DH;
5737 UINT16 Reserved6;
5738 UINT8 CL;
5739 UINT8 CH;
5740 UINT16 Reserved7;
5741 UINT8 AL;
5742 UINT8 AH;
5743 UINT16 Reserved8;
5744} IA32_BYTE_REGS;
5745
5746typedef struct {
5747 UINT16 DI;
5748 UINT16 Reserved1;
5749 UINT16 SI;
5750 UINT16 Reserved2;
5751 UINT16 BP;
5752 UINT16 Reserved3;
5753 UINT16 SP;
5754 UINT16 Reserved4;
5755 UINT16 BX;
5756 UINT16 Reserved5;
5757 UINT16 DX;
5758 UINT16 Reserved6;
5759 UINT16 CX;
5760 UINT16 Reserved7;
5761 UINT16 AX;
5762 UINT16 Reserved8;
5763} IA32_WORD_REGS;
5764
5765typedef struct {
5766 UINT32 EDI;
5767 UINT32 ESI;
5768 UINT32 EBP;
5769 UINT32 ESP;
5770 UINT32 EBX;
5771 UINT32 EDX;
5772 UINT32 ECX;
5773 UINT32 EAX;
5774 UINT16 DS;
5775 UINT16 ES;
5776 UINT16 FS;
5777 UINT16 GS;
5778 IA32_EFLAGS32 EFLAGS;
5779 UINT32 Eip;
5780 UINT16 CS;
5781 UINT16 SS;
5782} IA32_DWORD_REGS;
5783
5784typedef union {
5785 IA32_DWORD_REGS E;
5786 IA32_WORD_REGS X;
5787 IA32_BYTE_REGS H;
5788} IA32_REGISTER_SET;
5789
5793typedef struct {
5794 IA32_REGISTER_SET *RealModeState;
5795 VOID *RealModeBuffer;
5796 UINT32 RealModeBufferSize;
5797 UINT32 ThunkAttributes;
5798} THUNK_CONTEXT;
5799
5800#define THUNK_ATTRIBUTE_BIG_REAL_MODE 0x00000001
5801#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 0x00000002
5802#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL 0x00000004
5803
5816typedef VOID (X86_ASSEMBLY_PATCH_LABEL) (
5817 VOID
5818 );
5819
5845UINT32
5846EFIAPI
5847AsmCpuid (
5848 IN UINT32 Index,
5849 OUT UINT32 *Eax OPTIONAL,
5850 OUT UINT32 *Ebx OPTIONAL,
5851 OUT UINT32 *Ecx OPTIONAL,
5852 OUT UINT32 *Edx OPTIONAL
5853 );
5854
5887UINT32
5888EFIAPI
5889AsmCpuidEx (
5890 IN UINT32 Index,
5891 IN UINT32 SubIndex,
5892 OUT UINT32 *Eax OPTIONAL,
5893 OUT UINT32 *Ebx OPTIONAL,
5894 OUT UINT32 *Ecx OPTIONAL,
5895 OUT UINT32 *Edx OPTIONAL
5896 );
5897
5905VOID
5906EFIAPI
5908 VOID
5909 );
5910
5918VOID
5919EFIAPI
5921 VOID
5922 );
5923
5938UINT32
5939EFIAPI
5941 IN UINT32 Index
5942 );
5943
5961UINT32
5962EFIAPI
5964 IN UINT32 Index,
5965 IN UINT32 Value
5966 );
5967
5987UINT32
5988EFIAPI
5989AsmMsrOr32 (
5990 IN UINT32 Index,
5991 IN UINT32 OrData
5992 );
5993
6013UINT32
6014EFIAPI
6016 IN UINT32 Index,
6017 IN UINT32 AndData
6018 );
6019
6042UINT32
6043EFIAPI
6045 IN UINT32 Index,
6046 IN UINT32 AndData,
6047 IN UINT32 OrData
6048 );
6049
6072UINT32
6073EFIAPI
6075 IN UINT32 Index,
6076 IN UINTN StartBit,
6077 IN UINTN EndBit
6078 );
6079
6105UINT32
6106EFIAPI
6108 IN UINT32 Index,
6109 IN UINTN StartBit,
6110 IN UINTN EndBit,
6111 IN UINT32 Value
6112 );
6113
6141UINT32
6142EFIAPI
6144 IN UINT32 Index,
6145 IN UINTN StartBit,
6146 IN UINTN EndBit,
6147 IN UINT32 OrData
6148 );
6149
6177UINT32
6178EFIAPI
6180 IN UINT32 Index,
6181 IN UINTN StartBit,
6182 IN UINTN EndBit,
6183 IN UINT32 AndData
6184 );
6185
6217UINT32
6218EFIAPI
6220 IN UINT32 Index,
6221 IN UINTN StartBit,
6222 IN UINTN EndBit,
6223 IN UINT32 AndData,
6224 IN UINT32 OrData
6225 );
6226
6241UINT64
6242EFIAPI
6244 IN UINT32 Index
6245 );
6246
6264UINT64
6265EFIAPI
6267 IN UINT32 Index,
6268 IN UINT64 Value
6269 );
6270
6289UINT64
6290EFIAPI
6291AsmMsrOr64 (
6292 IN UINT32 Index,
6293 IN UINT64 OrData
6294 );
6295
6314UINT64
6315EFIAPI
6317 IN UINT32 Index,
6318 IN UINT64 AndData
6319 );
6320
6342UINT64
6343EFIAPI
6345 IN UINT32 Index,
6346 IN UINT64 AndData,
6347 IN UINT64 OrData
6348 );
6349
6372UINT64
6373EFIAPI
6375 IN UINT32 Index,
6376 IN UINTN StartBit,
6377 IN UINTN EndBit
6378 );
6379
6404UINT64
6405EFIAPI
6407 IN UINT32 Index,
6408 IN UINTN StartBit,
6409 IN UINTN EndBit,
6410 IN UINT64 Value
6411 );
6412
6440UINT64
6441EFIAPI
6443 IN UINT32 Index,
6444 IN UINTN StartBit,
6445 IN UINTN EndBit,
6446 IN UINT64 OrData
6447 );
6448
6476UINT64
6477EFIAPI
6479 IN UINT32 Index,
6480 IN UINTN StartBit,
6481 IN UINTN EndBit,
6482 IN UINT64 AndData
6483 );
6484
6515UINT64
6516EFIAPI
6518 IN UINT32 Index,
6519 IN UINTN StartBit,
6520 IN UINTN EndBit,
6521 IN UINT64 AndData,
6522 IN UINT64 OrData
6523 );
6524
6535UINTN
6536EFIAPI
6538 VOID
6539 );
6540
6551UINTN
6552EFIAPI
6553AsmReadCr0 (
6554 VOID
6555 );
6556
6567UINTN
6568EFIAPI
6569AsmReadCr2 (
6570 VOID
6571 );
6572
6583UINTN
6584EFIAPI
6585AsmReadCr3 (
6586 VOID
6587 );
6588
6599UINTN
6600EFIAPI
6601AsmReadCr4 (
6602 VOID
6603 );
6604
6616UINTN
6617EFIAPI
6619 UINTN Cr0
6620 );
6621
6633UINTN
6634EFIAPI
6636 UINTN Cr2
6637 );
6638
6650UINTN
6651EFIAPI
6653 UINTN Cr3
6654 );
6655
6667UINTN
6668EFIAPI
6670 UINTN Cr4
6671 );
6672
6683UINTN
6684EFIAPI
6685AsmReadDr0 (
6686 VOID
6687 );
6688
6699UINTN
6700EFIAPI
6701AsmReadDr1 (
6702 VOID
6703 );
6704
6715UINTN
6716EFIAPI
6717AsmReadDr2 (
6718 VOID
6719 );
6720
6731UINTN
6732EFIAPI
6733AsmReadDr3 (
6734 VOID
6735 );
6736
6747UINTN
6748EFIAPI
6749AsmReadDr4 (
6750 VOID
6751 );
6752
6763UINTN
6764EFIAPI
6765AsmReadDr5 (
6766 VOID
6767 );
6768
6779UINTN
6780EFIAPI
6781AsmReadDr6 (
6782 VOID
6783 );
6784
6795UINTN
6796EFIAPI
6797AsmReadDr7 (
6798 VOID
6799 );
6800
6812UINTN
6813EFIAPI
6815 UINTN Dr0
6816 );
6817
6829UINTN
6830EFIAPI
6832 UINTN Dr1
6833 );
6834
6846UINTN
6847EFIAPI
6849 UINTN Dr2
6850 );
6851
6863UINTN
6864EFIAPI
6866 UINTN Dr3
6867 );
6868
6880UINTN
6881EFIAPI
6883 UINTN Dr4
6884 );
6885
6897UINTN
6898EFIAPI
6900 UINTN Dr5
6901 );
6902
6914UINTN
6915EFIAPI
6917 UINTN Dr6
6918 );
6919
6931UINTN
6932EFIAPI
6934 UINTN Dr7
6935 );
6936
6946UINT16
6947EFIAPI
6948AsmReadCs (
6949 VOID
6950 );
6951
6961UINT16
6962EFIAPI
6963AsmReadDs (
6964 VOID
6965 );
6966
6976UINT16
6977EFIAPI
6978AsmReadEs (
6979 VOID
6980 );
6981
6991UINT16
6992EFIAPI
6993AsmReadFs (
6994 VOID
6995 );
6996
7006UINT16
7007EFIAPI
7008AsmReadGs (
7009 VOID
7010 );
7011
7021UINT16
7022EFIAPI
7023AsmReadSs (
7024 VOID
7025 );
7026
7036UINT16
7037EFIAPI
7038AsmReadTr (
7039 VOID
7040 );
7041
7053VOID
7054EFIAPI
7056 OUT IA32_DESCRIPTOR *Gdtr
7057 );
7058
7070VOID
7071EFIAPI
7073 IN CONST IA32_DESCRIPTOR *Gdtr
7074 );
7075
7087VOID
7088EFIAPI
7090 OUT IA32_DESCRIPTOR *Idtr
7091 );
7092
7104VOID
7105EFIAPI
7107 IN CONST IA32_DESCRIPTOR *Idtr
7108 );
7109
7119UINT16
7120EFIAPI
7122 VOID
7123 );
7124
7134VOID
7135EFIAPI
7137 IN UINT16 Ldtr
7138 );
7139
7153VOID
7154EFIAPI
7155AsmFxSave (
7156 OUT IA32_FX_BUFFER *Buffer
7157 );
7158
7173VOID
7174EFIAPI
7176 IN CONST IA32_FX_BUFFER *Buffer
7177 );
7178
7188UINT64
7189EFIAPI
7190AsmReadMm0 (
7191 VOID
7192 );
7193
7203UINT64
7204EFIAPI
7205AsmReadMm1 (
7206 VOID
7207 );
7208
7218UINT64
7219EFIAPI
7220AsmReadMm2 (
7221 VOID
7222 );
7223
7233UINT64
7234EFIAPI
7235AsmReadMm3 (
7236 VOID
7237 );
7238
7248UINT64
7249EFIAPI
7250AsmReadMm4 (
7251 VOID
7252 );
7253
7263UINT64
7264EFIAPI
7265AsmReadMm5 (
7266 VOID
7267 );
7268
7278UINT64
7279EFIAPI
7280AsmReadMm6 (
7281 VOID
7282 );
7283
7293UINT64
7294EFIAPI
7295AsmReadMm7 (
7296 VOID
7297 );
7298
7308VOID
7309EFIAPI
7311 IN UINT64 Value
7312 );
7313
7323VOID
7324EFIAPI
7326 IN UINT64 Value
7327 );
7328
7338VOID
7339EFIAPI
7341 IN UINT64 Value
7342 );
7343
7353VOID
7354EFIAPI
7356 IN UINT64 Value
7357 );
7358
7368VOID
7369EFIAPI
7371 IN UINT64 Value
7372 );
7373
7383VOID
7384EFIAPI
7386 IN UINT64 Value
7387 );
7388
7398VOID
7399EFIAPI
7401 IN UINT64 Value
7402 );
7403
7413VOID
7414EFIAPI
7416 IN UINT64 Value
7417 );
7418
7428UINT64
7429EFIAPI
7430AsmReadTsc (
7431 VOID
7432 );
7433
7445UINT64
7446EFIAPI
7447AsmReadPmc (
7448 IN UINT32 Index
7449 );
7450
7467UINTN
7468EFIAPI
7469AsmMonitor (
7470 IN UINTN Eax,
7471 IN UINTN Ecx,
7472 IN UINTN Edx
7473 );
7474
7489UINTN
7490EFIAPI
7491AsmMwait (
7492 IN UINTN Eax,
7493 IN UINTN Ecx
7494 );
7495
7503VOID
7504EFIAPI
7505AsmWbinvd (
7506 VOID
7507 );
7508
7516VOID
7517EFIAPI
7518AsmInvd (
7519 VOID
7520 );
7521
7537VOID *
7538EFIAPI
7540 IN VOID *LinearAddress
7541 );
7542
7580VOID
7581EFIAPI
7583 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
7584 IN VOID *Context1 OPTIONAL,
7585 IN VOID *Context2 OPTIONAL,
7586 IN VOID *NewStack
7587 );
7588
7623VOID
7624EFIAPI
7626 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
7627 IN VOID *Context1 OPTIONAL,
7628 IN VOID *Context2 OPTIONAL,
7629 IN VOID *NewStack
7630 );
7631
7664VOID
7665EFIAPI
7667 IN UINT16 Cs,
7668 IN UINT64 EntryPoint,
7669 IN UINT64 Context1 OPTIONAL,
7670 IN UINT64 Context2 OPTIONAL,
7671 IN UINT64 NewStack
7672 );
7673
7704VOID
7705EFIAPI
7707 IN UINT16 Cs,
7708 IN UINT32 EntryPoint,
7709 IN UINT32 Context1 OPTIONAL,
7710 IN UINT32 Context2 OPTIONAL,
7711 IN UINT32 NewStack
7712 );
7713
7714//
7715// 16-bit thunking services
7716//
7717
7739VOID
7740EFIAPI
7742 OUT UINT32 *RealModeBufferSize,
7743 OUT UINT32 *ExtraStackSize
7744 );
7745
7760VOID
7761EFIAPI
7763 IN OUT THUNK_CONTEXT *ThunkContext
7764 );
7765
7819VOID
7820EFIAPI
7821AsmThunk16 (
7822 IN OUT THUNK_CONTEXT *ThunkContext
7823 );
7824
7845VOID
7846EFIAPI
7848 IN OUT THUNK_CONTEXT *ThunkContext
7849 );
7850
7862BOOLEAN
7863EFIAPI
7865 OUT UINT16 *Rand
7866 );
7867
7879BOOLEAN
7880EFIAPI
7882 OUT UINT32 *Rand
7883 );
7884
7896BOOLEAN
7897EFIAPI
7899 OUT UINT64 *Rand
7900 );
7901
7907VOID
7908EFIAPI
7909AsmWriteTr (
7910 IN UINT16 Selector
7911 );
7912
7920VOID
7921EFIAPI
7922AsmLfence (
7923 VOID
7924 );
7925
7936UINT64
7937EFIAPI
7938AsmXGetBv (
7939 IN UINT32 Index
7940 );
7941
7959UINT64
7960EFIAPI
7961AsmXSetBv (
7962 IN UINT32 Index,
7963 IN UINT64 Value
7964 );
7965
7973VOID
7974EFIAPI
7975AsmVmgExit (
7976 VOID
7977 );
7978
7982typedef struct {
7983 VOID *Caa;
7984 UINT64 RaxIn;
7985 UINT64 RcxIn;
7986 UINT64 RdxIn;
7987 UINT64 R8In;
7988 UINT64 R9In;
7989 UINT64 RaxOut;
7990 UINT64 RcxOut;
7991 UINT64 RdxOut;
7992 UINT64 R8Out;
7993 UINT64 R9Out;
7994 UINT8 *CallPending;
7995} SVSM_CALL_DATA;
7996
8012UINT32
8013EFIAPI
8014AsmVmgExitSvsm (
8015 IN OUT SVSM_CALL_DATA *SvsmCallData
8016 );
8017
8052VOID
8053EFIAPI
8055 OUT X86_ASSEMBLY_PATCH_LABEL *InstructionEnd,
8056 IN UINT64 PatchValue,
8057 IN UINTN ValueSize
8058 );
8059
8060#endif // defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
8061#endif // !defined (__BASE_LIB__)
UINT64 UINTN
INT64 INTN
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:1696
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:311
INTN EFIAPI AsciiStriCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
Definition: String.c:814
UINT32 EFIAPI RRotU32(IN UINT32 Operand, IN UINTN Count)
Definition: RRotU32.c:29
UINT64 EFIAPI StrHexToUint64(IN CONST CHAR16 *String)
Definition: String.c:560
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:1677
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:1875
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:187
INTN(EFIAPI * BASE_SORT_COMPARE)(IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
Definition: BaseLib.h:3285
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
UINTN EFIAPI TdCall(IN UINT64 Leaf, IN UINT64 Arg1, IN UINT64 Arg2, IN UINT64 Arg3, IN OUT VOID *Results)
Definition: IntelTdxNull.c:31
RETURN_STATUS EFIAPI AsciiStrHexToUint64S(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:2527
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:600
INT64 EFIAPI DivS64x64Remainder(IN INT64 Dividend, IN INT64 Divisor, OUT INT64 *Remainder OPTIONAL)
UINT64 EFIAPI AsciiStrDecimalToUint64(IN CONST CHAR8 *String)
Definition: String.c:1053
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
Definition: String.c:641
UINT64 EFIAPI StrDecimalToUint64(IN CONST CHAR16 *String)
Definition: String.c:456
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:1964
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:107
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:716
UINTN EFIAPI StrnSizeS(IN CONST CHAR16 *String, IN UINTN MaxSize)
Definition: SafeString.c:176
VOID EFIAPI CpuDeadLoop(VOID)
Definition: CpuDeadLoop.c:25
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:33
INTN EFIAPI AsciiStrnCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString, IN UINTN Length)
Definition: String.c:872
RETURN_STATUS EFIAPI UnicodeStrToAsciiStrS(IN CONST CHAR16 *Source, OUT CHAR8 *Destination, IN UINTN DestMax)
Definition: SafeString.c:2650
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:71
RETURN_STATUS EFIAPI Base64Decode(IN CONST CHAR8 *Source OPTIONAL, IN UINTN SourceSize, OUT UINT8 *Destination OPTIONAL, IN OUT UINTN *DestinationSize)
Definition: String.c:1379
VOID EFIAPI EnableInterrupts(VOID)
Definition: CpuBreakpoint.c:67
UINTN EFIAPI AsciiStrDecimalToUintn(IN CONST CHAR8 *String)
Definition: String.c:1006
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:2179
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:508
RETURN_STATUS EFIAPI AsciiStrHexToUintnS(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT UINTN *Data)
Definition: SafeString.c:2399
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:1129
RETURN_STATUS EFIAPI StrToIpv4Address(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT IPv4_ADDRESS *Address, OUT UINT8 *PrefixLength OPTIONAL)
Definition: SafeString.c:1351
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:2287
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:3458
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:1500
RETURN_STATUS EFIAPI AsciiStrToIpv4Address(IN CONST CHAR8 *String, OUT CHAR8 **EndPointer OPTIONAL, OUT IPv4_ADDRESS *Address, OUT UINT8 *PrefixLength OPTIONAL)
Definition: SafeString.c:3313
CHAR16 *EFIAPI PathCleanUpDirectories(IN CHAR16 *Path)
Definition: FilePaths.c:68
UINT16 EFIAPI CalculateCheckSum16(IN CONST UINT16 *Buffer, IN UINTN Length)
Definition: CheckSum.c:151
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:1749
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:1615
UINT64 EFIAPI RRotU64(IN UINT64 Operand, IN UINTN Count)
Definition: RRotU64.c:29
UINTN EFIAPI AsciiStrHexToUintn(IN CONST CHAR8 *String)
Definition: String.c:1104
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:3095
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:1653
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:2873
UINT32 EFIAPI ReadUnaligned24(IN CONST UINT32 *Buffer)
Definition: Unaligned.c:89
UINT64 EFIAPI SwapBytes64(IN UINT64 Value)
Definition: SwapBytes64.c:25
UINT16 EFIAPI CalculateCrc16CcittF(IN CONST VOID *Buffer, IN UINTN Length, IN UINT16 InitialValue)
Definition: CheckSum.c:813
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:267
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:5019
RETURN_STATUS EFIAPI StrHexToUint64S(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT UINT64 *Data)
Definition: SafeString.c:994
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:681
UINT32 EFIAPI LRotU32(IN UINT32 Operand, IN UINTN Count)
Definition: LRotU32.c:29
UINT32 EFIAPI CalculateCrc32c(IN CONST VOID *Buffer, IN UINTN Length, IN UINT32 InitialValue)
Definition: CheckSum.c:747
UINT16 EFIAPI CalculateCrc16Ansi(IN CONST VOID *Buffer, IN UINTN Length, IN UINT16 InitialValue)
Definition: CheckSum.c:670
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:3569
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:231
RETURN_STATUS EFIAPI AsciiStrnCatS(IN OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source, IN UINTN Length)
Definition: SafeString.c:2060
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:2972
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:931
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:750
UINT64 EFIAPI AsciiStrHexToUint64(IN CONST CHAR8 *String)
Definition: String.c:1155
RETURN_STATUS EFIAPI UnicodeStrnToAsciiStrS(IN CONST CHAR16 *Source, IN UINTN Length, OUT CHAR8 *Destination, IN UINTN DestMax, OUT UINTN *DestinationLength)
Definition: SafeString.c:2757
RETURN_STATUS EFIAPI AsciiStrCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source)
Definition: SafeString.c:1797
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:1195
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
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
UINTN EFIAPI CsrRead(IN UINT16 Select)
Definition: Csr.c:37
UINTN EFIAPI CsrXChg(IN UINT16 Select, IN OUT UINTN Value, IN UINTN Mask)
Definition: Csr.c:75
UINTN EFIAPI CsrWrite(IN UINT16 Select, IN OUT UINTN Value)
Definition: Csr.c:55
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)
#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
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
BOOLEAN EFIAPI TdIsEnabled()
Definition: IntelTdxNull.c:79
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:39
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