MdeModulePkg/Core/Dxe: Initialized CPU Architectural Protocol immediately after initializing GCD Services.

Initialized Multi-processor support after calling 
ProcessLibraryConstructorList() because of its dependency on TimerLib.
This commit is contained in:
Mikhail Krichanov 2023-05-26 12:13:55 +03:00 committed by MikhailKrichanov
parent 0369b4600c
commit 2f0024e283
5 changed files with 46 additions and 30 deletions

View File

@ -306,6 +306,24 @@ DxeMain (
Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength); Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
//
// Initialize the Event Services
//
Status = CoreInitializeEventServices ();
ASSERT_EFI_ERROR (Status);
//
// Register for the GUIDs of the Architectural Protocols, so the rest of the
// EFI Boot Services and EFI Runtime Services tables can be filled in.
// Also register for the GUIDs of optional protocols.
//
CoreNotifyOnProtocolInstallation ();
//
// Initialize CPU Architectural Protocol
//
InitializeCpu ();
// //
// Call constructor for all libraries // Call constructor for all libraries
// //
@ -313,6 +331,11 @@ DxeMain (
PERF_CROSSMODULE_END ("PEI"); PERF_CROSSMODULE_END ("PEI");
PERF_CROSSMODULE_BEGIN ("DXE"); PERF_CROSSMODULE_BEGIN ("DXE");
//
// Initialize Multi-processor support
//
InitializeMpSupport ();
// //
// Log MemoryBaseAddress and MemoryLength again (from // Log MemoryBaseAddress and MemoryLength again (from
// CoreInitializeMemoryServices()), now that library constructors have // CoreInitializeMemoryServices()), now that library constructors have
@ -435,12 +458,6 @@ DxeMain (
DEBUG_CODE_END (); DEBUG_CODE_END ();
//
// Initialize the Event Services
//
Status = CoreInitializeEventServices ();
ASSERT_EFI_ERROR (Status);
MemoryProfileInstallProtocol (); MemoryProfileInstallProtocol ();
CoreInitializeMemoryAttributesTable (); CoreInitializeMemoryAttributesTable ();
@ -489,13 +506,6 @@ DxeMain (
); );
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
//
// Register for the GUIDs of the Architectural Protocols, so the rest of the
// EFI Boot Services and EFI Runtime Services tables can be filled in.
// Also register for the GUIDs of optional protocols.
//
CoreNotifyOnProtocolInstallation ();
// //
// Produce Firmware Volume Protocols, one for each FV in the HOB list. // Produce Firmware Volume Protocols, one for each FV in the HOB list.
// //
@ -516,11 +526,6 @@ DxeMain (
// //
CoreInitializeDispatcher (); CoreInitializeDispatcher ();
//
// Initialize CPU Architectural Protocol
//
InitializeCpu ();
// //
// Invoke the DXE Dispatcher // Invoke the DXE Dispatcher
// //

View File

@ -19,4 +19,13 @@ InitializeCpu (
VOID VOID
); );
/**
Initialize Multi-processor support.
**/
VOID
InitializeMpSupport (
VOID
);
#endif // _CPU_ARCH_LIB_H_ #endif // _CPU_ARCH_LIB_H_

View File

@ -1280,7 +1280,5 @@ InitializeCpu (
); );
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
InitializeMpSupport ();
return Status; return Status;
} }

View File

@ -1,7 +1,9 @@
/** /**
Dummy function for DxeMain.inf. Initialize the state information for the CPU Architectural Protocol.
@retval EFI_SUCCESS Thread can be successfully created @retval EFI_SUCCESS Thread can be successfully created
@retval EFI_OUT_OF_RESOURCES Can not allocate protocol data structure
@retval EFI_DEVICE_ERROR Can not create the thread
**/ **/
EFI_STATUS EFI_STATUS
InitializeCpu ( InitializeCpu (
@ -10,3 +12,14 @@ InitializeCpu (
{ {
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/**
Initialize Multi-processor support.
**/
VOID
InitializeMpSupport (
VOID
)
{
}

View File

@ -9,15 +9,6 @@
#ifndef _CPU_MP_H_ #ifndef _CPU_MP_H_
#define _CPU_MP_H_ #define _CPU_MP_H_
/**
Initialize Multi-processor support.
**/
VOID
InitializeMpSupport (
VOID
);
/** /**
This service retrieves the number of logical processor in the platform This service retrieves the number of logical processor in the platform
and the number of those logical processors that are enabled on this boot. and the number of those logical processors that are enabled on this boot.