summaryrefslogtreecommitdiff
path: root/InOsEmuPkg/Library
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-13 00:03:26 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-13 00:03:26 +0000
commitc4671a67d86ad8b6453fa36471cfeaf6b73cbcea (patch)
treec01f9ef31e53b8573adb9b9599f4aeb0aa498c1f /InOsEmuPkg/Library
parente6a6082acfb0984ef56a05e56f8b3d7ca068cbae (diff)
downloadedk2-platforms-c4671a67d86ad8b6453fa36471cfeaf6b73cbcea.tar.xz
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
Diffstat (limited to 'InOsEmuPkg/Library')
-rw-r--r--InOsEmuPkg/Library/DxeEmuLib/DxeEmuLib.c42
-rw-r--r--InOsEmuPkg/Library/DxeEmuLib/DxeEmuLib.inf1
2 files changed, 40 insertions, 3 deletions
diff --git a/InOsEmuPkg/Library/DxeEmuLib/DxeEmuLib.c b/InOsEmuPkg/Library/DxeEmuLib/DxeEmuLib.c
index 79e9fbc1ee..2e42ea6151 100644
--- a/InOsEmuPkg/Library/DxeEmuLib/DxeEmuLib.c
+++ b/InOsEmuPkg/Library/DxeEmuLib/DxeEmuLib.c
@@ -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;
+} \ No newline at end of file
diff --git a/InOsEmuPkg/Library/DxeEmuLib/DxeEmuLib.inf b/InOsEmuPkg/Library/DxeEmuLib/DxeEmuLib.inf
index de395d6272..0f7f0ddeca 100644
--- a/InOsEmuPkg/Library/DxeEmuLib/DxeEmuLib.inf
+++ b/InOsEmuPkg/Library/DxeEmuLib/DxeEmuLib.inf
@@ -38,6 +38,7 @@
[LibraryClasses]
HobLib
DebugLib
+ BaseMemoryLib
[Protocols]