]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuDxe/CpuMp.h
UefiCpuPkg/MpService: avoid reset AP still hold a lock
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / CpuMp.h
index a53ef52d93b4df44016abc9b416a55790b9f9a7c..5c892381ef8ba243eb9ffe9bfcc2a04890d8d25d 100644 (file)
@@ -40,15 +40,12 @@ VOID
   The processor jumps to this code in flat mode, but the processor's\r
   stack is not initialized.\r
 \r
-  @param ApEntryPoint    Pointer to the Entry Point routine\r
-\r
   @retval EFI_SUCCESS           The APs were started\r
-  @retval EFI_OUT_OF_RESOURCES  Cannot allocate memory to start APs\r
 \r
 **/\r
 EFI_STATUS\r
 StartApsStackless (\r
-  IN STACKLESS_AP_ENTRY_POINT ApEntryPoint\r
+  VOID\r
   );\r
 \r
 /**\r
@@ -93,6 +90,7 @@ typedef enum {
 typedef struct {\r
   EFI_PROCESSOR_INFORMATION      Info;\r
   SPIN_LOCK                      CpuDataLock;\r
+  INTN                           LockSelf;\r
   volatile CPU_STATE             State;\r
 \r
   EFI_AP_PROCEDURE               Procedure;\r
@@ -102,6 +100,7 @@ typedef struct {
   EFI_EVENT                      WaitEvent;\r
   BOOLEAN                        TimeoutActive;\r
   EFI_EVENT                      CheckThisAPEvent;\r
+  VOID                           *TopOfStack;\r
 } CPU_DATA_BLOCK;\r
 \r
 /**\r
@@ -603,5 +602,41 @@ ResetProcessorToIdleState (
   IN CPU_DATA_BLOCK  *CpuData\r
   );\r
 \r
+/**\r
+  Prepares Startup Code for APs.\r
+  This function prepares Startup Code for APs.\r
+\r
+  @retval EFI_SUCCESS           The APs were started\r
+  @retval EFI_OUT_OF_RESOURCES  Cannot allocate memory to start APs\r
+\r
+**/\r
+EFI_STATUS\r
+PrepareAPStartupCode (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Free the code buffer of startup AP.\r
+\r
+**/\r
+VOID\r
+FreeApStartupCode (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Resets the Application Processor and directs it to jump to the\r
+  specified routine.\r
+\r
+  The processor jumps to this code in flat mode, but the processor's\r
+  stack is not initialized.\r
+\r
+  @param ProcessorId           the AP of ProcessorId was reset\r
+**/\r
+VOID\r
+ResetApStackless (\r
+  IN UINT32 ProcessorId\r
+  );\r
+\r
 #endif // _CPU_MP_H_\r
 \r