\r
volatile UINTN mNumberOfProcessors;\r
\r
+/**\r
+ Application Processors do loop routine\r
+ after switch to its own stack.\r
+\r
+ @param Context1 A pointer to the context to pass into the function.\r
+ @param Context2 A pointer to the context to pass into the function.\r
+\r
+**/\r
+VOID\r
+ProcessorToIdleState (\r
+ IN VOID *Context1, OPTIONAL\r
+ IN VOID *Context2 OPTIONAL\r
+ )\r
+{\r
+ DEBUG ((DEBUG_INFO, "Ap apicid is %d\n", GetApicId ()));\r
+\r
+ AsmApDoneWithCommonStack ();\r
+\r
+ CpuSleep ();\r
+ CpuDeadLoop ();\r
+}\r
+\r
/**\r
Application Processor C code entry point.\r
\r
)\r
{\r
mNumberOfProcessors++;\r
+ mApStackStart = (UINT8*)mApStackStart + gApStackSize;\r
+\r
+ SwitchStack (\r
+ (SWITCH_STACK_ENTRY_POINT)(UINTN)ProcessorToIdleState,\r
+ NULL,\r
+ NULL,\r
+ mApStackStart);\r
}\r
\r
\r