]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuDxe/CpuMp.h
UefiCpuPkg/CpuDxe: implement Mp Protocol:GetNumberOfProcessors()
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / CpuMp.h
index 66bf04782708b4d8210def731199c7a8bce5ae1a..764db6a6f20f2edf0ef4d80349459112b32f13ff 100644 (file)
@@ -124,6 +124,50 @@ FillInProcessorInformation (
   IN     UINTN                ProcessorNumber\r
   );\r
 \r
+/**\r
+  This service retrieves the number of logical processor in the platform\r
+  and the number of those logical processors that are enabled on this boot.\r
+  This service may only be called from the BSP.\r
+\r
+  This function is used to retrieve the following information:\r
+    - The number of logical processors that are present in the system.\r
+    - The number of enabled logical processors in the system at the instant\r
+      this call is made.\r
+\r
+  Because MP Service Protocol provides services to enable and disable processors\r
+  dynamically, the number of enabled logical processors may vary during the\r
+  course of a boot session.\r
+\r
+  If this service is called from an AP, then EFI_DEVICE_ERROR is returned.\r
+  If NumberOfProcessors or NumberOfEnabledProcessors is NULL, then\r
+  EFI_INVALID_PARAMETER is returned. Otherwise, the total number of processors\r
+  is returned in NumberOfProcessors, the number of currently enabled processor\r
+  is returned in NumberOfEnabledProcessors, and EFI_SUCCESS is returned.\r
+\r
+  @param[in]  This                        A pointer to the EFI_MP_SERVICES_PROTOCOL\r
+                                          instance.\r
+  @param[out] NumberOfProcessors          Pointer to the total number of logical\r
+                                          processors in the system, including the BSP\r
+                                          and disabled APs.\r
+  @param[out] NumberOfEnabledProcessors   Pointer to the number of enabled logical\r
+                                          processors that exist in system, including\r
+                                          the BSP.\r
+\r
+  @retval EFI_SUCCESS             The number of logical processors and enabled\r
+                                  logical processors was retrieved.\r
+  @retval EFI_DEVICE_ERROR        The calling processor is an AP.\r
+  @retval EFI_INVALID_PARAMETER   NumberOfProcessors is NULL.\r
+  @retval EFI_INVALID_PARAMETER   NumberOfEnabledProcessors is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetNumberOfProcessors (\r
+  IN  EFI_MP_SERVICES_PROTOCOL  *This,\r
+  OUT UINTN                     *NumberOfProcessors,\r
+  OUT UINTN                     *NumberOfEnabledProcessors\r
+  );\r
+\r
 /**\r
   This return the handle number for the calling processor.  This service may be\r
   called from the BSP and APs.\r