]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Removed AsmSwitchStackAndBackingStore from BaseLib.h
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Mar 2007 03:03:32 +0000 (03:03 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Mar 2007 03:03:32 +0000 (03:03 +0000)
2. Modified SwitchStack definition update to MWG 0.60e.
3. Added BaseLib/Ipf/InternalSwitchStack.c and removed BaseLib/Ipf/Non-existing.c
4. Updated any references of AsmSwitchStackAndBackingStore to SwichStack on IPF.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2499 6f19259b-4bc3-4df7-8a09-765794883524

EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
EdkModulePkg/Core/Pei/Ipf/Stack.c
MdePkg/Include/Library/BaseLib.h
MdePkg/Library/BaseLib/BaseLib.msa
MdePkg/Library/BaseLib/BaseLibInternals.h
MdePkg/Library/BaseLib/Ebc/SwitchStack.c
MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.c
MdePkg/Library/BaseLib/Ipf/InternalSwitchStack.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/Non-existing.c [deleted file]
MdePkg/Library/BaseLib/SwitchStack.c

index b7cdb9db45f472781c152231a1aeb5a848a8651a..34141ab9f6c887a364ddd971f037f6025abd8739 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -62,7 +62,7 @@ HandOffToDxeCore (
   Status = PeiServicesInstallPpi (EndOfPeiSignal);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   Status = PeiServicesInstallPpi (EndOfPeiSignal);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  AsmSwitchStackAndBackingStore (\r
+  SwitchStack (\r
     (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,\r
     HobList.Raw,\r
     NULL,\r
     (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,\r
     HobList.Raw,\r
     NULL,\r
index 57d04a27e56611252965e2e00f8538e092f09ea9..56a876df152b64c676d95a1cb7f5e3378e087817 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   PeiSwitchStacks() function for PEI dispatcher.\r
 \r
 /** @file\r
   PeiSwitchStacks() function for PEI dispatcher.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -48,7 +48,7 @@ PeiSwitchStacks (
   IN      VOID                      *NewBsp\r
   )\r
 {\r
   IN      VOID                      *NewBsp\r
   )\r
 {\r
-  AsmSwitchStackAndBackingStore (\r
+  SwitchStack (\r
     EntryPoint,\r
     Context1,\r
     Context2,\r
     EntryPoint,\r
     Context1,\r
     Context2,\r
index bca5b735f861b8b28427f16844485be396e11071..f98b250402ce5124f5c360bf4f26942db7578df3 100644 (file)
@@ -395,22 +395,22 @@ StrnCat (
   );
 
 /**
   );
 
 /**
-  Returns the first occurance of a Null-terminated Unicode sub-string 
+  Returns the first occurance of a Null-terminated Unicode sub-string
   in a Null-terminated Unicode string.
 
   in a Null-terminated Unicode string.
 
-  This function scans the contents of the Null-terminated Unicode string 
-  specified by String and returns the first occurrence of SearchString.  
-  If SearchString is not found in String, then NULL is returned.  If 
-  the length of SearchString is zero, then String is 
+  This function scans the contents of the Null-terminated Unicode string
+  specified by String and returns the first occurrence of SearchString.
+  If SearchString is not found in String, then NULL is returned.  If
+  the length of SearchString is zero, then String is
   returned.
   returned.
-  
+
   If String is NULL, then ASSERT().
   If String is not aligned on a 16-bit boundary, then ASSERT().
   If SearchString is NULL, then ASSERT().
   If SearchString is not aligned on a 16-bit boundary, then ASSERT().
 
   If String is NULL, then ASSERT().
   If String is not aligned on a 16-bit boundary, then ASSERT().
   If SearchString is NULL, then ASSERT().
   If SearchString is not aligned on a 16-bit boundary, then ASSERT().
 
-  If PcdMaximumUnicodeStringLength is not zero, and SearchString 
-  or String contains more than PcdMaximumUnicodeStringLength Unicode 
+  If PcdMaximumUnicodeStringLength is not zero, and SearchString
+  or String contains more than PcdMaximumUnicodeStringLength Unicode
   characters not including the Null-terminator, then ASSERT().
 
   @param  String                                 Pointer to a Null-terminated Unicode string.
   characters not including the Null-terminator, then ASSERT().
 
   @param  String                                 Pointer to a Null-terminated Unicode string.
@@ -428,37 +428,37 @@ StrStr (
   );
 
 /**
   );
 
 /**
-  Convert a Null-terminated Unicode decimal string to a value of 
+  Convert a Null-terminated Unicode decimal string to a value of
   type UINTN.
 
   type UINTN.
 
-  This function returns a value of type UINTN by interpreting the contents 
-  of the Unicode string specified by String as a decimal number. The format 
+  This function returns a value of type UINTN by interpreting the contents
+  of the Unicode string specified by String as a decimal number. The format
   of the input Unicode string String is:
   of the input Unicode string String is:
-  
+
                   [spaces] [decimal digits].
                   [spaces] [decimal digits].
-                  
-  The valid decimal digit character is in the range [0-9]. The 
-  function will ignore the pad space, which includes spaces or 
-  tab characters, before [decimal digits]. The running zero in the 
-  beginning of [decimal digits] will be ignored. Then, the function 
-  stops at the first character that is a not a valid decimal character 
-  or a Null-terminator, whichever one comes first. 
-  
+
+  The valid decimal digit character is in the range [0-9]. The
+  function will ignore the pad space, which includes spaces or
+  tab characters, before [decimal digits]. The running zero in the
+  beginning of [decimal digits] will be ignored. Then, the function
+  stops at the first character that is a not a valid decimal character
+  or a Null-terminator, whichever one comes first.
+
   If String is NULL, then ASSERT().
   If String is NULL, then ASSERT().
-  If String is not aligned in a 16-bit boundary, then ASSERT().  
+  If String is not aligned in a 16-bit boundary, then ASSERT().
   If String has only pad spaces, then 0 is returned.
   If String has only pad spaces, then 0 is returned.
-  If String has no pad spaces or valid decimal digits, 
+  If String has no pad spaces or valid decimal digits,
   then 0 is returned.
   then 0 is returned.
-  If the number represented by String overflows according 
+  If the number represented by String overflows according
   to the range defined by UINTN, then ASSERT().
   to the range defined by UINTN, then ASSERT().
-  
-  If PcdMaximumUnicodeStringLength is not zero, and String contains 
-  more than PcdMaximumUnicodeStringLength Unicode characters not including 
+
+  If PcdMaximumUnicodeStringLength is not zero, and String contains
+  more than PcdMaximumUnicodeStringLength Unicode characters not including
   the Null-terminator, then ASSERT().
 
   @param  String                           Pointer to a Null-terminated Unicode string.
 
   the Null-terminator, then ASSERT().
 
   @param  String                           Pointer to a Null-terminated Unicode string.
 
-  @retval UINTN           
+  @retval UINTN
 
 **/
 UINTN
 
 **/
 UINTN
@@ -468,37 +468,37 @@ StrDecimalToUintn (
   );
 
 /**
   );
 
 /**
-  Convert a Null-terminated Unicode decimal string to a value of 
+  Convert a Null-terminated Unicode decimal string to a value of
   type UINT64.
 
   type UINT64.
 
-  This function returns a value of type UINT64 by interpreting the contents 
-  of the Unicode string specified by String as a decimal number. The format 
+  This function returns a value of type UINT64 by interpreting the contents
+  of the Unicode string specified by String as a decimal number. The format
   of the input Unicode string String is:
   of the input Unicode string String is:
-  
+
                   [spaces] [decimal digits].
                   [spaces] [decimal digits].
-                  
-  The valid decimal digit character is in the range [0-9]. The 
-  function will ignore the pad space, which includes spaces or 
-  tab characters, before [decimal digits]. The running zero in the 
-  beginning of [decimal digits] will be ignored. Then, the function 
-  stops at the first character that is a not a valid decimal character 
-  or a Null-terminator, whichever one comes first. 
-  
+
+  The valid decimal digit character is in the range [0-9]. The
+  function will ignore the pad space, which includes spaces or
+  tab characters, before [decimal digits]. The running zero in the
+  beginning of [decimal digits] will be ignored. Then, the function
+  stops at the first character that is a not a valid decimal character
+  or a Null-terminator, whichever one comes first.
+
   If String is NULL, then ASSERT().
   If String is NULL, then ASSERT().
-  If String is not aligned in a 16-bit boundary, then ASSERT().  
+  If String is not aligned in a 16-bit boundary, then ASSERT().
   If String has only pad spaces, then 0 is returned.
   If String has only pad spaces, then 0 is returned.
-  If String has no pad spaces or valid decimal digits, 
+  If String has no pad spaces or valid decimal digits,
   then 0 is returned.
   then 0 is returned.
-  If the number represented by String overflows according 
+  If the number represented by String overflows according
   to the range defined by UINT64, then ASSERT().
   to the range defined by UINT64, then ASSERT().
-  
-  If PcdMaximumUnicodeStringLength is not zero, and String contains 
-  more than PcdMaximumUnicodeStringLength Unicode characters not including 
+
+  If PcdMaximumUnicodeStringLength is not zero, and String contains
+  more than PcdMaximumUnicodeStringLength Unicode characters not including
   the Null-terminator, then ASSERT().
 
   @param  String                           Pointer to a Null-terminated Unicode string.
 
   the Null-terminator, then ASSERT().
 
   @param  String                           Pointer to a Null-terminated Unicode string.
 
-  @retval UINT64           
+  @retval UINT64
 
 **/
 UINT64
 
 **/
 UINT64
@@ -510,31 +510,31 @@ StrDecimalToUint64 (
 /**
   Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
 
 /**
   Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
 
-  This function returns a value of type UINTN by interpreting the contents 
-  of the Unicode string specified by String as a hexadecimal number. 
+  This function returns a value of type UINTN by interpreting the contents
+  of the Unicode string specified by String as a hexadecimal number.
   The format of the input Unicode string String is:
   The format of the input Unicode string String is:
-  
-                  [spaces][zeros][x][hexadecimal digits]. 
-
-  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. 
-  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. 
-  If "x" appears in the input string, it must be prefixed with at least one 0. 
-  The function will ignore the pad space, which includes spaces or tab characters, 
-  before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or 
-  [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the 
-  first valid hexadecimal digit. Then, the function stops at the first character that is 
+
+                  [spaces][zeros][x][hexadecimal digits].
+
+  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
+  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
+  If "x" appears in the input string, it must be prefixed with at least one 0.
+  The function will ignore the pad space, which includes spaces or tab characters,
+  before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or
+  [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the
+  first valid hexadecimal digit. Then, the function stops at the first character that is
   a not a valid hexadecimal character or NULL, whichever one comes first.
 
   If String is NULL, then ASSERT().
   If String is not aligned in a 16-bit boundary, then ASSERT().
   If String has only pad spaces, then zero is returned.
   a not a valid hexadecimal character or NULL, whichever one comes first.
 
   If String is NULL, then ASSERT().
   If String is not aligned in a 16-bit boundary, then ASSERT().
   If String has only pad spaces, then zero is returned.
-  If String has no leading pad spaces, leading zeros or valid hexadecimal digits, 
+  If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
   then zero is returned.
   then zero is returned.
-  If the number represented by String overflows according to the range defined by 
+  If the number represented by String overflows according to the range defined by
   UINTN, then ASSERT().
 
   UINTN, then ASSERT().
 
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than 
-  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, 
+  If PcdMaximumUnicodeStringLength is not zero, and String contains more than
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
   then ASSERT().
 
   @param  String                           Pointer to a Null-terminated Unicode string.
   then ASSERT().
 
   @param  String                           Pointer to a Null-terminated Unicode string.
@@ -551,31 +551,31 @@ StrHexToUintn (
 /**
   Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
 
 /**
   Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
 
-  This function returns a value of type UINT64 by interpreting the contents 
-  of the Unicode string specified by String as a hexadecimal number. 
-  The format of the input Unicode string String is 
-  
-                  [spaces][zeros][x][hexadecimal digits]. 
-
-  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. 
-  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. 
-  If "x" appears in the input string, it must be prefixed with at least one 0. 
-  The function will ignore the pad space, which includes spaces or tab characters, 
-  before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or 
-  [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the 
-  first valid hexadecimal digit. Then, the function stops at the first character that is 
+  This function returns a value of type UINT64 by interpreting the contents
+  of the Unicode string specified by String as a hexadecimal number.
+  The format of the input Unicode string String is
+
+                  [spaces][zeros][x][hexadecimal digits].
+
+  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
+  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
+  If "x" appears in the input string, it must be prefixed with at least one 0.
+  The function will ignore the pad space, which includes spaces or tab characters,
+  before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or
+  [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the
+  first valid hexadecimal digit. Then, the function stops at the first character that is
   a not a valid hexadecimal character or NULL, whichever one comes first.
 
   If String is NULL, then ASSERT().
   If String is not aligned in a 16-bit boundary, then ASSERT().
   If String has only pad spaces, then zero is returned.
   a not a valid hexadecimal character or NULL, whichever one comes first.
 
   If String is NULL, then ASSERT().
   If String is not aligned in a 16-bit boundary, then ASSERT().
   If String has only pad spaces, then zero is returned.
-  If String has no leading pad spaces, leading zeros or valid hexadecimal digits, 
+  If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
   then zero is returned.
   then zero is returned.
-  If the number represented by String overflows according to the range defined by 
+  If the number represented by String overflows according to the range defined by
   UINT64, then ASSERT().
 
   UINT64, then ASSERT().
 
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than 
-  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, 
+  If PcdMaximumUnicodeStringLength is not zero, and String contains more than
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
   then ASSERT().
 
   @param  String                           Pointer to a Null-terminated Unicode string.
   then ASSERT().
 
   @param  String                           Pointer to a Null-terminated Unicode string.
@@ -590,27 +590,27 @@ StrHexToUint64 (
   );
 
 /**
   );
 
 /**
-  Convert one Null-terminated Unicode string to a Null-terminated 
+  Convert one Null-terminated Unicode string to a Null-terminated
   ASCII string and returns the ASCII string.
   ASCII string and returns the ASCII string.
-  
-  This function converts the content of the Unicode string Source 
-  to the ASCII string Destination by copying the lower 8 bits of 
-  each Unicode character. It returns Destination. 
 
 
-  If any Unicode characters in Source contain non-zero value in 
+  This function converts the content of the Unicode string Source
+  to the ASCII string Destination by copying the lower 8 bits of
+  each Unicode character. It returns Destination.
+
+  If any Unicode characters in Source contain non-zero value in
   the upper 8 bits, then ASSERT().
   the upper 8 bits, then ASSERT().
-  
+
   If Destination is NULL, then ASSERT().
   If Source is NULL, then ASSERT().
   If Source is not aligned on a 16-bit boundary, then ASSERT().
   If Source and Destination overlap, then ASSERT().
   If Destination is NULL, then ASSERT().
   If Source is NULL, then ASSERT().
   If Source is not aligned on a 16-bit boundary, then ASSERT().
   If Source and Destination overlap, then ASSERT().
-  
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains 
-  more than PcdMaximumUnicodeStringLength Unicode characters not including 
+
+  If PcdMaximumUnicodeStringLength is not zero, and Source contains
+  more than PcdMaximumUnicodeStringLength Unicode characters not including
   the Null-terminator, then ASSERT().
   the Null-terminator, then ASSERT().
-  
-  If PcdMaximumAsciiStringLength is not zero, and Source contains more 
-  than PcdMaximumAsciiStringLength Unicode characters not including the 
+
+  If PcdMaximumAsciiStringLength is not zero, and Source contains more
+  than PcdMaximumAsciiStringLength Unicode characters not including the
   Null-terminator, then ASSERT().
 
   @param  Source        Pointer to a Null-terminated Unicode string.
   Null-terminator, then ASSERT().
 
   @param  Source        Pointer to a Null-terminated Unicode string.
@@ -907,19 +907,19 @@ AsciiStrnCat (
   );
 
 /**
   );
 
 /**
-  Returns the first occurance of a Null-terminated ASCII sub-string 
+  Returns the first occurance of a Null-terminated ASCII sub-string
   in a Null-terminated ASCII string.
 
   in a Null-terminated ASCII string.
 
-  This function scans the contents of the ASCII string specified by String 
-  and returns the first occurrence of SearchString. If SearchString is not 
-  found in String, then NULL is returned. If the length of SearchString is zero, 
+  This function scans the contents of the ASCII string specified by String
+  and returns the first occurrence of SearchString. If SearchString is not
+  found in String, then NULL is returned. If the length of SearchString is zero,
   then String is returned.
   then String is returned.
-  
+
   If String is NULL, then ASSERT().
   If SearchString is NULL, then ASSERT().
 
   If String is NULL, then ASSERT().
   If SearchString is NULL, then ASSERT().
 
-  If PcdMaximumAsciiStringLength is not zero, and SearchString or 
-  String contains more than PcdMaximumAsciiStringLength Unicode characters 
+  If PcdMaximumAsciiStringLength is not zero, and SearchString or
+  String contains more than PcdMaximumAsciiStringLength Unicode characters
   not including the Null-terminator, then ASSERT().
 
   @param  String                                 Pointer to a Null-terminated ASCII string.
   not including the Null-terminator, then ASSERT().
 
   @param  String                                 Pointer to a Null-terminated ASCII string.
@@ -937,33 +937,33 @@ AsciiStrStr (
   );
 
 /**
   );
 
 /**
-  Convert a Null-terminated ASCII decimal string to a value of type 
+  Convert a Null-terminated ASCII decimal string to a value of type
   UINTN.
 
   UINTN.
 
-  This function returns a value of type UINTN by interpreting the contents 
-  of the ASCII string String as a decimal number. The format of the input 
+  This function returns a value of type UINTN by interpreting the contents
+  of the ASCII string String as a decimal number. The format of the input
   ASCII string String is:
   ASCII string String is:
-  
+
                     [spaces] [decimal digits].
                     [spaces] [decimal digits].
-  
-  The valid decimal digit character is in the range [0-9]. The function will 
-  ignore the pad space, which includes spaces or tab characters, before the digits. 
-  The running zero in the beginning of [decimal digits] will be ignored. Then, the 
-  function stops at the first character that is a not a valid decimal character or 
+
+  The valid decimal digit character is in the range [0-9]. The function will
+  ignore the pad space, which includes spaces or tab characters, before the digits.
+  The running zero in the beginning of [decimal digits] will be ignored. Then, the
+  function stops at the first character that is a not a valid decimal character or
   Null-terminator, whichever on comes first.
   Null-terminator, whichever on comes first.
-  
+
   If String has only pad spaces, then 0 is returned.
   If String has no pad spaces or valid decimal digits, then 0 is returned.
   If String has only pad spaces, then 0 is returned.
   If String has no pad spaces or valid decimal digits, then 0 is returned.
-  If the number represented by String overflows according to the range defined by 
+  If the number represented by String overflows according to the range defined by
   UINTN, then ASSERT().
   If String is NULL, then ASSERT().
   UINTN, then ASSERT().
   If String is NULL, then ASSERT().
-  If PcdMaximumAsciiStringLength is not zero, and String contains more than 
-  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, 
+  If PcdMaximumAsciiStringLength is not zero, and String contains more than
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
   then ASSERT().
 
   @param  String                           Pointer to a Null-terminated ASCII string.
 
   then ASSERT().
 
   @param  String                           Pointer to a Null-terminated ASCII string.
 
-  @retval UINTN           
+  @retval UINTN
 
 **/
 UINTN
 
 **/
 UINTN
@@ -973,33 +973,33 @@ AsciiStrDecimalToUintn (
   );
 
 /**
   );
 
 /**
-  Convert a Null-terminated ASCII decimal string to a value of type 
+  Convert a Null-terminated ASCII decimal string to a value of type
   UINT64.
 
   UINT64.
 
-  This function returns a value of type UINT64 by interpreting the contents 
-  of the ASCII string String as a decimal number. The format of the input 
+  This function returns a value of type UINT64 by interpreting the contents
+  of the ASCII string String as a decimal number. The format of the input
   ASCII string String is:
   ASCII string String is:
-  
+
                     [spaces] [decimal digits].
                     [spaces] [decimal digits].
-  
-  The valid decimal digit character is in the range [0-9]. The function will 
-  ignore the pad space, which includes spaces or tab characters, before the digits. 
-  The running zero in the beginning of [decimal digits] will be ignored. Then, the 
-  function stops at the first character that is a not a valid decimal character or 
+
+  The valid decimal digit character is in the range [0-9]. The function will
+  ignore the pad space, which includes spaces or tab characters, before the digits.
+  The running zero in the beginning of [decimal digits] will be ignored. Then, the
+  function stops at the first character that is a not a valid decimal character or
   Null-terminator, whichever on comes first.
   Null-terminator, whichever on comes first.
-  
+
   If String has only pad spaces, then 0 is returned.
   If String has no pad spaces or valid decimal digits, then 0 is returned.
   If String has only pad spaces, then 0 is returned.
   If String has no pad spaces or valid decimal digits, then 0 is returned.
-  If the number represented by String overflows according to the range defined by 
+  If the number represented by String overflows according to the range defined by
   UINT64, then ASSERT().
   If String is NULL, then ASSERT().
   UINT64, then ASSERT().
   If String is NULL, then ASSERT().
-  If PcdMaximumAsciiStringLength is not zero, and String contains more than 
-  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, 
+  If PcdMaximumAsciiStringLength is not zero, and String contains more than
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
   then ASSERT().
 
   @param  String                           Pointer to a Null-terminated ASCII string.
 
   then ASSERT().
 
   @param  String                           Pointer to a Null-terminated ASCII string.
 
-  @retval UINT64           
+  @retval UINT64
 
 **/
 UINT64
 
 **/
 UINT64
@@ -1011,30 +1011,30 @@ AsciiStrDecimalToUint64 (
 /**
   Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
 
 /**
   Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
 
-  This function returns a value of type UINTN by interpreting the contents of 
-  the ASCII string String as a hexadecimal number. The format of the input ASCII 
+  This function returns a value of type UINTN by interpreting the contents of
+  the ASCII string String as a hexadecimal number. The format of the input ASCII
   string String is:
   string String is:
-  
+
                   [spaces][zeros][x][hexadecimal digits].
                   [spaces][zeros][x][hexadecimal digits].
-                  
-  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. 
-  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x" 
-  appears in the input string, it must be prefixed with at least one 0. The function 
-  will ignore the pad space, which includes spaces or tab characters, before [zeros], 
-  [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits] 
-  will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal 
-  digit. Then, the function stops at the first character that is a not a valid 
+
+  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
+  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"
+  appears in the input string, it must be prefixed with at least one 0. The function
+  will ignore the pad space, which includes spaces or tab characters, before [zeros],
+  [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits]
+  will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal
+  digit. Then, the function stops at the first character that is a not a valid
   hexadecimal character or Null-terminator, whichever on comes first.
   hexadecimal character or Null-terminator, whichever on comes first.
-  
+
   If String has only pad spaces, then 0 is returned.
   If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
   0 is returned.
 
   If String has only pad spaces, then 0 is returned.
   If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
   0 is returned.
 
-  If the number represented by String overflows according to the range defined by UINTN, 
+  If the number represented by String overflows according to the range defined by UINTN,
   then ASSERT().
   If String is NULL, then ASSERT().
   then ASSERT().
   If String is NULL, then ASSERT().
-  If PcdMaximumAsciiStringLength is not zero, 
-  and String contains more than PcdMaximumAsciiStringLength ASCII characters not including 
+  If PcdMaximumAsciiStringLength is not zero,
+  and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
   the Null-terminator, then ASSERT().
 
   @param  String                           Pointer to a Null-terminated ASCII string.
   the Null-terminator, then ASSERT().
 
   @param  String                           Pointer to a Null-terminated ASCII string.
@@ -1051,30 +1051,30 @@ AsciiStrHexToUintn (
 /**
   Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
 
 /**
   Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
 
-  This function returns a value of type UINT64 by interpreting the contents of 
-  the ASCII string String as a hexadecimal number. The format of the input ASCII 
+  This function returns a value of type UINT64 by interpreting the contents of
+  the ASCII string String as a hexadecimal number. The format of the input ASCII
   string String is:
   string String is:
-  
+
                   [spaces][zeros][x][hexadecimal digits].
                   [spaces][zeros][x][hexadecimal digits].
-                  
-  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. 
-  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x" 
-  appears in the input string, it must be prefixed with at least one 0. The function 
-  will ignore the pad space, which includes spaces or tab characters, before [zeros], 
-  [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits] 
-  will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal 
-  digit. Then, the function stops at the first character that is a not a valid 
+
+  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
+  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"
+  appears in the input string, it must be prefixed with at least one 0. The function
+  will ignore the pad space, which includes spaces or tab characters, before [zeros],
+  [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits]
+  will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal
+  digit. Then, the function stops at the first character that is a not a valid
   hexadecimal character or Null-terminator, whichever on comes first.
   hexadecimal character or Null-terminator, whichever on comes first.
-  
+
   If String has only pad spaces, then 0 is returned.
   If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
   0 is returned.
 
   If String has only pad spaces, then 0 is returned.
   If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
   0 is returned.
 
-  If the number represented by String overflows according to the range defined by UINT64, 
+  If the number represented by String overflows according to the range defined by UINT64,
   then ASSERT().
   If String is NULL, then ASSERT().
   then ASSERT().
   If String is NULL, then ASSERT().
-  If PcdMaximumAsciiStringLength is not zero, 
-  and String contains more than PcdMaximumAsciiStringLength ASCII characters not including 
+  If PcdMaximumAsciiStringLength is not zero,
+  and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
   the Null-terminator, then ASSERT().
 
   @param  String                           Pointer to a Null-terminated ASCII string.
   the Null-terminator, then ASSERT().
 
   @param  String                           Pointer to a Null-terminated ASCII string.
@@ -1089,24 +1089,24 @@ AsciiStrHexToUint64 (
   );
 
 /**
   );
 
 /**
-  Convert one Null-terminated ASCII string to a Null-terminated 
+  Convert one Null-terminated ASCII string to a Null-terminated
   Unicode string and returns the Unicode string.
 
   Unicode string and returns the Unicode string.
 
-  This function converts the contents of the ASCII string Source to the Unicode 
-  string Destination, and returns Destination.  The function terminates the 
-  Unicode string Destination by appending a Null-terminator character at the end. 
-  The caller is responsible to make sure Destination points to a buffer with size 
+  This function converts the contents of the ASCII string Source to the Unicode
+  string Destination, and returns Destination.  The function terminates the
+  Unicode string Destination by appending a Null-terminator character at the end.
+  The caller is responsible to make sure Destination points to a buffer with size
   equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
   equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
-  
+
   If Destination is NULL, then ASSERT().
   If Destination is not aligned on a 16-bit boundary, then ASSERT().
   If Source is NULL, then ASSERT().
   If Source and Destination overlap, then ASSERT().
   If Destination is NULL, then ASSERT().
   If Destination is not aligned on a 16-bit boundary, then ASSERT().
   If Source is NULL, then ASSERT().
   If Source and Destination overlap, then ASSERT().
-  If PcdMaximumAsciiStringLength is not zero, and Source contains more than 
-  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, 
+  If PcdMaximumAsciiStringLength is not zero, and Source contains more than
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
   then ASSERT().
   then ASSERT().
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than 
-  PcdMaximumUnicodeStringLength ASCII characters not including the 
+  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
+  PcdMaximumUnicodeStringLength ASCII characters not including the
   Null-terminator, then ASSERT().
 
   @param  Source        Pointer to a Null-terminated ASCII string.
   Null-terminator, then ASSERT().
 
   @param  Source        Pointer to a Null-terminated ASCII string.
@@ -3018,16 +3018,16 @@ InterlockedCompareExchangePointer (
 //
 
 /**
 //
 
 /**
-  Calculate the sum of all elements in a buffer in unit of UINT8. 
+  Calculate the sum of all elements in a buffer in unit of UINT8.
   During calculation, the carry bits are dropped.
 
   During calculation, the carry bits are dropped.
 
-  This function calculates the sum of all elements in a buffer 
-  in unit of UINT8. The carry bits in result of addition are dropped. 
-  The result is returned as UINT8. If Length is Zero, then Zero is 
+  This function calculates the sum of all elements in a buffer
+  in unit of UINT8. The carry bits in result of addition are dropped.
+  The result is returned as UINT8. If Length is Zero, then Zero is
   returned.
   returned.
-  
+
   If Buffer is NULL, then ASSERT().
   If Buffer is NULL, then ASSERT().
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
 
   @param  Buffer                       Pointer to the buffer to carry out the sum operation.
   @param  Length           The size, in bytes, of Buffer .
 
   @param  Buffer                       Pointer to the buffer to carry out the sum operation.
   @param  Length           The size, in bytes, of Buffer .
@@ -3044,14 +3044,14 @@ CalculateSum8 (
 
 
 /**
 
 
 /**
-  Returns the two's complement checksum of all elements in a buffer 
+  Returns the two's complement checksum of all elements in a buffer
   of 8-bit values.
 
   of 8-bit values.
 
-  This function first calculates the sum of the 8-bit values in the 
-  buffer specified by Buffer and Length.  The carry bits in the result 
-  of addition are dropped. Then, the two's complement of the sum is 
+  This function first calculates the sum of the 8-bit values in the
+  buffer specified by Buffer and Length.  The carry bits in the result
+  of addition are dropped. Then, the two's complement of the sum is
   returned.  If Length is 0, then 0 is returned.
   returned.  If Length is 0, then 0 is returned.
-  
+
   If Buffer is NULL, then ASSERT().
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
 
   If Buffer is NULL, then ASSERT().
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
 
@@ -3070,13 +3070,13 @@ CalculateCheckSum8 (
   );
 
 /**
   );
 
 /**
-  Returns the sum of all elements in a buffer of 16-bit values.  During 
+  Returns the sum of all elements in a buffer of 16-bit values.  During
   calculation, the carry bits are dropped.
 
   calculation, the carry bits are dropped.
 
-  This function calculates the sum of the 16-bit values in the buffer 
-  specified by Buffer and Length. The carry bits in result of addition are dropped. 
-  The 16-bit result is returned.  If Length is 0, then 0 is returned.  
-  
+  This function calculates the sum of the 16-bit values in the buffer
+  specified by Buffer and Length. The carry bits in result of addition are dropped.
+  The 16-bit result is returned.  If Length is 0, then 0 is returned.
+
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().
   If Length is not aligned on a 16-bit boundary, then ASSERT().
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().
   If Length is not aligned on a 16-bit boundary, then ASSERT().
@@ -3096,18 +3096,18 @@ CalculateSum16 (
   );
 
 /**
   );
 
 /**
-  Returns the two's complement checksum of all elements in a buffer of 
+  Returns the two's complement checksum of all elements in a buffer of
   16-bit values.
 
   16-bit values.
 
-  This function first calculates the sum of the 16-bit values in the buffer 
-  specified by Buffer and Length.  The carry bits in the result of addition 
-  are dropped. Then, the two's complement of the sum is returned.  If Length 
+  This function first calculates the sum of the 16-bit values in the buffer
+  specified by Buffer and Length.  The carry bits in the result of addition
+  are dropped. Then, the two's complement of the sum is returned.  If Length
   is 0, then 0 is returned.
   is 0, then 0 is returned.
-  
+
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().
   If Length is not aligned on a 16-bit boundary, then ASSERT().
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().
   If Length is not aligned on a 16-bit boundary, then ASSERT().
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
 
   @param  Buffer                       Pointer to the buffer to carry out the checksum operation.
   @param  Length           The size, in bytes, of Buffer.
 
   @param  Buffer                       Pointer to the buffer to carry out the checksum operation.
   @param  Length           The size, in bytes, of Buffer.
@@ -3123,13 +3123,13 @@ CalculateCheckSum16 (
   );
 
 /**
   );
 
 /**
-  Returns the sum of all elements in a buffer of 32-bit values.  During 
+  Returns the sum of all elements in a buffer of 32-bit values.  During
   calculation, the carry bits are dropped.
 
   calculation, the carry bits are dropped.
 
-  This function calculates the sum of the 32-bit values in the buffer 
-  specified by Buffer and Length. The carry bits in result of addition are dropped. 
-  The 32-bit result is returned.  If Length is 0, then 0 is returned.  
-  
+  This function calculates the sum of the 32-bit values in the buffer
+  specified by Buffer and Length. The carry bits in result of addition are dropped.
+  The 32-bit result is returned.  If Length is 0, then 0 is returned.
+
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().
   If Length is not aligned on a 32-bit boundary, then ASSERT().
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().
   If Length is not aligned on a 32-bit boundary, then ASSERT().
@@ -3149,18 +3149,18 @@ CalculateSum32 (
   );
 
 /**
   );
 
 /**
-  Returns the two's complement checksum of all elements in a buffer of 
+  Returns the two's complement checksum of all elements in a buffer of
   32-bit values.
 
   32-bit values.
 
-  This function first calculates the sum of the 32-bit values in the buffer 
-  specified by Buffer and Length.  The carry bits in the result of addition 
-  are dropped. Then, the two's complement of the sum is returned.  If Length 
+  This function first calculates the sum of the 32-bit values in the buffer
+  specified by Buffer and Length.  The carry bits in the result of addition
+  are dropped. Then, the two's complement of the sum is returned.  If Length
   is 0, then 0 is returned.
   is 0, then 0 is returned.
-  
+
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().
   If Length is not aligned on a 32-bit boundary, then ASSERT().
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().
   If Length is not aligned on a 32-bit boundary, then ASSERT().
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
 
   @param  Buffer                       Pointer to the buffer to carry out the checksum operation.
   @param  Length           The size, in bytes, of Buffer.
 
   @param  Buffer                       Pointer to the buffer to carry out the checksum operation.
   @param  Length           The size, in bytes, of Buffer.
@@ -3176,13 +3176,13 @@ CalculateCheckSum32 (
   );
 
 /**
   );
 
 /**
-  Returns the sum of all elements in a buffer of 64-bit values.  During 
+  Returns the sum of all elements in a buffer of 64-bit values.  During
   calculation, the carry bits are dropped.
 
   calculation, the carry bits are dropped.
 
-  This function calculates the sum of the 64-bit values in the buffer 
-  specified by Buffer and Length. The carry bits in result of addition are dropped. 
-  The 64-bit result is returned.  If Length is 0, then 0 is returned.  
-  
+  This function calculates the sum of the 64-bit values in the buffer
+  specified by Buffer and Length. The carry bits in result of addition are dropped.
+  The 64-bit result is returned.  If Length is 0, then 0 is returned.
+
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().
   If Length is not aligned on a 64-bit boundary, then ASSERT().
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().
   If Length is not aligned on a 64-bit boundary, then ASSERT().
@@ -3202,18 +3202,18 @@ CalculateSum64 (
   );
 
 /**
   );
 
 /**
-  Returns the two's complement checksum of all elements in a buffer of 
+  Returns the two's complement checksum of all elements in a buffer of
   64-bit values.
 
   64-bit values.
 
-  This function first calculates the sum of the 64-bit values in the buffer 
-  specified by Buffer and Length.  The carry bits in the result of addition 
-  are dropped. Then, the two's complement of the sum is returned.  If Length 
+  This function first calculates the sum of the 64-bit values in the buffer
+  specified by Buffer and Length.  The carry bits in the result of addition
+  are dropped. Then, the two's complement of the sum is returned.  If Length
   is 0, then 0 is returned.
   is 0, then 0 is returned.
-  
+
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().
   If Length is not aligned on a 64-bit boundary, then ASSERT().
   If Buffer is NULL, then ASSERT().
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().
   If Length is not aligned on a 64-bit boundary, then ASSERT().
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
 
   @param  Buffer                       Pointer to the buffer to carry out the checksum operation.
   @param  Length           The size, in bytes, of Buffer.
 
   @param  Buffer                       Pointer to the buffer to carry out the checksum operation.
   @param  Length           The size, in bytes, of Buffer.
@@ -3429,10 +3429,14 @@ CpuFlushTlb (
 /**
   Transfers control to a function starting with a new stack.
 
 /**
   Transfers control to a function starting with a new stack.
 
-  Transfers control to the function specified by EntryPoint using the new stack
-  specified by NewStack and passing in the parameters specified by Context1 and
-  Context2. Context1 and Context2 are optional and may be NULL. The function
-  EntryPoint must never return.
+  Transfers control to the function specified by EntryPoint using the
+  new stack specified by NewStack and passing in the parameters specified
+  by Context1 and Context2.  Context1 and Context2 are optional and may
+  be NULL.  The function EntryPoint must never return.  This function
+  supports a variable number of arguments following the NewStack parameter.
+  These additional arguments are ignored on IA-32, x64, and EBC.
+  IPF CPUs expect one additional parameter of type VOID * that specifies
+  the new backing store pointer.
 
   If EntryPoint is NULL, then ASSERT().
   If NewStack is NULL, then ASSERT().
 
   If EntryPoint is NULL, then ASSERT().
   If NewStack is NULL, then ASSERT().
@@ -3452,7 +3456,8 @@ SwitchStack (
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
   IN      VOID                      *Context1,  OPTIONAL
   IN      VOID                      *Context2,  OPTIONAL
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
   IN      VOID                      *Context1,  OPTIONAL
   IN      VOID                      *Context2,  OPTIONAL
-  IN      VOID                      *NewStack
+  IN      VOID                      *NewStack,
+  ...
   );
 
 /**
   );
 
 /**
@@ -5666,38 +5671,6 @@ AsmPrepareAndThunk16 (
   IN OUT  THUNK_CONTEXT             *ThunkContext
   );
 
   IN OUT  THUNK_CONTEXT             *ThunkContext
   );
 
-/**
-  Transfers control to a function starting with a new stack.
-
-  Transfers control to the function specified by EntryPoint using the new stack
-  specified by NewStack and passing in the parameters specified by Context1 and
-  Context2. Context1 and Context2 are optional and may be NULL. The function
-  EntryPoint must never return.
-
-  If EntryPoint is NULL, then ASSERT().
-  If NewStack is NULL, then ASSERT().
-
-  @param  EntryPoint  A pointer to function to call with the new stack.
-  @param  Context1    A pointer to the context to pass into the EntryPoint
-                      function.
-  @param  Context2    A pointer to the context to pass into the EntryPoint
-                      function.
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint
-                      function.
-  @param  NewBsp      A pointer to the new memory location for RSE backing
-                      store.
-
-**/
-VOID
-EFIAPI
-AsmSwitchStackAndBackingStore (
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
-  IN      VOID                      *Context1,  OPTIONAL
-  IN      VOID                      *Context2,  OPTIONAL
-  IN      VOID                      *NewStack,
-  IN      VOID                      *NewBsp
-  );
-
 typedef struct {
   UINT64                            Status;
   UINT64                            r9;
 typedef struct {
   UINT64                            Status;
   UINT64                            r9;
@@ -5751,21 +5724,21 @@ IpfReadItc (
 
 
 /**
 
 
 /**
-  Flush a range of  cache lines in the cache coherency domain of the calling 
+  Flush a range of  cache lines in the cache coherency domain of the calling
   CPU.
 
   CPU.
 
-  Invalidates the  cache lines specified by Address and Length. If Address is 
-  not aligned on a cache line boundary, then entire cache line containing 
-  Address is invalidated. If Address + Length is not aligned on a cache line 
+  Invalidates the  cache lines specified by Address and Length. If Address is
+  not aligned on a cache line boundary, then entire cache line containing
+  Address is invalidated. If Address + Length is not aligned on a cache line
   boundary, then the entire instruction cache line containing Address + Length
   boundary, then the entire instruction cache line containing Address + Length
-  -1 is invalidated. This function may choose to invalidate the entire 
-  instruction cache if that is more efficient than invalidating the specified 
-  range. If Length is 0, the no instruction cache lines are invalidated. 
+  -1 is invalidated. This function may choose to invalidate the entire
+  instruction cache if that is more efficient than invalidating the specified
+  range. If Length is 0, the no instruction cache lines are invalidated.
   Address is returned.
 
   If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
 
   Address is returned.
 
   If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
 
-  @param  Address The base address of the instruction lines to invalidate. If 
+  @param  Address The base address of the instruction lines to invalidate. If
                   the CPU is in a physical addressing mode, then Address is a
                   physical address. If the CPU is in a virtual addressing mode,
                   then Address is a virtual address.
                   the CPU is in a physical addressing mode, then Address is a
                   physical address. If the CPU is in a virtual addressing mode,
                   then Address is a virtual address.
index 185810f397ab3113eace13cc3851312a064f1ef8..99ba05a87086530ef36dab3447a82b7761f7093e 100644 (file)
     <Filename SupArchList="IPF">Ipf/CpuPause.s</Filename>
     <Filename SupArchList="IPF">Ipf/CpuFlushTlb.s</Filename>
     <Filename SupArchList="IPF">Ipf/GetInterruptState.s</Filename>
     <Filename SupArchList="IPF">Ipf/CpuPause.s</Filename>
     <Filename SupArchList="IPF">Ipf/CpuFlushTlb.s</Filename>
     <Filename SupArchList="IPF">Ipf/GetInterruptState.s</Filename>
-    <Filename SupArchList="IPF">Ipf/Non-existing.c</Filename>
+    <Filename SupArchList="IPF">Ipf/InternalSwitchStack.c</Filename>
     <Filename SupArchList="IPF">Ipf/FlushCacheRange.s</Filename>
     <Filename SupArchList="IPF">Ipf/ReadItc.s</Filename>
 
     <Filename SupArchList="IPF">Ipf/FlushCacheRange.s</Filename>
     <Filename SupArchList="IPF">Ipf/ReadItc.s</Filename>
 
index 8c55cdc6a92ef676df5ab2998f1dbd7453a5a9b1..5160513033f186bd9413e27e38302bf9d9d404b3 100644 (file)
@@ -314,10 +314,16 @@ InternalMathDivRemS64x64 (
 /**
   Transfers control to a function starting with a new stack.
 
 /**
   Transfers control to a function starting with a new stack.
 
-  Transfers control to the function specified by EntryPoint using the new stack
-  specified by NewStack and passing in the parameters specified by Context1 and
-  Context2. Context1 and Context2 are optional and may be NULL. The function
-  EntryPoint must never return.
+  Transfers control to the function specified by EntryPoint using the
+  new stack specified by NewStack and passing in the parameters specified
+  by Context1 and Context2.  Context1 and Context2 are optional and may
+  be NULL.  The function EntryPoint must never return.
+  Marker will be ignored on IA-32, x64, and EBC.
+  IPF CPUs expect one additional parameter of type VOID * that specifies
+  the new backing store pointer.
+
+  If EntryPoint is NULL, then ASSERT().
+  If NewStack is NULL, then ASSERT().
 
   @param  EntryPoint  A pointer to function to call with the new stack.
   @param  Context1    A pointer to the context to pass into the EntryPoint
 
   @param  EntryPoint  A pointer to function to call with the new stack.
   @param  Context1    A pointer to the context to pass into the EntryPoint
@@ -326,15 +332,17 @@ InternalMathDivRemS64x64 (
                       function.
   @param  NewStack    A pointer to the new stack to use for the EntryPoint
                       function.
                       function.
   @param  NewStack    A pointer to the new stack to use for the EntryPoint
                       function.
+  @param  Marker      VA_LIST marker for the variable argument list.
 
 **/
 VOID
 EFIAPI
 InternalSwitchStack (
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
 
 **/
 VOID
 EFIAPI
 InternalSwitchStack (
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
-  IN      VOID                      *Context1,
-  IN      VOID                      *Context2,
-  IN      VOID                      *NewStack
+  IN      VOID                      *Context1,   OPTIONAL
+  IN      VOID                      *Context2,   OPTIONAL
+  IN      VOID                      *NewStack,
+  IN      VA_LIST                   Marker
   );
 
 //
   );
 
 //
@@ -656,9 +664,9 @@ InternalSyncDecrement (
   Performs an atomic compare exchange operation on a 32-bit unsigned integer.
 
   Performs an atomic compare exchange operation on the 32-bit unsigned integer
   Performs an atomic compare exchange operation on a 32-bit unsigned integer.
 
   Performs an atomic compare exchange operation on the 32-bit unsigned integer
-  specified by Value.  If Value is equal to CompareValue, then Value is set to 
+  specified by Value.  If Value is equal to CompareValue, then Value is set to
   ExchangeValue and CompareValue is returned.  If Value is not equal to CompareValue,
   ExchangeValue and CompareValue is returned.  If Value is not equal to CompareValue,
-  then Value is returned.  The compare exchange operation must be performed using 
+  then Value is returned.  The compare exchange operation must be performed using
   MP safe mechanisms.
 
   @param  Value         A pointer to the 32-bit value for the compare exchange
   MP safe mechanisms.
 
   @param  Value         A pointer to the 32-bit value for the compare exchange
@@ -680,9 +688,9 @@ InternalSyncCompareExchange32 (
 /**
   Performs an atomic compare exchange operation on a 64-bit unsigned integer.
 
 /**
   Performs an atomic compare exchange operation on a 64-bit unsigned integer.
 
-  Performs an atomic compare exchange operation on the 64-bit unsigned integer specified 
-  by Value.  If Value is equal to CompareValue, then Value is set to ExchangeValue and 
-  CompareValue is returned.  If Value is not equal to CompareValue, then Value is returned. 
+  Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
+  by Value.  If Value is equal to CompareValue, then Value is set to ExchangeValue and
+  CompareValue is returned.  If Value is not equal to CompareValue, then Value is returned.
   The compare exchange operation must be performed using MP safe mechanisms.
 
   @param  Value         A pointer to the 64-bit value for the compare exchange
   The compare exchange operation must be performed using MP safe mechanisms.
 
   @param  Value         A pointer to the 64-bit value for the compare exchange
@@ -721,7 +729,7 @@ BitFieldReadUint (
   );
 
 /**
   );
 
 /**
-  Worker function that reads a bit field from Operand, performs a bitwise OR, 
+  Worker function that reads a bit field from Operand, performs a bitwise OR,
   and returns the result.
 
   Performs a bitwise OR between the bit field specified by StartBit and EndBit
   and returns the result.
 
   Performs a bitwise OR between the bit field specified by StartBit and EndBit
@@ -745,7 +753,7 @@ BitFieldOrUint (
   );
 
 /**
   );
 
 /**
-  Worker function that reads a bit field from Operand, performs a bitwise AND, 
+  Worker function that reads a bit field from Operand, performs a bitwise AND,
   and returns the result.
 
   Performs a bitwise AND between the bit field specified by StartBit and EndBit
   and returns the result.
 
   Performs a bitwise AND between the bit field specified by StartBit and EndBit
@@ -784,6 +792,7 @@ InternalAssertJumpBuffer (
   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer
   );
 
   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer
   );
 
+
 /**
   Restores the CPU context that was saved with SetJump().
 
 /**
   Restores the CPU context that was saved with SetJump().
 
@@ -802,4 +811,41 @@ InternalLongJump (
   IN      UINTN                     Value
   );
 
   IN      UINTN                     Value
   );
 
+
+//
+// IPF specific functions
+//
+
+/**
+  Transfers control to a function starting with a new stack.
+
+  Transfers control to the function specified by EntryPoint using the new stack
+  specified by NewStack and passing in the parameters specified by Context1 and
+  Context2. Context1 and Context2 are optional and may be NULL. The function
+  EntryPoint must never return.
+
+  If EntryPoint is NULL, then ASSERT().
+  If NewStack is NULL, then ASSERT().
+
+  @param  EntryPoint  A pointer to function to call with the new stack.
+  @param  Context1    A pointer to the context to pass into the EntryPoint
+                      function.
+  @param  Context2    A pointer to the context to pass into the EntryPoint
+                      function.
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint
+                      function.
+  @param  NewBsp      A pointer to the new memory location for RSE backing
+                      store.
+
+**/
+VOID
+EFIAPI
+AsmSwitchStackAndBackingStore (
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
+  IN      VOID                      *Context1,  OPTIONAL
+  IN      VOID                      *Context2,  OPTIONAL
+  IN      VOID                      *NewStack,
+  IN      VOID                      *NewBsp
+  );
+
 #endif
 #endif
index 8fadd4f384a53dc1666421f6fbe9cd2647d6cb24..d2861c4f850e5fece7ab18124186363c281e0df1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Switch Stack functions.\r
 \r
 /** @file\r
   Switch Stack functions.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
 /**\r
   Transfers control to a function starting with a new stack.\r
 \r
 /**\r
   Transfers control to a function starting with a new stack.\r
 \r
-  Transfers control to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
+  Transfers control to the function specified by EntryPoint using the\r
+  new stack specified by NewStack and passing in the parameters specified\r
+  by Context1 and Context2.  Context1 and Context2 are optional and may\r
+  be NULL.  The function EntryPoint must never return.\r
+  Marker will be ignored on IA-32, x64, and EBC.\r
+  IPF CPUs expect one additional parameter of type VOID * that specifies\r
+  the new backing store pointer.\r
 \r
   If EntryPoint is NULL, then ASSERT().\r
   If NewStack is NULL, then ASSERT().\r
 \r
   If EntryPoint is NULL, then ASSERT().\r
   If NewStack is NULL, then ASSERT().\r
                       function.\r
   @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
                       function.\r
                       function.\r
   @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
                       function.\r
+  @param  Marker      VA_LIST marker for the variable argument list.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 InternalSwitchStack (\r
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 InternalSwitchStack (\r
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack\r
+  IN      VOID                      *Context1,   OPTIONAL\r
+  IN      VOID                      *Context2,   OPTIONAL\r
+  IN      VOID                      *NewStack,\r
+  IN      VA_LIST                   Marker\r
   )\r
   )\r
+\r
 {\r
   //\r
   // This version of this function does not actually change the stack pointer\r
   // This is to support compilation of CPU types that do not support assemblers\r
   // such as EBC\r
   //\r
 {\r
   //\r
   // This version of this function does not actually change the stack pointer\r
   // This is to support compilation of CPU types that do not support assemblers\r
   // such as EBC\r
   //\r
+\r
+  //\r
+  // Stack should be aligned with CPU_STACK_ALIGNMENT\r
+  //\r
+  ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);\r
+\r
   EntryPoint (Context1, Context2);\r
 }\r
   EntryPoint (Context1, Context2);\r
 }\r
index ab8116b4b5a882236fc2eff75b0a663eff0e33e3..c918f9f5718338ce72185525a707fad3f16e3a00 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   SwitchStack() function for IA-32.\r
 \r
 /** @file\r
   SwitchStack() function for IA-32.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
 /**\r
   Transfers control to a function starting with a new stack.\r
 \r
 /**\r
   Transfers control to a function starting with a new stack.\r
 \r
-  Transfers control to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
+  Transfers control to the function specified by EntryPoint using the\r
+  new stack specified by NewStack and passing in the parameters specified\r
+  by Context1 and Context2.  Context1 and Context2 are optional and may\r
+  be NULL.  The function EntryPoint must never return.\r
+  Marker will be ignored on IA-32, x64, and EBC.\r
+  IPF CPUs expect one additional parameter of type VOID * that specifies\r
+  the new backing store pointer.\r
+\r
+  If EntryPoint is NULL, then ASSERT().\r
+  If NewStack is NULL, then ASSERT().\r
 \r
   @param  EntryPoint  A pointer to function to call with the new stack.\r
   @param  Context1    A pointer to the context to pass into the EntryPoint\r
 \r
   @param  EntryPoint  A pointer to function to call with the new stack.\r
   @param  Context1    A pointer to the context to pass into the EntryPoint\r
                       function.\r
   @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
                       function.\r
                       function.\r
   @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
                       function.\r
+  @param  Marker      VA_LIST marker for the variable argument list.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 InternalSwitchStack (\r
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 InternalSwitchStack (\r
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,\r
-  IN      VOID                      *Context2,\r
-  IN      VOID                      *NewStack\r
+  IN      VOID                      *Context1,   OPTIONAL\r
+  IN      VOID                      *Context2,   OPTIONAL\r
+  IN      VOID                      *NewStack,\r
+  IN      VA_LIST                   Marker\r
   )\r
 {\r
   BASE_LIBRARY_JUMP_BUFFER  JumpBuffer;\r
 \r
   )\r
 {\r
   BASE_LIBRARY_JUMP_BUFFER  JumpBuffer;\r
 \r
+  //\r
+  // Stack should be aligned with CPU_STACK_ALIGNMENT\r
+  //\r
+  ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);\r
+\r
   JumpBuffer.Eip = (UINTN)EntryPoint;\r
   JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);\r
   JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2);\r
   JumpBuffer.Eip = (UINTN)EntryPoint;\r
   JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);\r
   JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2);\r
diff --git a/MdePkg/Library/BaseLib/Ipf/InternalSwitchStack.c b/MdePkg/Library/BaseLib/Ipf/InternalSwitchStack.c
new file mode 100644 (file)
index 0000000..60d0a37
--- /dev/null
@@ -0,0 +1,68 @@
+/** @file\r
+  SwitchStack() function for IPF.\r
+\r
+  Copyright (c) 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  InternalSwitchStack.c\r
+\r
+**/\r
+\r
+#include <BaseLibInternals.h>\r
+\r
+/**
+  Transfers control to a function starting with a new stack.
+
+  Transfers control to the function specified by EntryPoint using the
+  new stack specified by NewStack and passing in the parameters specified
+  by Context1 and Context2.  Context1 and Context2 are optional and may
+  be NULL.  The function EntryPoint must never return.
+  Marker will be ignored on IA-32, x64, and EBC.
+  IPF CPUs expect one additional parameter of type VOID * that specifies
+  the new backing store pointer.\r
+
+  If EntryPoint is NULL, then ASSERT().\r
+  If NewStack is NULL, then ASSERT().\r
+
+  @param  EntryPoint  A pointer to function to call with the new stack.
+  @param  Context1    A pointer to the context to pass into the EntryPoint
+                      function.
+  @param  Context2    A pointer to the context to pass into the EntryPoint
+                      function.
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint
+                      function.\r
+  @param  Marker      VA_LIST marker for the variable argument list.
+
+**/\r
+VOID
+EFIAPI
+InternalSwitchStack (
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
+  IN      VOID                      *Context1,   OPTIONAL
+  IN      VOID                      *Context2,   OPTIONAL
+  IN      VOID                      *NewStack,
+  IN      VA_LIST                   Marker
+  )\r
+\r
+{\r
+  VOID                      *NewBsp;\r
+\r
+  //\r
+  // Get new backing store pointer from variable list\r
+  //\r
+  NewBsp   = VA_ARG (Marker, VOID *);\r
+\r
+  //\r
+  // Stack should be aligned with CPU_STACK_ALIGNMENT\r
+  //\r
+  ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);\r
+  ASSERT (((UINTN)NewBsp & (CPU_STACK_ALIGNMENT - 1)) == 0);\r
+\r
+  AsmSwitchStackAndBackingStore (EntryPoint, Context1, Context2, NewStack, NewBsp);\r
+}\r
diff --git a/MdePkg/Library/BaseLib/Ipf/Non-existing.c b/MdePkg/Library/BaseLib/Ipf/Non-existing.c
deleted file mode 100644 (file)
index bbb5bdf..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/** @file\r
-  Non-existing BaseLib functions on Ipf\r
-\r
-  Copyright (c) 2006, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  Non-existing.c\r
-\r
-**/\r
-\r
-#include "../BaseLibInternals.h"\r
-/**\r
-  Transfers control to a function starting with a new stack.\r
-\r
-  Transfers control to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
-\r
-  If EntryPoint is NULL, then ASSERT().\r
-  If NewStack is NULL, then ASSERT().\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalSwitchStack (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack\r
-  )\r
-{\r
-  //\r
-  // This version of this function does not actually change the stack pointer\r
-  // This is to support compilation of CPU types that do not support assemblers\r
-  // such as EBC\r
-  //\r
-  ASSERT (FALSE);\r
-}\r
index 98d832dfd6746dd71d4a84e2e79479e19296ee85..6b8d7af4b67a4c94cd54a2c2064c8500131be0ab 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Switch Stack functions.\r
 \r
 /** @file\r
   Switch Stack functions.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
 /**\r
   Transfers control to a function starting with a new stack.\r
 \r
 /**\r
   Transfers control to a function starting with a new stack.\r
 \r
-  Transfers control to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
+  Transfers control to the function specified by EntryPoint using the\r
+  new stack specified by NewStack and passing in the parameters specified\r
+  by Context1 and Context2.  Context1 and Context2 are optional and may\r
+  be NULL.  The function EntryPoint must never return.  This function\r
+  supports a variable number of arguments following the NewStack parameter.\r
+  These additional arguments are ignored on IA-32, x64, and EBC.\r
+  IPF CPUs expect one additional parameter of type VOID * that specifies\r
+  the new backing store pointer.\r
 \r
   If EntryPoint is NULL, then ASSERT().\r
   If NewStack is NULL, then ASSERT().\r
 \r
   If EntryPoint is NULL, then ASSERT().\r
   If NewStack is NULL, then ASSERT().\r
-  For IPF CPUs, if NewStack is not aligned on a 16-byte boundary, then ASSERT().\r
 \r
   @param  EntryPoint  A pointer to function to call with the new stack.\r
   @param  Context1    A pointer to the context to pass into the EntryPoint\r
 \r
   @param  EntryPoint  A pointer to function to call with the new stack.\r
   @param  Context1    A pointer to the context to pass into the EntryPoint\r
@@ -41,16 +44,19 @@ VOID
 EFIAPI\r
 SwitchStack (\r
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
 EFIAPI\r
 SwitchStack (\r
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,\r
-  IN      VOID                      *Context2,\r
-  IN      VOID                      *NewStack\r
+  IN      VOID                      *Context1,  OPTIONAL\r
+  IN      VOID                      *Context2,  OPTIONAL\r
+  IN      VOID                      *NewStack,\r
+  ...\r
   )\r
 {\r
   )\r
 {\r
+  VA_LIST    Marker;\r
+\r
   ASSERT (EntryPoint != NULL && NewStack != NULL);\r
 \r
   ASSERT (EntryPoint != NULL && NewStack != NULL);\r
 \r
-#ifdef MDE_CPU_IPF\r
-  ASSERT (((UINTN)NewStack & 0xf) == 0);\r
-#endif\r
+  VA_START (Marker, NewStack);\r
+\r
+  InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker);\r
 \r
 \r
-  InternalSwitchStack (EntryPoint, Context1, Context2, NewStack);\r
+  VA_END (Marker);\r
 }\r
 }\r