]>
Commit | Line | Data |
---|---|---|
887810c8 JF |
1 | /** @file |
2 | Functions prototype of Multiple Processor PPI services. | |
3 | ||
4 | Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> | |
5 | This program and the accompanying materials | |
6 | are licensed and made available under the terms and conditions of the BSD License | |
7 | which accompanies this distribution. The full text of the license may be found at | |
8 | http://opensource.org/licenses/bsd-license.php | |
9 | ||
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | |
12 | ||
13 | **/ | |
14 | ||
15 | #ifndef _PEI_MP_SERVICES_H_ | |
16 | #define _PEI_MP_SERVICES_H_ | |
17 | ||
18 | #include "CpuMpPei.h" | |
19 | ||
a2cc8cae JF |
20 | /** |
21 | This service retrieves the number of logical processor in the platform | |
22 | and the number of those logical processors that are enabled on this boot. | |
23 | This service may only be called from the BSP. | |
24 | ||
25 | This function is used to retrieve the following information: | |
26 | - The number of logical processors that are present in the system. | |
27 | - The number of enabled logical processors in the system at the instant | |
28 | this call is made. | |
29 | ||
30 | Because MP Service Ppi provides services to enable and disable processors | |
31 | dynamically, the number of enabled logical processors may vary during the | |
32 | course of a boot session. | |
33 | ||
34 | If this service is called from an AP, then EFI_DEVICE_ERROR is returned. | |
35 | If NumberOfProcessors or NumberOfEnabledProcessors is NULL, then | |
36 | EFI_INVALID_PARAMETER is returned. Otherwise, the total number of processors | |
37 | is returned in NumberOfProcessors, the number of currently enabled processor | |
38 | is returned in NumberOfEnabledProcessors, and EFI_SUCCESS is returned. | |
39 | ||
40 | @param[in] PeiServices An indirect pointer to the PEI Services Table | |
41 | published by the PEI Foundation. | |
42 | @param[in] This Pointer to this instance of the PPI. | |
43 | @param[out] NumberOfProcessors Pointer to the total number of logical processors in | |
44 | the system, including the BSP and disabled APs. | |
45 | @param[out] NumberOfEnabledProcessors | |
46 | Number of processors in the system that are enabled. | |
47 | ||
48 | @retval EFI_SUCCESS The number of logical processors and enabled | |
49 | logical processors was retrieved. | |
50 | @retval EFI_DEVICE_ERROR The calling processor is an AP. | |
51 | @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL. | |
52 | NumberOfEnabledProcessors is NULL. | |
53 | **/ | |
54 | EFI_STATUS | |
55 | EFIAPI | |
56 | PeiGetNumberOfProcessors ( | |
57 | IN CONST EFI_PEI_SERVICES **PeiServices, | |
58 | IN EFI_PEI_MP_SERVICES_PPI *This, | |
59 | OUT UINTN *NumberOfProcessors, | |
60 | OUT UINTN *NumberOfEnabledProcessors | |
61 | ); | |
62 | ||
bf55f5b2 JF |
63 | /** |
64 | Gets detailed MP-related information on the requested processor at the | |
65 | instant this call is made. This service may only be called from the BSP. | |
66 | ||
67 | This service retrieves detailed MP-related information about any processor | |
68 | on the platform. Note the following: | |
69 | - The processor information may change during the course of a boot session. | |
70 | - The information presented here is entirely MP related. | |
71 | ||
72 | Information regarding the number of caches and their sizes, frequency of operation, | |
73 | slot numbers is all considered platform-related information and is not provided | |
74 | by this service. | |
75 | ||
76 | @param[in] PeiServices An indirect pointer to the PEI Services Table | |
77 | published by the PEI Foundation. | |
78 | @param[in] This Pointer to this instance of the PPI. | |
79 | @param[in] ProcessorNumber Pointer to the total number of logical processors in | |
80 | the system, including the BSP and disabled APs. | |
81 | @param[out] ProcessorInfoBuffer Number of processors in the system that are enabled. | |
82 | ||
83 | @retval EFI_SUCCESS Processor information was returned. | |
84 | @retval EFI_DEVICE_ERROR The calling processor is an AP. | |
85 | @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL. | |
86 | @retval EFI_NOT_FOUND The processor with the handle specified by | |
87 | ProcessorNumber does not exist in the platform. | |
88 | **/ | |
89 | EFI_STATUS | |
90 | EFIAPI | |
91 | PeiGetProcessorInfo ( | |
92 | IN CONST EFI_PEI_SERVICES **PeiServices, | |
93 | IN EFI_PEI_MP_SERVICES_PPI *This, | |
94 | IN UINTN ProcessorNumber, | |
95 | OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer | |
96 | ); | |
97 | ||
887810c8 JF |
98 | |
99 | /** | |
100 | This return the handle number for the calling processor. This service may be | |
101 | called from the BSP and APs. | |
102 | ||
103 | This service returns the processor handle number for the calling processor. | |
104 | The returned value is in the range from 0 to the total number of logical | |
105 | processors minus 1. The total number of logical processors can be retrieved | |
106 | with EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors(). This service may be | |
107 | called from the BSP and APs. If ProcessorNumber is NULL, then EFI_INVALID_PARAMETER | |
108 | is returned. Otherwise, the current processors handle number is returned in | |
109 | ProcessorNumber, and EFI_SUCCESS is returned. | |
110 | ||
111 | @param[in] PeiServices An indirect pointer to the PEI Services Table | |
112 | published by the PEI Foundation. | |
113 | @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance. | |
114 | @param[out] ProcessorNumber The handle number of the AP. The range is from 0 to the | |
115 | total number of logical processors minus 1. The total | |
116 | number of logical processors can be retrieved by | |
117 | EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors(). | |
118 | ||
119 | @retval EFI_SUCCESS The current processor handle number was returned in | |
120 | ProcessorNumber. | |
121 | @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL. | |
122 | **/ | |
123 | EFI_STATUS | |
124 | EFIAPI | |
125 | PeiWhoAmI ( | |
126 | IN CONST EFI_PEI_SERVICES **PeiServices, | |
127 | IN EFI_PEI_MP_SERVICES_PPI *This, | |
128 | OUT UINTN *ProcessorNumber | |
129 | ); | |
130 | ||
131 | #endif |