Commit | Line | Data |
---|---|---|
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 | |
31 | EFI_STATUS\r | |
32 | EFIAPI\r | |
33 | MpInitLibInitialize (\r | |
34 | VOID\r | |
35 | )\r | |
36 | {\r | |
f7f85d83 JF |
37 | MP_ASSEMBLY_ADDRESS_MAP AddressMap;\r |
38 | UINTN ApResetVectorSize;\r | |
39 | \r | |
40 | AsmGetAddressMap (&AddressMap);\r | |
41 | ApResetVectorSize = AddressMap.RendezvousFunnelSize + sizeof (MP_CPU_EXCHANGE_INFO);\r | |
42 | return EFI_SUCCESS;\r | |
3e8ad6bd JF |
43 | }\r |
44 | \r | |
45 | /**\r | |
46 | Gets detailed MP-related information on the requested processor at the\r | |
47 | instant this call is made. This service may only be called from the BSP.\r | |
48 | \r | |
49 | @param[in] ProcessorNumber The handle number of processor.\r | |
50 | @param[out] ProcessorInfoBuffer A pointer to the buffer where information for\r | |
51 | the requested processor is deposited.\r | |
52 | @param[out] HealthData Return processor health data.\r | |
53 | \r | |
54 | @retval EFI_SUCCESS Processor information was returned.\r | |
55 | @retval EFI_DEVICE_ERROR The calling processor is an AP.\r | |
56 | @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.\r | |
57 | @retval EFI_NOT_FOUND The processor with the handle specified by\r | |
58 | ProcessorNumber does not exist in the platform.\r | |
59 | @retval EFI_NOT_READY MP Initialize Library is not initialized.\r | |
60 | \r | |
61 | **/\r | |
62 | EFI_STATUS\r | |
63 | EFIAPI\r | |
64 | MpInitLibGetProcessorInfo (\r | |
65 | IN UINTN ProcessorNumber,\r | |
66 | OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer,\r | |
67 | OUT EFI_HEALTH_FLAGS *HealthData OPTIONAL\r | |
68 | )\r | |
69 | {\r | |
70 | return EFI_UNSUPPORTED;\r | |
71 | }\r | |
72 | /**\r | |
73 | This return the handle number for the calling processor. This service may be\r | |
74 | called from the BSP and APs.\r | |
75 | \r | |
76 | @param[out] ProcessorNumber Pointer to the handle number of AP.\r | |
77 | The range is from 0 to the total number of\r | |
78 | logical processors minus 1. The total number of\r | |
79 | logical processors can be retrieved by\r | |
80 | MpInitLibGetNumberOfProcessors().\r | |
81 | \r | |
82 | @retval EFI_SUCCESS The current processor handle number was returned\r | |
83 | in ProcessorNumber.\r | |
84 | @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL.\r | |
85 | @retval EFI_NOT_READY MP Initialize Library is not initialized.\r | |
86 | \r | |
87 | **/\r | |
88 | EFI_STATUS\r | |
89 | EFIAPI\r | |
90 | MpInitLibWhoAmI (\r | |
91 | OUT UINTN *ProcessorNumber\r | |
92 | )\r | |
93 | {\r | |
94 | return EFI_UNSUPPORTED;\r | |
95 | }\r | |
96 | /**\r | |
97 | Retrieves the number of logical processor in the platform and the number of\r | |
98 | those logical processors that are enabled on this boot. This service may only\r | |
99 | be called from the BSP.\r | |
100 | \r | |
101 | @param[out] NumberOfProcessors Pointer to the total number of logical\r | |
102 | processors in the system, including the BSP\r | |
103 | and disabled APs.\r | |
104 | @param[out] NumberOfEnabledProcessors Pointer to the number of enabled logical\r | |
105 | processors that exist in system, including\r | |
106 | the BSP.\r | |
107 | \r | |
108 | @retval EFI_SUCCESS The number of logical processors and enabled\r | |
109 | logical processors was retrieved.\r | |
110 | @retval EFI_DEVICE_ERROR The calling processor is an AP.\r | |
111 | @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL and NumberOfEnabledProcessors\r | |
112 | is NULL.\r | |
113 | @retval EFI_NOT_READY MP Initialize Library is not initialized.\r | |
114 | \r | |
115 | **/\r | |
116 | EFI_STATUS\r | |
117 | EFIAPI\r | |
118 | MpInitLibGetNumberOfProcessors (\r | |
119 | OUT UINTN *NumberOfProcessors, OPTIONAL\r | |
120 | OUT UINTN *NumberOfEnabledProcessors OPTIONAL\r | |
121 | )\r | |
122 | {\r | |
123 | return EFI_UNSUPPORTED;\r | |
124 | }\r |