summaryrefslogtreecommitdiff
path: root/EdkUnixPkg/Dxe
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-04-04 07:40:40 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-04-04 07:40:40 +0000
commit4825e9d87d67da24adba382c5507cae80267b7ab (patch)
tree7ad94c0cc86e06e83c8e658780263a26bb47b013 /EdkUnixPkg/Dxe
parent13de892cc309104a0a8c720062d353a3fa5da6b0 (diff)
downloadedk2-platforms-4825e9d87d67da24adba382c5507cae80267b7ab.tar.xz
Fix the TPL broken issue for UnixPkg
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2534 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkUnixPkg/Dxe')
-rw-r--r--EdkUnixPkg/Dxe/UnixThunk/Bus/SimpleFileSystem/UnixSimpleFileSystem.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/EdkUnixPkg/Dxe/UnixThunk/Bus/SimpleFileSystem/UnixSimpleFileSystem.c b/EdkUnixPkg/Dxe/UnixThunk/Bus/SimpleFileSystem/UnixSimpleFileSystem.c
index 9872653174..10736d5407 100644
--- a/EdkUnixPkg/Dxe/UnixThunk/Bus/SimpleFileSystem/UnixSimpleFileSystem.c
+++ b/EdkUnixPkg/Dxe/UnixThunk/Bus/SimpleFileSystem/UnixSimpleFileSystem.c
@@ -495,10 +495,12 @@ Returns:
EFI_STATUS Status;
UNIX_SIMPLE_FILE_SYSTEM_PRIVATE *Private;
UNIX_EFI_FILE_PRIVATE *PrivateFile;
+ EFI_TPL OldTpl;
if (This == NULL || Root == NULL) {
return EFI_INVALID_PARAMETER;
}
+ OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
Private = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (This);
@@ -566,6 +568,8 @@ Done:
}
}
+ gBS->RestoreTPL (OldTpl);
+
return Status;
}
@@ -640,7 +644,6 @@ Returns:
BOOLEAN LoopFinish;
UINTN InfoSize;
EFI_FILE_INFO *Info;
- EFI_TPL OldTpl;
TrailingDash = FALSE;
@@ -672,7 +675,6 @@ Returns:
return EFI_INVALID_PARAMETER;
}
- OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
PrivateRoot = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);
@@ -953,8 +955,6 @@ Done: ;
*NewHandle = &NewPrivateFile->EfiFile;
}
- gBS->RestoreTPL (OldTpl);
-
return Status;
}
@@ -1073,6 +1073,8 @@ Returns:
gBS->FreePool (PrivateFile->FileName);
gBS->FreePool (PrivateFile);
+ gBS->RestoreTPL (OldTpl);
+
return Status;
}
@@ -1273,31 +1275,37 @@ Returns:
if (!PrivateFile->IsDirectoryPath) {
if (PrivateFile->fd < 0) {
- return EFI_DEVICE_ERROR;
+ Status = EFI_DEVICE_ERROR;
+ goto Done;
}
Res = PrivateFile->UnixThunk->Read (
PrivateFile->fd,
Buffer,
*BufferSize);
- if (Res < 0)
- return EFI_DEVICE_ERROR;
+ if (Res < 0) {
+ Status = EFI_DEVICE_ERROR;
+ goto Done;
+ }
*BufferSize = Res;
- return EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+ goto Done;
}
//
// Read on a directory.
//
if (PrivateFile->Dir == NULL) {
- return EFI_DEVICE_ERROR;
+ Status = EFI_DEVICE_ERROR;
+ goto Done;
}
if (PrivateFile->Dirent == NULL) {
PrivateFile->Dirent = PrivateFile->UnixThunk->ReadDir (PrivateFile->Dir);
if (PrivateFile->Dirent == NULL) {
*BufferSize = 0;
- return EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+ goto Done;
}
}
@@ -1307,7 +1315,8 @@ Returns:
if (*BufferSize < ResultSize) {
*BufferSize = ResultSize;
- return EFI_BUFFER_TOO_SMALL;
+ Status = EFI_BUFFER_TOO_SMALL;
+ goto Done;
}
Status = EFI_SUCCESS;
@@ -1320,7 +1329,7 @@ Returns:
);
if (EFI_ERROR (Status)) {
- return Status;
+ goto Done;
}
AsciiStrCpy(FullFileName, PrivateFile->FileName);
@@ -1334,6 +1343,9 @@ Returns:
PrivateFile->Dirent = NULL;
+Done:
+ gBS->RestoreTPL (OldTpl);
+
return Status;
}
@@ -1389,6 +1401,8 @@ Returns:
return EFI_INVALID_PARAMETER;
}
+ OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
+
PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
if (PrivateFile->fd < 0) {
@@ -1403,8 +1417,6 @@ Returns:
return EFI_ACCESS_DENIED;
}
- OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
-
Res = PrivateFile->UnixThunk->Write (
PrivateFile->fd,
Buffer,