Add MP support. Based on PcdEmuApCount APs (Application Processors) are created in the CpuRuntimeDxe driver. If PcdEmuApCount > 0 then the MpServices protocol is created on top of pthreads and the APs are availible to use vis the MpService protocol.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11644 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -17,9 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/HobLib.h>
|
||||
#include <Library/EmuThunkLib.h>
|
||||
|
||||
#include <Protocol/EmuThunk.h>
|
||||
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
|
||||
EMU_THUNK_PROTOCOL *gEmuThunk = NULL;
|
||||
|
||||
@@ -50,3 +48,41 @@ DxeEmuLibConstructor (
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Serach the EMU IO Thunk database for a matching EMU IO Thunk
|
||||
Protocol instance.
|
||||
|
||||
@param Protocol Protocol to search for.
|
||||
@param Instance Instance of protocol to search for.
|
||||
|
||||
@retval NULL Protocol and Instance not found.
|
||||
@retval other EMU IO Thunk protocol that matched.
|
||||
|
||||
**/
|
||||
EMU_IO_THUNK_PROTOCOL *
|
||||
EFIAPI
|
||||
GetIoThunkInstance (
|
||||
IN EFI_GUID *Protocol,
|
||||
IN UINTN Instance
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EMU_IO_THUNK_PROTOCOL *EmuIoThunk;
|
||||
|
||||
for (Status = EFI_SUCCESS, EmuIoThunk = NULL; !EFI_ERROR (Status); ) {
|
||||
Status = gEmuThunk->GetNextProtocol (FALSE, &EmuIoThunk);
|
||||
if (EFI_ERROR (Status)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (EmuIoThunk->Instance == Instance) {
|
||||
if (CompareGuid (EmuIoThunk->Protocol, Protocol)) {
|
||||
return EmuIoThunk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
@@ -38,6 +38,7 @@
|
||||
[LibraryClasses]
|
||||
HobLib
|
||||
DebugLib
|
||||
BaseMemoryLib
|
||||
|
||||
|
||||
[Protocols]
|
||||
|
Reference in New Issue
Block a user