summaryrefslogtreecommitdiffstats
path: root/UnixPkg/Sec/SecMain.c
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-30 23:38:40 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-30 23:38:40 +0000
commit2ff79f2eda16f8219140d3dae188d2b341f610e1 (patch)
tree693b0c0223c7f3a312f292a3a5ba9eff0def4dbe /UnixPkg/Sec/SecMain.c
parente23a349aaec2ba7fd4218c6dabaf42da0aa9aa8e (diff)
downloadedk2-2ff79f2eda16f8219140d3dae188d2b341f610e1.tar.gz
edk2-2ff79f2eda16f8219140d3dae188d2b341f610e1.tar.bz2
edk2-2ff79f2eda16f8219140d3dae188d2b341f610e1.zip
Adding Simple Pointer, GOP, SimpleTextInEx, and Networking protocols to the emulator. Cleaned up POSIX include situation by centralizing it in a single file, like NT32. Fixed TPL issue with TPL High not being emulated correctly, it was possible to take a timer tick when the locks in the DXE core should have prevented this. Remove some unused files to make things easier to maintain.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11105 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/Sec/SecMain.c')
-rw-r--r--UnixPkg/Sec/SecMain.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/UnixPkg/Sec/SecMain.c b/UnixPkg/Sec/SecMain.c
index da83e3fa5c..dc4b14c00f 100644
--- a/UnixPkg/Sec/SecMain.c
+++ b/UnixPkg/Sec/SecMain.c
@@ -1,7 +1,7 @@
/*++
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
+Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1114,6 +1114,18 @@ SecPeCoffRelocateImageExtraAction (
{
#ifdef __APPLE__
+ BOOLEAN EnabledOnEntry;
+
+ //
+ // Make sure writting of the file is an atomic operation
+ //
+ if (UnixInterruptEanbled ()) {
+ UnixDisableInterrupt ();
+ EnabledOnEntry = TRUE;
+ } else {
+ EnabledOnEntry = FALSE;
+ }
+
PrintLoadAddress (ImageContext);
//
@@ -1165,10 +1177,17 @@ SecPeCoffRelocateImageExtraAction (
// Hey what can you say scripting in gdb is not that great....
//
SecGdbScriptBreak ();
+ } else {
+ ASSERT (FALSE);
}
AddHandle (ImageContext, ImageContext->PdbPointer);
+ if (EnabledOnEntry) {
+ UnixEnableInterrupt ();
+ }
+
+
}
#else
@@ -1223,12 +1242,20 @@ SecPeCoffLoaderUnloadImageExtraAction (
#ifdef __APPLE__
FILE *GdbTempFile;
+ BOOLEAN EnabledOnEntry;
if (Handle != NULL) {
//
// Need to skip .PDB files created from VC++
//
if (!IsPdbFile (ImageContext->PdbPointer)) {
+ if (UnixInterruptEanbled ()) {
+ UnixDisableInterrupt ();
+ EnabledOnEntry = TRUE;
+ } else {
+ EnabledOnEntry = FALSE;
+ }
+
//
// Write the file we need for the gdb script
//
@@ -1242,6 +1269,12 @@ SecPeCoffLoaderUnloadImageExtraAction (
// Hey what can you say scripting in gdb is not that great....
//
SecGdbScriptBreak ();
+ } else {
+ ASSERT (FALSE);
+ }
+
+ if (EnabledOnEntry) {
+ UnixEnableInterrupt ();
}
}
}