summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/CpuDxe/CpuMp.h
diff options
context:
space:
mode:
authorChen Fan <chen.fan.fnst@cn.fujitsu.com>2014-11-13 18:26:23 +0000
committerjljusten <jljusten@Edk2>2014-11-13 18:26:23 +0000
commit03673ae11e255b9467e8f317175495b1ff79f965 (patch)
tree4e0532b69a323c99a8b41ba2cc9460278a9c0635 /UefiCpuPkg/CpuDxe/CpuMp.h
parent003973d98cf1ef84ab810cb4f3870acd3a7f40a6 (diff)
downloadedk2-03673ae11e255b9467e8f317175495b1ff79f965.tar.gz
edk2-03673ae11e255b9467e8f317175495b1ff79f965.tar.bz2
edk2-03673ae11e255b9467e8f317175495b1ff79f965.zip
UefiCpuPkg/CpuDxe: introduce MP_SYSTEM_DATA for Mp Service Protocol
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16353 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UefiCpuPkg/CpuDxe/CpuMp.h')
-rw-r--r--UefiCpuPkg/CpuDxe/CpuMp.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/UefiCpuPkg/CpuDxe/CpuMp.h b/UefiCpuPkg/CpuDxe/CpuMp.h
index 157ac36c48..481f7b1618 100644
--- a/UefiCpuPkg/CpuDxe/CpuMp.h
+++ b/UefiCpuPkg/CpuDxe/CpuMp.h
@@ -16,6 +16,7 @@
#define _CPU_MP_H_
#include <Protocol/MpService.h>
+#include <Library/SynchronizationLib.h>
/**
Initialize Multi-processor support.
@@ -77,5 +78,51 @@ 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;
+} CPU_DATA_BLOCK;
+
+/**
+ Define MP data block which consumes individual processor block.
+
+**/
+typedef struct {
+ CPU_DATA_BLOCK *CpuDatas;
+ UINTN NumberOfProcessors;
+ UINTN NumberOfEnabledProcessors;
+} 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
+ );
+
#endif // _CPU_MP_H_