X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseLib%2FSwitchStack.c;h=5dc21f547930f7ec42e7494f8907629645b3cb46;hb=0f6b6f755b09f5bb386bb41fa21cc75f58a624d2;hp=fec3cfaa60bb4cb55192557924e36eaa3aededcc;hpb=7d7c2b4640a6b46eed90af5777f8d22504519a8e;p=mirror_edk2.git diff --git a/MdePkg/Library/BaseLib/SwitchStack.c b/MdePkg/Library/BaseLib/SwitchStack.c index fec3cfaa60..5dc21f5479 100644 --- a/MdePkg/Library/BaseLib/SwitchStack.c +++ b/MdePkg/Library/BaseLib/SwitchStack.c @@ -1,7 +1,7 @@ /** @file Switch Stack functions. - Copyright (c) 2006, Intel Corporation
+ Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -19,10 +19,14 @@ /** 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(). @@ -40,12 +44,22 @@ VOID EFIAPI SwitchStack ( 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, + ... ) { + VA_LIST Marker; + ASSERT (EntryPoint != NULL && NewStack != NULL); - InternalSwitchStack (EntryPoint, Context1, Context2, NewStack); + VA_START (Marker, NewStack); + + InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker); + + // + // InternalSwitchStack () will never return + // + ASSERT (FALSE); }