]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/Library/MpInitLib/MpLib.c
UefiCpuPkg/MpInitLib: Add AsmRelocateApLoop() assembly code
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / MpLib.c
1 /** @file
2 CPU MP Initialize Library common functions.
3
4 Copyright (c) 2016, 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 #include "MpLib.h"
16
17
18 /**
19 MP Initialize Library initialization.
20
21 This service will allocate AP reset vector and wakeup all APs to do APs
22 initialization.
23
24 This service must be invoked before all other MP Initialize Library
25 service are invoked.
26
27 @retval EFI_SUCCESS MP initialization succeeds.
28 @retval Others MP initialization fails.
29
30 **/
31 EFI_STATUS
32 EFIAPI
33 MpInitLibInitialize (
34 VOID
35 )
36 {
37 return EFI_UNSUPPORTED;
38 }
39
40 /**
41 Gets detailed MP-related information on the requested processor at the
42 instant this call is made. This service may only be called from the BSP.
43
44 @param[in] ProcessorNumber The handle number of processor.
45 @param[out] ProcessorInfoBuffer A pointer to the buffer where information for
46 the requested processor is deposited.
47 @param[out] HealthData Return processor health data.
48
49 @retval EFI_SUCCESS Processor information was returned.
50 @retval EFI_DEVICE_ERROR The calling processor is an AP.
51 @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.
52 @retval EFI_NOT_FOUND The processor with the handle specified by
53 ProcessorNumber does not exist in the platform.
54 @retval EFI_NOT_READY MP Initialize Library is not initialized.
55
56 **/
57 EFI_STATUS
58 EFIAPI
59 MpInitLibGetProcessorInfo (
60 IN UINTN ProcessorNumber,
61 OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer,
62 OUT EFI_HEALTH_FLAGS *HealthData OPTIONAL
63 )
64 {
65 return EFI_UNSUPPORTED;
66 }
67 /**
68 This return the handle number for the calling processor. This service may be
69 called from the BSP and APs.
70
71 @param[out] ProcessorNumber Pointer to the handle number of AP.
72 The range is from 0 to the total number of
73 logical processors minus 1. The total number of
74 logical processors can be retrieved by
75 MpInitLibGetNumberOfProcessors().
76
77 @retval EFI_SUCCESS The current processor handle number was returned
78 in ProcessorNumber.
79 @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL.
80 @retval EFI_NOT_READY MP Initialize Library is not initialized.
81
82 **/
83 EFI_STATUS
84 EFIAPI
85 MpInitLibWhoAmI (
86 OUT UINTN *ProcessorNumber
87 )
88 {
89 return EFI_UNSUPPORTED;
90 }
91 /**
92 Retrieves the number of logical processor in the platform and the number of
93 those logical processors that are enabled on this boot. This service may only
94 be called from the BSP.
95
96 @param[out] NumberOfProcessors Pointer to the total number of logical
97 processors in the system, including the BSP
98 and disabled APs.
99 @param[out] NumberOfEnabledProcessors Pointer to the number of enabled logical
100 processors that exist in system, including
101 the BSP.
102
103 @retval EFI_SUCCESS The number of logical processors and enabled
104 logical processors was retrieved.
105 @retval EFI_DEVICE_ERROR The calling processor is an AP.
106 @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL and NumberOfEnabledProcessors
107 is NULL.
108 @retval EFI_NOT_READY MP Initialize Library is not initialized.
109
110 **/
111 EFI_STATUS
112 EFIAPI
113 MpInitLibGetNumberOfProcessors (
114 OUT UINTN *NumberOfProcessors, OPTIONAL
115 OUT UINTN *NumberOfEnabledProcessors OPTIONAL
116 )
117 {
118 return EFI_UNSUPPORTED;
119 }