Revision: 16356
http://sourceforge.net/p/edk2/code/16356
Author: jljusten
Date: 2014-11-13 18:26:53 +0000 (Thu, 13 Nov 2014)
Log Message:
-----------
UefiCpuPkg/CpuDxe: implement Mp Services:GetProcessorInfo()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <[email protected]>
Reviewed-by: Jeff Fan <[email protected]>
Modified Paths:
--------------
trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c
trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.h
Modified: trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c
===================================================================
--- trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c 2014-11-13 18:26:42 UTC (rev
16355)
+++ trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c 2014-11-13 18:26:53 UTC (rev
16356)
@@ -26,7 +26,7 @@
EFI_MP_SERVICES_PROTOCOL mMpServicesTemplate = {
GetNumberOfProcessors,
- NULL, // GetProcessorInfo,
+ GetProcessorInfo,
NULL, // StartupAllAPs,
NULL, // StartupThisAP,
NULL, // SwitchBSP,
@@ -115,6 +115,56 @@
}
/**
+ Gets detailed MP-related information on the requested processor at the
+ instant this call is made. This service may only be called from the BSP.
+
+ This service retrieves detailed MP-related information about any processor
+ on the platform. Note the following:
+ - The processor information may change during the course of a boot session.
+ - The information presented here is entirely MP related.
+
+ Information regarding the number of caches and their sizes, frequency of
operation,
+ slot numbers is all considered platform-related information and is not
provided
+ by this service.
+
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL
+ instance.
+ @param[in] ProcessorNumber The handle number of processor.
+ @param[out] ProcessorInfoBuffer A pointer to the buffer where information
for
+ the requested processor is deposited.
+
+ @retval EFI_SUCCESS Processor information was returned.
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.
+ @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.
+ @retval EFI_NOT_FOUND The processor with the handle specified by
+ ProcessorNumber does not exist in the
platform.
+
+**/
+EFI_STATUS
+EFIAPI
+GetProcessorInfo (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer
+ )
+{
+ if (ProcessorInfoBuffer == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ if (!IsBSP ()) {
+ return EFI_DEVICE_ERROR;
+ }
+
+ if (ProcessorNumber >= mMpSystemData.NumberOfProcessors) {
+ return EFI_NOT_FOUND;
+ }
+
+ CopyMem (ProcessorInfoBuffer, &mMpSystemData.CpuDatas[ProcessorNumber],
sizeof (EFI_PROCESSOR_INFORMATION));
+ return EFI_SUCCESS;
+}
+
+/**
This return the handle number for the calling processor. This service may be
called from the BSP and APs.
Modified: trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.h
===================================================================
--- trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.h 2014-11-13 18:26:42 UTC (rev
16355)
+++ trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.h 2014-11-13 18:26:53 UTC (rev
16356)
@@ -169,6 +169,40 @@
);
/**
+ Gets detailed MP-related information on the requested processor at the
+ instant this call is made. This service may only be called from the BSP.
+
+ This service retrieves detailed MP-related information about any processor
+ on the platform. Note the following:
+ - The processor information may change during the course of a boot session.
+ - The information presented here is entirely MP related.
+
+ Information regarding the number of caches and their sizes, frequency of
operation,
+ slot numbers is all considered platform-related information and is not
provided
+ by this service.
+
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL
+ instance.
+ @param[in] ProcessorNumber The handle number of processor.
+ @param[out] ProcessorInfoBuffer A pointer to the buffer where information
for
+ the requested processor is deposited.
+
+ @retval EFI_SUCCESS Processor information was returned.
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.
+ @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.
+ @retval EFI_NOT_FOUND The processor with the handle specified by
+ ProcessorNumber does not exist in the
platform.
+
+**/
+EFI_STATUS
+EFIAPI
+GetProcessorInfo (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer
+ );
+
+/**
This return the handle number for the calling processor. This service may be
called from the BSP and APs.
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits