X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=UefiCpuPkg%2FCpuDxe%2FCpuMp.h;h=d530149d7e00964bbdd9ce975e6196c830541b15;hp=2b3b9b23d4c28bdf50289f902b66cc2f55814088;hb=147fd35c3e389ecd025dbfd243312bf5b22da7c9;hpb=5fee172fb75ba07df4638abfd0cfc0ce83fc1073 diff --git a/UefiCpuPkg/CpuDxe/CpuMp.h b/UefiCpuPkg/CpuDxe/CpuMp.h index 2b3b9b23d4..d530149d7e 100644 --- a/UefiCpuPkg/CpuDxe/CpuMp.h +++ b/UefiCpuPkg/CpuDxe/CpuMp.h @@ -1,7 +1,7 @@ /** @file CPU DXE MP support - Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2016, 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 @@ -15,9 +15,6 @@ #ifndef _CPU_MP_H_ #define _CPU_MP_H_ -#include -#include - /** Initialize Multi-processor support. @@ -27,120 +24,6 @@ InitializeMpSupport ( VOID ); -typedef -VOID -(EFIAPI *STACKLESS_AP_ENTRY_POINT)( - VOID - ); - -/** - Starts the Application Processors and directs them to jump to the - specified routine. - - The processor jumps to this code in flat mode, but the processor's - stack is not initialized. - - @param ApEntryPoint Pointer to the Entry Point routine - - @retval EFI_SUCCESS The APs were started - @retval EFI_OUT_OF_RESOURCES Cannot allocate memory to start APs - -**/ -EFI_STATUS -StartApsStackless ( - IN STACKLESS_AP_ENTRY_POINT ApEntryPoint - ); - -/** - The AP entry point that the Startup-IPI target code will jump to. - - The processor jumps to this code in flat mode, but the processor's - stack is not initialized. - -**/ -VOID -EFIAPI -AsmApEntryPoint ( - VOID - ); - -/** - Releases the lock preventing other APs from using the shared AP - stack. - - Once the AP has transitioned to using a new stack, it can call this - function to allow another AP to proceed with using the shared stack. - -**/ -VOID -EFIAPI -AsmApDoneWithCommonStack ( - VOID - ); - -typedef enum { - CpuStateIdle, - CpuStateBlocked, - CpuStateReady, - CpuStateBuzy, - CpuStateFinished -} CPU_STATE; - -/** - Define Individual Processor Data block. - -**/ -typedef struct { - EFI_PROCESSOR_INFORMATION Info; - SPIN_LOCK CpuDataLock; - volatile CPU_STATE State; - - EFI_AP_PROCEDURE Procedure; - VOID *Parameter; - BOOLEAN *Finished; - INTN Timeout; - EFI_EVENT WaitEvent; - BOOLEAN TimeoutActive; - EFI_EVENT CheckThisAPEvent; -} CPU_DATA_BLOCK; - -/** - Define MP data block which consumes individual processor block. - -**/ -typedef struct { - CPU_DATA_BLOCK *CpuDatas; - UINTN NumberOfProcessors; - UINTN NumberOfEnabledProcessors; - - EFI_AP_PROCEDURE Procedure; - VOID *ProcedureArgument; - UINTN StartCount; - UINTN FinishCount; - BOOLEAN SingleThread; - UINTN **FailedList; - UINTN FailedListIndex; - INTN Timeout; - EFI_EVENT WaitEvent; - BOOLEAN TimeoutActive; - EFI_EVENT CheckAllAPsEvent; -} MP_SYSTEM_DATA; - -/** - This function is called by all processors (both BSP and AP) once and collects MP related data. - - @param Bsp TRUE if the CPU is BSP - @param ProcessorNumber The specific processor number - - @retval EFI_SUCCESS Data for the processor collected and filled in - -**/ -EFI_STATUS -FillInProcessorInformation ( - IN BOOLEAN Bsp, - IN UINTN ProcessorNumber - ); - /** This service retrieves the number of logical processor in the platform and the number of those logical processors that are enabled on this boot. @@ -465,6 +348,49 @@ StartupThisAP ( OUT BOOLEAN *Finished OPTIONAL ); +/** + This service switches the requested AP to be the BSP from that point onward. + This service changes the BSP for all purposes. This call can only be performed + by the current BSP. + + This service switches the requested AP to be the BSP from that point onward. + This service changes the BSP for all purposes. The new BSP can take over the + execution of the old BSP and continue seamlessly from where the old one left + off. This service may not be supported after the UEFI Event EFI_EVENT_GROUP_READY_TO_BOOT + is signaled. + + If the BSP cannot be switched prior to the return from this service, then + EFI_UNSUPPORTED must be returned. + + @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL instance. + @param[in] ProcessorNumber The handle number of AP that is to become the new + BSP. The range is from 0 to the total number of + logical processors minus 1. The total number of + logical processors can be retrieved by + EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors(). + @param[in] EnableOldBSP If TRUE, then the old BSP will be listed as an + enabled AP. Otherwise, it will be disabled. + + @retval EFI_SUCCESS BSP successfully switched. + @retval EFI_UNSUPPORTED Switching the BSP cannot be completed prior to + this service returning. + @retval EFI_UNSUPPORTED Switching the BSP is not supported. + @retval EFI_DEVICE_ERROR The calling processor is an AP. + @retval EFI_NOT_FOUND The processor with the handle specified by + ProcessorNumber does not exist. + @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the current BSP or + a disabled AP. + @retval EFI_NOT_READY The specified AP is busy. + +**/ +EFI_STATUS +EFIAPI +SwitchBSP ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN BOOLEAN EnableOldBSP + ); + /** This service lets the caller enable or disable an AP from this point onward. This service may only be called from the BSP. @@ -546,19 +472,5 @@ WhoAmI ( OUT UINTN *ProcessorNumber ); -/** - Terminate AP's task and set it to idle state. - - This function terminates AP's task due to timeout by sending INIT-SIPI, - and sends it to idle state. - - @param CpuData the pointer to CPU_DATA_BLOCK of specified AP - -**/ -VOID -ResetProcessorToIdleState ( - IN CPU_DATA_BLOCK *CpuData - ); - #endif // _CPU_MP_H_