\r
**/\r
\r
+#include <BaseLibInternals.h>\r
+\r
/**\r
Transfers control to a function starting with a new stack.\r
\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
EFIAPI\r
SwitchStack (\r
IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
- IN VOID *Context1, OPTIONAL\r
- IN VOID *Context2, OPTIONAL\r
+ IN VOID *Context1,\r
+ IN VOID *Context2,\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
- EntryPoint (Context1, Context2);\r
+ ASSERT (EntryPoint != NULL && NewStack != NULL);\r
+\r
+#ifdef MDE_CPU_IPF\r
+ ASSERT (((UINTN)NewStack & 0xf) == 0);\r
+#endif\r
+\r
+ InternalSwitchStack (EntryPoint, Context1, Context2, NewStack);\r
}\r