UefiCpuPkg/MpInitLib: Add two instances PeiMpInitLib and DxeMpInitLib
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / MpLib.c
CommitLineData
3e8ad6bd
JF
1/** @file\r
2 CPU MP Initialize Library common functions.\r
3\r
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include "MpLib.h"\r
16\r
17\r
18/**\r
19 MP Initialize Library initialization.\r
20\r
21 This service will allocate AP reset vector and wakeup all APs to do APs\r
22 initialization.\r
23\r
24 This service must be invoked before all other MP Initialize Library\r
25 service are invoked.\r
26\r
27 @retval EFI_SUCCESS MP initialization succeeds.\r
28 @retval Others MP initialization fails.\r
29\r
30**/\r
31EFI_STATUS\r
32EFIAPI\r
33MpInitLibInitialize (\r
34 VOID\r
35 )\r
36{\r
37 return EFI_UNSUPPORTED;\r
38}\r
39\r
40/**\r
41 Gets detailed MP-related information on the requested processor at the\r
42 instant this call is made. This service may only be called from the BSP.\r
43\r
44 @param[in] ProcessorNumber The handle number of processor.\r
45 @param[out] ProcessorInfoBuffer A pointer to the buffer where information for\r
46 the requested processor is deposited.\r
47 @param[out] HealthData Return processor health data.\r
48\r
49 @retval EFI_SUCCESS Processor information was returned.\r
50 @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
51 @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.\r
52 @retval EFI_NOT_FOUND The processor with the handle specified by\r
53 ProcessorNumber does not exist in the platform.\r
54 @retval EFI_NOT_READY MP Initialize Library is not initialized.\r
55\r
56**/\r
57EFI_STATUS\r
58EFIAPI\r
59MpInitLibGetProcessorInfo (\r
60 IN UINTN ProcessorNumber,\r
61 OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer,\r
62 OUT EFI_HEALTH_FLAGS *HealthData OPTIONAL\r
63 )\r
64{\r
65 return EFI_UNSUPPORTED;\r
66}\r
67/**\r
68 This return the handle number for the calling processor. This service may be\r
69 called from the BSP and APs.\r
70\r
71 @param[out] ProcessorNumber Pointer to the handle number of AP.\r
72 The range is from 0 to the total number of\r
73 logical processors minus 1. The total number of\r
74 logical processors can be retrieved by\r
75 MpInitLibGetNumberOfProcessors().\r
76\r
77 @retval EFI_SUCCESS The current processor handle number was returned\r
78 in ProcessorNumber.\r
79 @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL.\r
80 @retval EFI_NOT_READY MP Initialize Library is not initialized.\r
81\r
82**/\r
83EFI_STATUS\r
84EFIAPI\r
85MpInitLibWhoAmI (\r
86 OUT UINTN *ProcessorNumber\r
87 )\r
88{\r
89 return EFI_UNSUPPORTED;\r
90}\r
91/**\r
92 Retrieves the number of logical processor in the platform and the number of\r
93 those logical processors that are enabled on this boot. This service may only\r
94 be called from the BSP.\r
95\r
96 @param[out] NumberOfProcessors Pointer to the total number of logical\r
97 processors in the system, including the BSP\r
98 and disabled APs.\r
99 @param[out] NumberOfEnabledProcessors Pointer to the number of enabled logical\r
100 processors that exist in system, including\r
101 the BSP.\r
102\r
103 @retval EFI_SUCCESS The number of logical processors and enabled\r
104 logical processors was retrieved.\r
105 @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
106 @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL and NumberOfEnabledProcessors\r
107 is NULL.\r
108 @retval EFI_NOT_READY MP Initialize Library is not initialized.\r
109\r
110**/\r
111EFI_STATUS\r
112EFIAPI\r
113MpInitLibGetNumberOfProcessors (\r
114 OUT UINTN *NumberOfProcessors, OPTIONAL\r
115 OUT UINTN *NumberOfEnabledProcessors OPTIONAL\r
116 )\r
117{\r
118 return EFI_UNSUPPORTED;\r
119}\r