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 | ||
887810c8 JF |
63 | |
64 | /** | |
65 | This return the handle number for the calling processor. This service may be | |
66 | called from the BSP and APs. | |
67 | ||
68 | This service returns the processor handle number for the calling processor. | |
69 | The returned value is in the range from 0 to the total number of logical | |
70 | processors minus 1. The total number of logical processors can be retrieved | |
71 | with EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors(). This service may be | |
72 | called from the BSP and APs. If ProcessorNumber is NULL, then EFI_INVALID_PARAMETER | |
73 | is returned. Otherwise, the current processors handle number is returned in | |
74 | ProcessorNumber, and EFI_SUCCESS is returned. | |
75 | ||
76 | @param[in] PeiServices An indirect pointer to the PEI Services Table | |
77 | published by the PEI Foundation. | |
78 | @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance. | |
79 | @param[out] ProcessorNumber The handle number of the AP. The range is from 0 to the | |
80 | total number of logical processors minus 1. The total | |
81 | number of logical processors can be retrieved by | |
82 | EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors(). | |
83 | ||
84 | @retval EFI_SUCCESS The current processor handle number was returned in | |
85 | ProcessorNumber. | |
86 | @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL. | |
87 | **/ | |
88 | EFI_STATUS | |
89 | EFIAPI | |
90 | PeiWhoAmI ( | |
91 | IN CONST EFI_PEI_SERVICES **PeiServices, | |
92 | IN EFI_PEI_MP_SERVICES_PPI *This, | |
93 | OUT UINTN *ProcessorNumber | |
94 | ); | |
95 | ||
96 | #endif |