]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/BaseLibInternals.h
Update the text to use "x64" instead of "X64" in MdePkg.
[mirror_edk2.git] / MdePkg / Library / BaseLib / BaseLibInternals.h
1 /** @file
2 Declaration of internal functions in BaseLib.
3
4 Copyright (c) 2006 - 2008, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __BASE_LIB_INTERNALS__
16 #define __BASE_LIB_INTERNALS__
17
18 #include <Base.h>
19 #include <Library/BaseLib.h>
20 #include <Library/BaseMemoryLib.h>
21 #include <Library/DebugLib.h>
22 #include <Library/TimerLib.h>
23 #include <Library/PcdLib.h>
24
25 //
26 // Math functions
27 //
28
29 /**
30 Shifts a 64-bit integer left between 0 and 63 bits. The low bits
31 are filled with zeros. The shifted value is returned.
32
33 This function shifts the 64-bit value Operand to the left by Count bits. The
34 low Count bits are set to zero. The shifted value is returned.
35
36 @param Operand The 64-bit operand to shift left.
37 @param Count The number of bits to shift left.
38
39 @return Operand << Count
40
41 **/
42 UINT64
43 EFIAPI
44 InternalMathLShiftU64 (
45 IN UINT64 Operand,
46 IN UINTN Count
47 );
48
49 /**
50 Shifts a 64-bit integer right between 0 and 63 bits. This high bits
51 are filled with zeros. The shifted value is returned.
52
53 This function shifts the 64-bit value Operand to the right by Count bits. The
54 high Count bits are set to zero. The shifted value is returned.
55
56 @param Operand The 64-bit operand to shift right.
57 @param Count The number of bits to shift right.
58
59 @return Operand >> Count
60
61 **/
62 UINT64
63 EFIAPI
64 InternalMathRShiftU64 (
65 IN UINT64 Operand,
66 IN UINTN Count
67 );
68
69 /**
70 Shifts a 64-bit integer right between 0 and 63 bits. The high bits
71 are filled with original integer's bit 63. The shifted value is returned.
72
73 This function shifts the 64-bit value Operand to the right by Count bits. The
74 high Count bits are set to bit 63 of Operand. The shifted value is returned.
75
76 @param Operand The 64-bit operand to shift right.
77 @param Count The number of bits to shift right.
78
79 @return Operand arithmetically shifted right by Count
80
81 **/
82 UINT64
83 EFIAPI
84 InternalMathARShiftU64 (
85 IN UINT64 Operand,
86 IN UINTN Count
87 );
88
89 /**
90 Rotates a 64-bit integer left between 0 and 63 bits, filling
91 the low bits with the high bits that were rotated.
92
93 This function rotates the 64-bit value Operand to the left by Count bits. The
94 low Count bits are fill with the high Count bits of Operand. The rotated
95 value is returned.
96
97 @param Operand The 64-bit operand to rotate left.
98 @param Count The number of bits to rotate left.
99
100 @return Operand <<< Count
101
102 **/
103 UINT64
104 EFIAPI
105 InternalMathLRotU64 (
106 IN UINT64 Operand,
107 IN UINTN Count
108 );
109
110 /**
111 Rotates a 64-bit integer right between 0 and 63 bits, filling
112 the high bits with the high low bits that were rotated.
113
114 This function rotates the 64-bit value Operand to the right by Count bits.
115 The high Count bits are fill with the low Count bits of Operand. The rotated
116 value is returned.
117
118 @param Operand The 64-bit operand to rotate right.
119 @param Count The number of bits to rotate right.
120
121 @return Operand >>> Count
122
123 **/
124 UINT64
125 EFIAPI
126 InternalMathRRotU64 (
127 IN UINT64 Operand,
128 IN UINTN Count
129 );
130
131 /**
132 Switches the endianess of a 64-bit integer.
133
134 This function swaps the bytes in a 64-bit unsigned value to switch the value
135 from little endian to big endian or vice versa. The byte swapped value is
136 returned.
137
138 @param Operand A 64-bit unsigned value.
139
140 @return The byte swapped Operand.
141
142 **/
143 UINT64
144 EFIAPI
145 InternalMathSwapBytes64 (
146 IN UINT64 Operand
147 );
148
149 /**
150 Multiples a 64-bit unsigned integer by a 32-bit unsigned integer
151 and generates a 64-bit unsigned result.
152
153 This function multiples the 64-bit unsigned value Multiplicand by the 32-bit
154 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
155 bit unsigned result is returned.
156
157 @param Multiplicand A 64-bit unsigned value.
158 @param Multiplier A 32-bit unsigned value.
159
160 @return Multiplicand * Multiplier
161
162 **/
163 UINT64
164 EFIAPI
165 InternalMathMultU64x32 (
166 IN UINT64 Multiplicand,
167 IN UINT32 Multiplier
168 );
169
170 /**
171 Multiples a 64-bit unsigned integer by a 64-bit unsigned integer
172 and generates a 64-bit unsigned result.
173
174 This function multiples the 64-bit unsigned value Multiplicand by the 64-bit
175 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
176 bit unsigned result is returned.
177
178 @param Multiplicand A 64-bit unsigned value.
179 @param Multiplier A 64-bit unsigned value.
180
181 @return Multiplicand * Multiplier
182
183 **/
184 UINT64
185 EFIAPI
186 InternalMathMultU64x64 (
187 IN UINT64 Multiplicand,
188 IN UINT64 Multiplier
189 );
190
191 /**
192 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
193 generates a 64-bit unsigned result.
194
195 This function divides the 64-bit unsigned value Dividend by the 32-bit
196 unsigned value Divisor and generates a 64-bit unsigned quotient. This
197 function returns the 64-bit unsigned quotient.
198
199 @param Dividend A 64-bit unsigned value.
200 @param Divisor A 32-bit unsigned value.
201
202 @return Dividend / Divisor
203
204 **/
205 UINT64
206 EFIAPI
207 InternalMathDivU64x32 (
208 IN UINT64 Dividend,
209 IN UINT32 Divisor
210 );
211
212 /**
213 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
214 generates a 32-bit unsigned remainder.
215
216 This function divides the 64-bit unsigned value Dividend by the 32-bit
217 unsigned value Divisor and generates a 32-bit remainder. This function
218 returns the 32-bit unsigned remainder.
219
220 @param Dividend A 64-bit unsigned value.
221 @param Divisor A 32-bit unsigned value.
222
223 @return Dividend % Divisor
224
225 **/
226 UINT32
227 EFIAPI
228 InternalMathModU64x32 (
229 IN UINT64 Dividend,
230 IN UINT32 Divisor
231 );
232
233 /**
234 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
235 generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.
236
237 This function divides the 64-bit unsigned value Dividend by the 32-bit
238 unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
239 is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
240 This function returns the 64-bit unsigned quotient.
241
242 @param Dividend A 64-bit unsigned value.
243 @param Divisor A 32-bit unsigned value.
244 @param Remainder A pointer to a 32-bit unsigned value. This parameter is
245 optional and may be NULL.
246
247 @return Dividend / Divisor
248
249 **/
250 UINT64
251 EFIAPI
252 InternalMathDivRemU64x32 (
253 IN UINT64 Dividend,
254 IN UINT32 Divisor,
255 OUT UINT32 *Remainder OPTIONAL
256 );
257
258 /**
259 Divides a 64-bit unsigned integer by a 64-bit unsigned integer and
260 generates a 64-bit unsigned result and an optional 64-bit unsigned remainder.
261
262 This function divides the 64-bit unsigned value Dividend by the 64-bit
263 unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
264 is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
265 This function returns the 64-bit unsigned quotient.
266
267 @param Dividend A 64-bit unsigned value.
268 @param Divisor A 64-bit unsigned value.
269 @param Remainder A pointer to a 64-bit unsigned value. This parameter is
270 optional and may be NULL.
271
272 @return Dividend / Divisor
273
274 **/
275 UINT64
276 EFIAPI
277 InternalMathDivRemU64x64 (
278 IN UINT64 Dividend,
279 IN UINT64 Divisor,
280 OUT UINT64 *Remainder OPTIONAL
281 );
282
283 /**
284 Divides a 64-bit signed integer by a 64-bit signed integer and
285 generates a 64-bit signed result and an optional 64-bit signed remainder.
286
287 This function divides the 64-bit signed value Dividend by the 64-bit
288 signed value Divisor and generates a 64-bit signed quotient. If Remainder
289 is not NULL, then the 64-bit signed remainder is returned in Remainder.
290 This function returns the 64-bit signed quotient.
291
292 @param Dividend A 64-bit signed value.
293 @param Divisor A 64-bit signed value.
294 @param Remainder A pointer to a 64-bit signed value. This parameter is
295 optional and may be NULL.
296
297 @return Dividend / Divisor
298
299 **/
300 INT64
301 EFIAPI
302 InternalMathDivRemS64x64 (
303 IN INT64 Dividend,
304 IN INT64 Divisor,
305 OUT INT64 *Remainder OPTIONAL
306 );
307
308 /**
309 Transfers control to a function starting with a new stack.
310
311 Transfers control to the function specified by EntryPoint using the
312 new stack specified by NewStack and passing in the parameters specified
313 by Context1 and Context2. Context1 and Context2 are optional and may
314 be NULL. The function EntryPoint must never return.
315 Marker will be ignored on IA-32, x64, and EBC.
316 IPF CPUs expect one additional parameter of type VOID * that specifies
317 the new backing store pointer.
318
319 If EntryPoint is NULL, then ASSERT().
320 If NewStack is NULL, then ASSERT().
321
322 @param EntryPoint A pointer to function to call with the new stack.
323 @param Context1 A pointer to the context to pass into the EntryPoint
324 function.
325 @param Context2 A pointer to the context to pass into the EntryPoint
326 function.
327 @param NewStack A pointer to the new stack to use for the EntryPoint
328 function.
329 @param Marker VA_LIST marker for the variable argument list.
330
331 **/
332 VOID
333 EFIAPI
334 InternalSwitchStack (
335 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
336 IN VOID *Context1, OPTIONAL
337 IN VOID *Context2, OPTIONAL
338 IN VOID *NewStack,
339 IN VA_LIST Marker
340 );
341
342
343 /**
344 Worker function that locates the Node in the List.
345
346 By searching the List, finds the location of the Node in List. At the same time,
347 verifies the validity of this list.
348
349 If List is NULL, then ASSERT().
350 If List->ForwardLink is NULL, then ASSERT().
351 If List->backLink is NULL, then ASSERT().
352 If Node is NULL, then ASSERT();
353 If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
354 of nodes in ListHead, including the ListHead node, is greater than or
355 equal to PcdMaximumLinkedListLength, then ASSERT().
356
357 @param List A pointer to a node in a linked list.
358 @param Node A pointer to one nod.
359
360 @retval TRUE Node is in List
361 @retval FALSE Node isn't in List, or List is invalid
362
363 **/
364 BOOLEAN
365 EFIAPI
366 IsNodeInList (
367 IN CONST LIST_ENTRY *List,
368 IN CONST LIST_ENTRY *Node
369 );
370
371
372 /**
373 Performs an atomic increment of an 32-bit unsigned integer.
374
375 Performs an atomic increment of the 32-bit unsigned integer specified by
376 Value and returns the incremented value. The increment operation must be
377 performed using MP safe mechanisms. The state of the return value is not
378 guaranteed to be MP safe.
379
380 @param Value A pointer to the 32-bit value to increment.
381
382 @return The incremented value.
383
384 **/
385 UINT32
386 EFIAPI
387 InternalSyncIncrement (
388 IN volatile UINT32 *Value
389 );
390
391
392 /**
393 Performs an atomic decrement of an 32-bit unsigned integer.
394
395 Performs an atomic decrement of the 32-bit unsigned integer specified by
396 Value and returns the decrement value. The decrement operation must be
397 performed using MP safe mechanisms. The state of the return value is not
398 guaranteed to be MP safe.
399
400 @param Value A pointer to the 32-bit value to decrement.
401
402 @return The decrement value.
403
404 **/
405 UINT32
406 EFIAPI
407 InternalSyncDecrement (
408 IN volatile UINT32 *Value
409 );
410
411
412 /**
413 Performs an atomic compare exchange operation on a 32-bit unsigned integer.
414
415 Performs an atomic compare exchange operation on the 32-bit unsigned integer
416 specified by Value. If Value is equal to CompareValue, then Value is set to
417 ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
418 then Value is returned. The compare exchange operation must be performed using
419 MP safe mechanisms.
420
421 @param Value A pointer to the 32-bit value for the compare exchange
422 operation.
423 @param CompareValue 32-bit value used in compare operation.
424 @param ExchangeValue 32-bit value used in exchange operation.
425
426 @return The original *Value before exchange.
427
428 **/
429 UINT32
430 EFIAPI
431 InternalSyncCompareExchange32 (
432 IN volatile UINT32 *Value,
433 IN UINT32 CompareValue,
434 IN UINT32 ExchangeValue
435 );
436
437
438 /**
439 Performs an atomic compare exchange operation on a 64-bit unsigned integer.
440
441 Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
442 by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
443 CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
444 The compare exchange operation must be performed using MP safe mechanisms.
445
446 @param Value A pointer to the 64-bit value for the compare exchange
447 operation.
448 @param CompareValue 64-bit value used in compare operation.
449 @param ExchangeValue 64-bit value used in exchange operation.
450
451 @return The original *Value before exchange.
452
453 **/
454 UINT64
455 EFIAPI
456 InternalSyncCompareExchange64 (
457 IN volatile UINT64 *Value,
458 IN UINT64 CompareValue,
459 IN UINT64 ExchangeValue
460 );
461
462
463 /**
464 Worker function that returns a bit field from Operand.
465
466 Returns the bitfield specified by the StartBit and the EndBit from Operand.
467
468 @param Operand Operand on which to perform the bitfield operation.
469 @param StartBit The ordinal of the least significant bit in the bit field.
470 @param EndBit The ordinal of the most significant bit in the bit field.
471
472 @return The bit field read.
473
474 **/
475 UINTN
476 EFIAPI
477 BitFieldReadUint (
478 IN UINTN Operand,
479 IN UINTN StartBit,
480 IN UINTN EndBit
481 );
482
483
484 /**
485 Worker function that reads a bit field from Operand, performs a bitwise OR,
486 and returns the result.
487
488 Performs a bitwise OR between the bit field specified by StartBit and EndBit
489 in Operand and the value specified by AndData. All other bits in Operand are
490 preserved. The new value is returned.
491
492 @param Operand Operand on which to perform the bitfield operation.
493 @param StartBit The ordinal of the least significant bit in the bit field.
494 @param EndBit The ordinal of the most significant bit in the bit field.
495 @param OrData The value to OR with the read value from the value
496
497 @return The new value.
498
499 **/
500 UINTN
501 EFIAPI
502 BitFieldOrUint (
503 IN UINTN Operand,
504 IN UINTN StartBit,
505 IN UINTN EndBit,
506 IN UINTN OrData
507 );
508
509
510 /**
511 Worker function that reads a bit field from Operand, performs a bitwise AND,
512 and returns the result.
513
514 Performs a bitwise AND between the bit field specified by StartBit and EndBit
515 in Operand and the value specified by AndData. All other bits in Operand are
516 preserved. The new value is returned.
517
518 @param Operand Operand on which to perform the bitfield operation.
519 @param StartBit The ordinal of the least significant bit in the bit field.
520 @param EndBit The ordinal of the most significant bit in the bit field.
521 @param AndData The value to And with the read value from the value
522
523 @return The new value.
524
525 **/
526 UINTN
527 EFIAPI
528 BitFieldAndUint (
529 IN UINTN Operand,
530 IN UINTN StartBit,
531 IN UINTN EndBit,
532 IN UINTN AndData
533 );
534
535
536 /**
537 Worker function that checks ASSERT condition for JumpBuffer
538
539 Checks ASSERT condition for JumpBuffer.
540
541 If JumpBuffer is NULL, then ASSERT().
542 For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
543
544 @param JumpBuffer A pointer to CPU context buffer.
545
546 **/
547 VOID
548 EFIAPI
549 InternalAssertJumpBuffer (
550 IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
551 );
552
553
554 /**
555 Restores the CPU context that was saved with SetJump().
556
557 Restores the CPU context from the buffer specified by JumpBuffer.
558 This function never returns to the caller.
559 Instead is resumes execution based on the state of JumpBuffer.
560
561 @param JumpBuffer A pointer to CPU context buffer.
562 @param Value The value to return when the SetJump() context is restored.
563
564 **/
565 VOID
566 EFIAPI
567 InternalLongJump (
568 IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
569 IN UINTN Value
570 );
571
572
573 //
574 // Ia32 and x64 specific functions
575 //
576 #if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
577
578 /**
579 Reads the current Global Descriptor Table Register(GDTR) descriptor.
580
581 Reads and returns the current GDTR descriptor and returns it in Gdtr. This
582 function is only available on IA-32 and x64.
583
584 @param Gdtr Pointer to a GDTR descriptor.
585
586 **/
587 VOID
588 EFIAPI
589 InternalX86ReadGdtr (
590 OUT IA32_DESCRIPTOR *Gdtr
591 );
592
593 /**
594 Writes the current Global Descriptor Table Register (GDTR) descriptor.
595
596 Writes and the current GDTR descriptor specified by Gdtr. This function is
597 only available on IA-32 and x64.
598
599 @param Gdtr Pointer to a GDTR descriptor.
600
601 **/
602 VOID
603 EFIAPI
604 InternalX86WriteGdtr (
605 IN CONST IA32_DESCRIPTOR *Gdtr
606 );
607
608 /**
609 Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
610
611 Reads and returns the current IDTR descriptor and returns it in Idtr. This
612 function is only available on IA-32 and x64.
613
614 @param Idtr Pointer to a IDTR descriptor.
615
616 **/
617 VOID
618 EFIAPI
619 InternalX86ReadIdtr (
620 OUT IA32_DESCRIPTOR *Idtr
621 );
622
623 /**
624 Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
625
626 Writes the current IDTR descriptor and returns it in Idtr. This function is
627 only available on IA-32 and x64.
628
629 @param Idtr Pointer to a IDTR descriptor.
630
631 **/
632 VOID
633 EFIAPI
634 InternalX86WriteIdtr (
635 IN CONST IA32_DESCRIPTOR *Idtr
636 );
637
638 /**
639 Save the current floating point/SSE/SSE2 context to a buffer.
640
641 Saves the current floating point/SSE/SSE2 state to the buffer specified by
642 Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
643 available on IA-32 and x64.
644
645 @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
646
647 **/
648 VOID
649 EFIAPI
650 InternalX86FxSave (
651 OUT IA32_FX_BUFFER *Buffer
652 );
653
654 /**
655 Restores the current floating point/SSE/SSE2 context from a buffer.
656
657 Restores the current floating point/SSE/SSE2 state from the buffer specified
658 by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
659 only available on IA-32 and x64.
660
661 @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
662
663 **/
664 VOID
665 EFIAPI
666 InternalX86FxRestore (
667 IN CONST IA32_FX_BUFFER *Buffer
668 );
669
670 /**
671 Enables the 32-bit paging mode on the CPU.
672
673 Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
674 must be properly initialized prior to calling this service. This function
675 assumes the current execution mode is 32-bit protected mode. This function is
676 only available on IA-32. After the 32-bit paging mode is enabled, control is
677 transferred to the function specified by EntryPoint using the new stack
678 specified by NewStack and passing in the parameters specified by Context1 and
679 Context2. Context1 and Context2 are optional and may be NULL. The function
680 EntryPoint must never return.
681
682 There are a number of constraints that must be followed before calling this
683 function:
684 1) Interrupts must be disabled.
685 2) The caller must be in 32-bit protected mode with flat descriptors. This
686 means all descriptors must have a base of 0 and a limit of 4GB.
687 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
688 descriptors.
689 4) CR3 must point to valid page tables that will be used once the transition
690 is complete, and those page tables must guarantee that the pages for this
691 function and the stack are identity mapped.
692
693 @param EntryPoint A pointer to function to call with the new stack after
694 paging is enabled.
695 @param Context1 A pointer to the context to pass into the EntryPoint
696 function as the first parameter after paging is enabled.
697 @param Context2 A pointer to the context to pass into the EntryPoint
698 function as the second parameter after paging is enabled.
699 @param NewStack A pointer to the new stack to use for the EntryPoint
700 function after paging is enabled.
701
702 **/
703 VOID
704 EFIAPI
705 InternalX86EnablePaging32 (
706 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
707 IN VOID *Context1, OPTIONAL
708 IN VOID *Context2, OPTIONAL
709 IN VOID *NewStack
710 );
711
712 /**
713 Disables the 32-bit paging mode on the CPU.
714
715 Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
716 mode. This function assumes the current execution mode is 32-paged protected
717 mode. This function is only available on IA-32. After the 32-bit paging mode
718 is disabled, control is transferred to the function specified by EntryPoint
719 using the new stack specified by NewStack and passing in the parameters
720 specified by Context1 and Context2. Context1 and Context2 are optional and
721 may be NULL. The function EntryPoint must never return.
722
723 There are a number of constraints that must be followed before calling this
724 function:
725 1) Interrupts must be disabled.
726 2) The caller must be in 32-bit paged mode.
727 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
728 4) CR3 must point to valid page tables that guarantee that the pages for
729 this function and the stack are identity mapped.
730
731 @param EntryPoint A pointer to function to call with the new stack after
732 paging is disabled.
733 @param Context1 A pointer to the context to pass into the EntryPoint
734 function as the first parameter after paging is disabled.
735 @param Context2 A pointer to the context to pass into the EntryPoint
736 function as the second parameter after paging is
737 disabled.
738 @param NewStack A pointer to the new stack to use for the EntryPoint
739 function after paging is disabled.
740
741 **/
742 VOID
743 EFIAPI
744 InternalX86DisablePaging32 (
745 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
746 IN VOID *Context1, OPTIONAL
747 IN VOID *Context2, OPTIONAL
748 IN VOID *NewStack
749 );
750
751 /**
752 Enables the 64-bit paging mode on the CPU.
753
754 Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
755 must be properly initialized prior to calling this service. This function
756 assumes the current execution mode is 32-bit protected mode with flat
757 descriptors. This function is only available on IA-32. After the 64-bit
758 paging mode is enabled, control is transferred to the function specified by
759 EntryPoint using the new stack specified by NewStack and passing in the
760 parameters specified by Context1 and Context2. Context1 and Context2 are
761 optional and may be 0. The function EntryPoint must never return.
762
763 @param Cs The 16-bit selector to load in the CS before EntryPoint
764 is called. The descriptor in the GDT that this selector
765 references must be setup for long mode.
766 @param EntryPoint The 64-bit virtual address of the function to call with
767 the new stack after paging is enabled.
768 @param Context1 The 64-bit virtual address of the context to pass into
769 the EntryPoint function as the first parameter after
770 paging is enabled.
771 @param Context2 The 64-bit virtual address of the context to pass into
772 the EntryPoint function as the second parameter after
773 paging is enabled.
774 @param NewStack The 64-bit virtual address of the new stack to use for
775 the EntryPoint function after paging is enabled.
776
777 **/
778 VOID
779 EFIAPI
780 InternalX86EnablePaging64 (
781 IN UINT16 Cs,
782 IN UINT64 EntryPoint,
783 IN UINT64 Context1, OPTIONAL
784 IN UINT64 Context2, OPTIONAL
785 IN UINT64 NewStack
786 );
787
788 /**
789 Disables the 64-bit paging mode on the CPU.
790
791 Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
792 mode. This function assumes the current execution mode is 64-paging mode.
793 This function is only available on x64. After the 64-bit paging mode is
794 disabled, control is transferred to the function specified by EntryPoint
795 using the new stack specified by NewStack and passing in the parameters
796 specified by Context1 and Context2. Context1 and Context2 are optional and
797 may be 0. The function EntryPoint must never return.
798
799 @param Cs The 16-bit selector to load in the CS before EntryPoint
800 is called. The descriptor in the GDT that this selector
801 references must be setup for 32-bit protected mode.
802 @param EntryPoint The 64-bit virtual address of the function to call with
803 the new stack after paging is disabled.
804 @param Context1 The 64-bit virtual address of the context to pass into
805 the EntryPoint function as the first parameter after
806 paging is disabled.
807 @param Context2 The 64-bit virtual address of the context to pass into
808 the EntryPoint function as the second parameter after
809 paging is disabled.
810 @param NewStack The 64-bit virtual address of the new stack to use for
811 the EntryPoint function after paging is disabled.
812
813 **/
814 VOID
815 EFIAPI
816 InternalX86DisablePaging64 (
817 IN UINT16 Cs,
818 IN UINT32 EntryPoint,
819 IN UINT32 Context1, OPTIONAL
820 IN UINT32 Context2, OPTIONAL
821 IN UINT32 NewStack
822 );
823
824
825 #elif defined (MDE_CPU_IPF)
826 //
827 //
828 // IPF specific functions
829 //
830
831 //
832 // Structure definition for look up table.
833 //
834 typedef struct {
835 UINT64 Index;
836 UINT64 (*Function) (VOID);
837 } REGISTER_ENTRY;
838
839
840 /**
841 Reads control register DCR.
842
843 This is a worker function for AsmReadControlRegister()
844 when its parameter Index is IPF_CONTROL_REGISTER_DCR
845
846 @return The 64-bit control register DCR.
847
848 **/
849 UINT64
850 EFIAPI
851 AsmReadControlRegisterDcr (
852 VOID
853 );
854
855
856 /**
857 Reads control register ITM.
858
859 This is a worker function for AsmReadControlRegister()
860 when its parameter Index is IPF_CONTROL_REGISTER_ITM
861
862 @return The 64-bit control register ITM.
863
864 **/
865 UINT64
866 EFIAPI
867 AsmReadControlRegisterItm (
868 VOID
869 );
870
871
872 /**
873 Reads control register IVA.
874
875 This is a worker function for AsmReadControlRegister()
876 when its parameter Index is IPF_CONTROL_REGISTER_IVA
877
878 @return The 64-bit control register IVA.
879
880 **/
881 UINT64
882 EFIAPI
883 AsmReadControlRegisterIva (
884 VOID
885 );
886
887
888 /**
889 Reads control register PTA.
890
891 This is a worker function for AsmReadControlRegister()
892 when its parameter Index is IPF_CONTROL_REGISTER_PTA
893
894 @return The 64-bit control register PTA.
895
896 **/
897 UINT64
898 EFIAPI
899 AsmReadControlRegisterPta (
900 VOID
901 );
902
903
904 /**
905 Reads control register IPSR.
906
907 This is a worker function for AsmReadControlRegister()
908 when its parameter Index is IPF_CONTROL_REGISTER_IPSR
909
910 @return The 64-bit control register IPSR.
911
912 **/
913 UINT64
914 EFIAPI
915 AsmReadControlRegisterIpsr (
916 VOID
917 );
918
919
920 /**
921 Reads control register ISR.
922
923 This is a worker function for AsmReadControlRegister()
924 when its parameter Index is IPF_CONTROL_REGISTER_ISR
925
926 @return The 64-bit control register ISR.
927
928 **/
929 UINT64
930 EFIAPI
931 AsmReadControlRegisterIsr (
932 VOID
933 );
934
935
936 /**
937 Reads control register IIP.
938
939 This is a worker function for AsmReadControlRegister()
940 when its parameter Index is IPF_CONTROL_REGISTER_IIP
941
942 @return The 64-bit control register IIP.
943
944 **/
945 UINT64
946 EFIAPI
947 AsmReadControlRegisterIip (
948 VOID
949 );
950
951
952 /**
953 Reads control register IFA.
954
955 This is a worker function for AsmReadControlRegister()
956 when its parameter Index is IPF_CONTROL_REGISTER_IFA
957
958 @return The 64-bit control register IFA.
959
960 **/
961 UINT64
962 EFIAPI
963 AsmReadControlRegisterIfa (
964 VOID
965 );
966
967
968 /**
969 Reads control register ITIR.
970
971 This is a worker function for AsmReadControlRegister()
972 when its parameter Index is IPF_CONTROL_REGISTER_ITIR
973
974 @return The 64-bit control register ITIR.
975
976 **/
977 UINT64
978 EFIAPI
979 AsmReadControlRegisterItir (
980 VOID
981 );
982
983
984 /**
985 Reads control register IIPA.
986
987 This is a worker function for AsmReadControlRegister()
988 when its parameter Index is IPF_CONTROL_REGISTER_IIPA
989
990 @return The 64-bit control register IIPA.
991
992 **/
993 UINT64
994 EFIAPI
995 AsmReadControlRegisterIipa (
996 VOID
997 );
998
999
1000 /**
1001 Reads control register IFS.
1002
1003 This is a worker function for AsmReadControlRegister()
1004 when its parameter Index is IPF_CONTROL_REGISTER_IFS
1005
1006 @return The 64-bit control register IFS.
1007
1008 **/
1009 UINT64
1010 EFIAPI
1011 AsmReadControlRegisterIfs (
1012 VOID
1013 );
1014
1015
1016 /**
1017 Reads control register IIM.
1018
1019 This is a worker function for AsmReadControlRegister()
1020 when its parameter Index is IPF_CONTROL_REGISTER_IIM
1021
1022 @return The 64-bit control register IIM.
1023
1024 **/
1025 UINT64
1026 EFIAPI
1027 AsmReadControlRegisterIim (
1028 VOID
1029 );
1030
1031
1032 /**
1033 Reads control register IHA.
1034
1035 This is a worker function for AsmReadControlRegister()
1036 when its parameter Index is IPF_CONTROL_REGISTER_IHA
1037
1038 @return The 64-bit control register IHA.
1039
1040 **/
1041 UINT64
1042 EFIAPI
1043 AsmReadControlRegisterIha (
1044 VOID
1045 );
1046
1047
1048 /**
1049 Reads control register LID.
1050
1051 This is a worker function for AsmReadControlRegister()
1052 when its parameter Index is IPF_CONTROL_REGISTER_LID
1053
1054 @return The 64-bit control register LID.
1055
1056 **/
1057 UINT64
1058 EFIAPI
1059 AsmReadControlRegisterLid (
1060 VOID
1061 );
1062
1063
1064 /**
1065 Reads control register IVR.
1066
1067 This is a worker function for AsmReadControlRegister()
1068 when its parameter Index is IPF_CONTROL_REGISTER_IVR
1069
1070 @return The 64-bit control register IVR.
1071
1072 **/
1073 UINT64
1074 EFIAPI
1075 AsmReadControlRegisterIvr (
1076 VOID
1077 );
1078
1079
1080 /**
1081 Reads control register TPR.
1082
1083 This is a worker function for AsmReadControlRegister()
1084 when its parameter Index is IPF_CONTROL_REGISTER_TPR
1085
1086 @return The 64-bit control register TPR.
1087
1088 **/
1089 UINT64
1090 EFIAPI
1091 AsmReadControlRegisterTpr (
1092 VOID
1093 );
1094
1095
1096 /**
1097 Reads control register EOI.
1098
1099 This is a worker function for AsmReadControlRegister()
1100 when its parameter Index is IPF_CONTROL_REGISTER_EOI
1101
1102 @return The 64-bit control register EOI.
1103
1104 **/
1105 UINT64
1106 EFIAPI
1107 AsmReadControlRegisterEoi (
1108 VOID
1109 );
1110
1111
1112 /**
1113 Reads control register IRR0.
1114
1115 This is a worker function for AsmReadControlRegister()
1116 when its parameter Index is IPF_CONTROL_REGISTER_IRR0
1117
1118 @return The 64-bit control register IRR0.
1119
1120 **/
1121 UINT64
1122 EFIAPI
1123 AsmReadControlRegisterIrr0 (
1124 VOID
1125 );
1126
1127
1128 /**
1129 Reads control register IRR1.
1130
1131 This is a worker function for AsmReadControlRegister()
1132 when its parameter Index is IPF_CONTROL_REGISTER_IRR1
1133
1134 @return The 64-bit control register IRR1.
1135
1136 **/
1137 UINT64
1138 EFIAPI
1139 AsmReadControlRegisterIrr1 (
1140 VOID
1141 );
1142
1143
1144 /**
1145 Reads control register IRR2.
1146
1147 This is a worker function for AsmReadControlRegister()
1148 when its parameter Index is IPF_CONTROL_REGISTER_IRR2
1149
1150 @return The 64-bit control register IRR2.
1151
1152 **/
1153 UINT64
1154 EFIAPI
1155 AsmReadControlRegisterIrr2 (
1156 VOID
1157 );
1158
1159
1160 /**
1161 Reads control register IRR3.
1162
1163 This is a worker function for AsmReadControlRegister()
1164 when its parameter Index is IPF_CONTROL_REGISTER_IRR3
1165
1166 @return The 64-bit control register IRR3.
1167
1168 **/
1169 UINT64
1170 EFIAPI
1171 AsmReadControlRegisterIrr3 (
1172 VOID
1173 );
1174
1175
1176 /**
1177 Reads control register ITV.
1178
1179 This is a worker function for AsmReadControlRegister()
1180 when its parameter Index is IPF_CONTROL_REGISTER_ITV
1181
1182 @return The 64-bit control register ITV.
1183
1184 **/
1185 UINT64
1186 EFIAPI
1187 AsmReadControlRegisterItv (
1188 VOID
1189 );
1190
1191
1192 /**
1193 Reads control register PMV.
1194
1195 This is a worker function for AsmReadControlRegister()
1196 when its parameter Index is IPF_CONTROL_REGISTER_PMV
1197
1198 @return The 64-bit control register PMV.
1199
1200 **/
1201 UINT64
1202 EFIAPI
1203 AsmReadControlRegisterPmv (
1204 VOID
1205 );
1206
1207
1208 /**
1209 Reads control register CMCV.
1210
1211 This is a worker function for AsmReadControlRegister()
1212 when its parameter Index is IPF_CONTROL_REGISTER_CMCV
1213
1214 @return The 64-bit control register CMCV.
1215
1216 **/
1217 UINT64
1218 EFIAPI
1219 AsmReadControlRegisterCmcv (
1220 VOID
1221 );
1222
1223
1224 /**
1225 Reads control register LRR0.
1226
1227 This is a worker function for AsmReadControlRegister()
1228 when its parameter Index is IPF_CONTROL_REGISTER_LRR0
1229
1230 @return The 64-bit control register LRR0.
1231
1232 **/
1233 UINT64
1234 EFIAPI
1235 AsmReadControlRegisterLrr0 (
1236 VOID
1237 );
1238
1239
1240 /**
1241 Reads control register LRR1.
1242
1243 This is a worker function for AsmReadControlRegister()
1244 when its parameter Index is IPF_CONTROL_REGISTER_LRR1
1245
1246 @return The 64-bit control register LRR1.
1247
1248 **/
1249 UINT64
1250 EFIAPI
1251 AsmReadControlRegisterLrr1 (
1252 VOID
1253 );
1254
1255
1256 /**
1257 Reads application register K0.
1258
1259 This is a worker function for AsmReadApplicationRegister()
1260 when its parameter Index is IPF_APPLICATION_REGISTER_K0
1261
1262 @return The 64-bit application register K0.
1263
1264 **/
1265 UINT64
1266 EFIAPI
1267 AsmReadApplicationRegisterK0 (
1268 VOID
1269 );
1270
1271
1272
1273 /**
1274 Reads application register K1.
1275
1276 This is a worker function for AsmReadApplicationRegister()
1277 when its parameter Index is IPF_APPLICATION_REGISTER_K1
1278
1279 @return The 64-bit application register K1.
1280
1281 **/
1282 UINT64
1283 EFIAPI
1284 AsmReadApplicationRegisterK1 (
1285 VOID
1286 );
1287
1288
1289 /**
1290 Reads application register K2.
1291
1292 This is a worker function for AsmReadApplicationRegister()
1293 when its parameter Index is IPF_APPLICATION_REGISTER_K2
1294
1295 @return The 64-bit application register K2.
1296
1297 **/
1298 UINT64
1299 EFIAPI
1300 AsmReadApplicationRegisterK2 (
1301 VOID
1302 );
1303
1304
1305 /**
1306 Reads application register K3.
1307
1308 This is a worker function for AsmReadApplicationRegister()
1309 when its parameter Index is IPF_APPLICATION_REGISTER_K3
1310
1311 @return The 64-bit application register K3.
1312
1313 **/
1314 UINT64
1315 EFIAPI
1316 AsmReadApplicationRegisterK3 (
1317 VOID
1318 );
1319
1320
1321 /**
1322 Reads application register K4.
1323
1324 This is a worker function for AsmReadApplicationRegister()
1325 when its parameter Index is IPF_APPLICATION_REGISTER_K4
1326
1327 @return The 64-bit application register K4.
1328
1329 **/
1330 UINT64
1331 EFIAPI
1332 AsmReadApplicationRegisterK4 (
1333 VOID
1334 );
1335
1336
1337 /**
1338 Reads application register K5.
1339
1340 This is a worker function for AsmReadApplicationRegister()
1341 when its parameter Index is IPF_APPLICATION_REGISTER_K5
1342
1343 @return The 64-bit application register K5.
1344
1345 **/
1346 UINT64
1347 EFIAPI
1348 AsmReadApplicationRegisterK5 (
1349 VOID
1350 );
1351
1352
1353 /**
1354 Reads application register K6.
1355
1356 This is a worker function for AsmReadApplicationRegister()
1357 when its parameter Index is IPF_APPLICATION_REGISTER_K6
1358
1359 @return The 64-bit application register K6.
1360
1361 **/
1362 UINT64
1363 EFIAPI
1364 AsmReadApplicationRegisterK6 (
1365 VOID
1366 );
1367
1368
1369 /**
1370 Reads application register K7.
1371
1372 This is a worker function for AsmReadApplicationRegister()
1373 when its parameter Index is IPF_APPLICATION_REGISTER_K7
1374
1375 @return The 64-bit application register K7.
1376
1377 **/
1378 UINT64
1379 EFIAPI
1380 AsmReadApplicationRegisterK7 (
1381 VOID
1382 );
1383
1384
1385 /**
1386 Reads application register RSC.
1387
1388 This is a worker function for AsmReadApplicationRegister()
1389 when its parameter Index is IPF_APPLICATION_REGISTER_RSC
1390
1391 @return The 64-bit application register RSC.
1392
1393 **/
1394 UINT64
1395 EFIAPI
1396 AsmReadApplicationRegisterRsc (
1397 VOID
1398 );
1399
1400
1401 /**
1402 Reads application register BSP.
1403
1404 This is a worker function for AsmReadApplicationRegister()
1405 when its parameter Index is IPF_APPLICATION_REGISTER_BSP
1406
1407 @return The 64-bit application register BSP.
1408
1409 **/
1410 UINT64
1411 EFIAPI
1412 AsmReadApplicationRegisterBsp (
1413 VOID
1414 );
1415
1416
1417 /**
1418 Reads application register BSPSTORE.
1419
1420 This is a worker function for AsmReadApplicationRegister()
1421 when its parameter Index is IPF_APPLICATION_REGISTER_BSPSTORE
1422
1423 @return The 64-bit application register BSPSTORE.
1424
1425 **/
1426 UINT64
1427 EFIAPI
1428 AsmReadApplicationRegisterBspstore (
1429 VOID
1430 );
1431
1432
1433 /**
1434 Reads application register RNAT.
1435
1436 This is a worker function for AsmReadApplicationRegister()
1437 when its parameter Index is IPF_APPLICATION_REGISTER_RNAT
1438
1439 @return The 64-bit application register RNAT.
1440
1441 **/
1442 UINT64
1443 EFIAPI
1444 AsmReadApplicationRegisterRnat (
1445 VOID
1446 );
1447
1448
1449 /**
1450 Reads application register FCR.
1451
1452 This is a worker function for AsmReadApplicationRegister()
1453 when its parameter Index is IPF_APPLICATION_REGISTER_FCR
1454
1455 @return The 64-bit application register FCR.
1456
1457 **/
1458 UINT64
1459 EFIAPI
1460 AsmReadApplicationRegisterFcr (
1461 VOID
1462 );
1463
1464
1465 /**
1466 Reads application register EFLAG.
1467
1468 This is a worker function for AsmReadApplicationRegister()
1469 when its parameter Index is IPF_APPLICATION_REGISTER_EFLAG
1470
1471 @return The 64-bit application register EFLAG.
1472
1473 **/
1474 UINT64
1475 EFIAPI
1476 AsmReadApplicationRegisterEflag (
1477 VOID
1478 );
1479
1480
1481 /**
1482 Reads application register CSD.
1483
1484 This is a worker function for AsmReadApplicationRegister()
1485 when its parameter Index is IPF_APPLICATION_REGISTER_CSD
1486
1487 @return The 64-bit application register CSD.
1488
1489 **/
1490 UINT64
1491 EFIAPI
1492 AsmReadApplicationRegisterCsd (
1493 VOID
1494 );
1495
1496
1497 /**
1498 Reads application register SSD.
1499
1500 This is a worker function for AsmReadApplicationRegister()
1501 when its parameter Index is IPF_APPLICATION_REGISTER_SSD
1502
1503 @return The 64-bit application register SSD.
1504
1505 **/
1506 UINT64
1507 EFIAPI
1508 AsmReadApplicationRegisterSsd (
1509 VOID
1510 );
1511
1512
1513 /**
1514 Reads application register CFLG.
1515
1516 This is a worker function for AsmReadApplicationRegister()
1517 when its parameter Index is IPF_APPLICATION_REGISTER_CFLG
1518
1519 @return The 64-bit application register CFLG.
1520
1521 **/
1522 UINT64
1523 EFIAPI
1524 AsmReadApplicationRegisterCflg (
1525 VOID
1526 );
1527
1528
1529 /**
1530 Reads application register FSR.
1531
1532 This is a worker function for AsmReadApplicationRegister()
1533 when its parameter Index is IPF_APPLICATION_REGISTER_FSR
1534
1535 @return The 64-bit application register FSR.
1536
1537 **/
1538 UINT64
1539 EFIAPI
1540 AsmReadApplicationRegisterFsr (
1541 VOID
1542 );
1543
1544
1545 /**
1546 Reads application register FIR.
1547
1548 This is a worker function for AsmReadApplicationRegister()
1549 when its parameter Index is IPF_APPLICATION_REGISTER_FIR
1550
1551 @return The 64-bit application register FIR.
1552
1553 **/
1554 UINT64
1555 EFIAPI
1556 AsmReadApplicationRegisterFir (
1557 VOID
1558 );
1559
1560
1561 /**
1562 Reads application register FDR.
1563
1564 This is a worker function for AsmReadApplicationRegister()
1565 when its parameter Index is IPF_APPLICATION_REGISTER_FDR
1566
1567 @return The 64-bit application register FDR.
1568
1569 **/
1570 UINT64
1571 EFIAPI
1572 AsmReadApplicationRegisterFdr (
1573 VOID
1574 );
1575
1576
1577 /**
1578 Reads application register CCV.
1579
1580 This is a worker function for AsmReadApplicationRegister()
1581 when its parameter Index is IPF_APPLICATION_REGISTER_CCV
1582
1583 @return The 64-bit application register CCV.
1584
1585 **/
1586 UINT64
1587 EFIAPI
1588 AsmReadApplicationRegisterCcv (
1589 VOID
1590 );
1591
1592
1593 /**
1594 Reads application register UNAT.
1595
1596 This is a worker function for AsmReadApplicationRegister()
1597 when its parameter Index is IPF_APPLICATION_REGISTER_UNAT
1598
1599 @return The 64-bit application register UNAT.
1600
1601 **/
1602 UINT64
1603 EFIAPI
1604 AsmReadApplicationRegisterUnat (
1605 VOID
1606 );
1607
1608
1609 /**
1610 Reads application register FPSR.
1611
1612 This is a worker function for AsmReadApplicationRegister()
1613 when its parameter Index is IPF_APPLICATION_REGISTER_FPSR
1614
1615 @return The 64-bit application register FPSR.
1616
1617 **/
1618 UINT64
1619 EFIAPI
1620 AsmReadApplicationRegisterFpsr (
1621 VOID
1622 );
1623
1624
1625 /**
1626 Reads application register ITC.
1627
1628 This is a worker function for AsmReadApplicationRegister()
1629 when its parameter Index is IPF_APPLICATION_REGISTER_ITC
1630
1631 @return The 64-bit application register ITC.
1632
1633 **/
1634 UINT64
1635 EFIAPI
1636 AsmReadApplicationRegisterItc (
1637 VOID
1638 );
1639
1640
1641 /**
1642 Reads application register PFS.
1643
1644 This is a worker function for AsmReadApplicationRegister()
1645 when its parameter Index is IPF_APPLICATION_REGISTER_PFS
1646
1647 @return The 64-bit application register PFS.
1648
1649 **/
1650 UINT64
1651 EFIAPI
1652 AsmReadApplicationRegisterPfs (
1653 VOID
1654 );
1655
1656
1657 /**
1658 Reads application register LC.
1659
1660 This is a worker function for AsmReadApplicationRegister()
1661 when its parameter Index is IPF_APPLICATION_REGISTER_LC
1662
1663 @return The 64-bit application register LC.
1664
1665 **/
1666 UINT64
1667 EFIAPI
1668 AsmReadApplicationRegisterLc (
1669 VOID
1670 );
1671
1672
1673 /**
1674 Reads application register EC.
1675
1676 This is a worker function for AsmReadApplicationRegister()
1677 when its parameter Index is IPF_APPLICATION_REGISTER_EC
1678
1679 @return The 64-bit application register EC.
1680
1681 **/
1682 UINT64
1683 EFIAPI
1684 AsmReadApplicationRegisterEc (
1685 VOID
1686 );
1687
1688
1689
1690 /**
1691 Transfers control to a function starting with a new stack.
1692
1693 Transfers control to the function specified by EntryPoint using the new stack
1694 specified by NewStack and passing in the parameters specified by Context1 and
1695 Context2. Context1 and Context2 are optional and may be NULL. The function
1696 EntryPoint must never return.
1697
1698 If EntryPoint is NULL, then ASSERT().
1699 If NewStack is NULL, then ASSERT().
1700
1701 @param EntryPoint A pointer to function to call with the new stack.
1702 @param Context1 A pointer to the context to pass into the EntryPoint
1703 function.
1704 @param Context2 A pointer to the context to pass into the EntryPoint
1705 function.
1706 @param NewStack A pointer to the new stack to use for the EntryPoint
1707 function.
1708 @param NewBsp A pointer to the new memory location for RSE backing
1709 store.
1710
1711 **/
1712 VOID
1713 EFIAPI
1714 AsmSwitchStackAndBackingStore (
1715 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
1716 IN VOID *Context1, OPTIONAL
1717 IN VOID *Context2, OPTIONAL
1718 IN VOID *NewStack,
1719 IN VOID *NewBsp
1720 );
1721 #else
1722
1723 #endif
1724
1725 #endif