mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
13de892cc3
commit
4825e9d87d
|
@ -495,10 +495,12 @@ Returns:
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UNIX_SIMPLE_FILE_SYSTEM_PRIVATE *Private;
|
UNIX_SIMPLE_FILE_SYSTEM_PRIVATE *Private;
|
||||||
UNIX_EFI_FILE_PRIVATE *PrivateFile;
|
UNIX_EFI_FILE_PRIVATE *PrivateFile;
|
||||||
|
EFI_TPL OldTpl;
|
||||||
|
|
||||||
if (This == NULL || Root == NULL) {
|
if (This == NULL || Root == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
|
||||||
|
|
||||||
Private = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (This);
|
Private = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (This);
|
||||||
|
|
||||||
|
@ -566,6 +568,8 @@ Done:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gBS->RestoreTPL (OldTpl);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -640,7 +644,6 @@ Returns:
|
||||||
BOOLEAN LoopFinish;
|
BOOLEAN LoopFinish;
|
||||||
UINTN InfoSize;
|
UINTN InfoSize;
|
||||||
EFI_FILE_INFO *Info;
|
EFI_FILE_INFO *Info;
|
||||||
EFI_TPL OldTpl;
|
|
||||||
|
|
||||||
TrailingDash = FALSE;
|
TrailingDash = FALSE;
|
||||||
|
|
||||||
|
@ -672,7 +675,6 @@ Returns:
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
|
|
||||||
|
|
||||||
PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
|
PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
|
||||||
PrivateRoot = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);
|
PrivateRoot = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);
|
||||||
|
@ -953,8 +955,6 @@ Done: ;
|
||||||
*NewHandle = &NewPrivateFile->EfiFile;
|
*NewHandle = &NewPrivateFile->EfiFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBS->RestoreTPL (OldTpl);
|
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1073,6 +1073,8 @@ Returns:
|
||||||
gBS->FreePool (PrivateFile->FileName);
|
gBS->FreePool (PrivateFile->FileName);
|
||||||
gBS->FreePool (PrivateFile);
|
gBS->FreePool (PrivateFile);
|
||||||
|
|
||||||
|
gBS->RestoreTPL (OldTpl);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1273,31 +1275,37 @@ Returns:
|
||||||
if (!PrivateFile->IsDirectoryPath) {
|
if (!PrivateFile->IsDirectoryPath) {
|
||||||
|
|
||||||
if (PrivateFile->fd < 0) {
|
if (PrivateFile->fd < 0) {
|
||||||
return EFI_DEVICE_ERROR;
|
Status = EFI_DEVICE_ERROR;
|
||||||
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
Res = PrivateFile->UnixThunk->Read (
|
Res = PrivateFile->UnixThunk->Read (
|
||||||
PrivateFile->fd,
|
PrivateFile->fd,
|
||||||
Buffer,
|
Buffer,
|
||||||
*BufferSize);
|
*BufferSize);
|
||||||
if (Res < 0)
|
if (Res < 0) {
|
||||||
return EFI_DEVICE_ERROR;
|
Status = EFI_DEVICE_ERROR;
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
*BufferSize = Res;
|
*BufferSize = Res;
|
||||||
return EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Read on a directory.
|
// Read on a directory.
|
||||||
//
|
//
|
||||||
if (PrivateFile->Dir == NULL) {
|
if (PrivateFile->Dir == NULL) {
|
||||||
return EFI_DEVICE_ERROR;
|
Status = EFI_DEVICE_ERROR;
|
||||||
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PrivateFile->Dirent == NULL) {
|
if (PrivateFile->Dirent == NULL) {
|
||||||
PrivateFile->Dirent = PrivateFile->UnixThunk->ReadDir (PrivateFile->Dir);
|
PrivateFile->Dirent = PrivateFile->UnixThunk->ReadDir (PrivateFile->Dir);
|
||||||
if (PrivateFile->Dirent == NULL) {
|
if (PrivateFile->Dirent == NULL) {
|
||||||
*BufferSize = 0;
|
*BufferSize = 0;
|
||||||
return EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
|
goto Done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1307,7 +1315,8 @@ Returns:
|
||||||
|
|
||||||
if (*BufferSize < ResultSize) {
|
if (*BufferSize < ResultSize) {
|
||||||
*BufferSize = ResultSize;
|
*BufferSize = ResultSize;
|
||||||
return EFI_BUFFER_TOO_SMALL;
|
Status = EFI_BUFFER_TOO_SMALL;
|
||||||
|
goto Done;
|
||||||
}
|
}
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
|
|
||||||
|
@ -1320,7 +1329,7 @@ Returns:
|
||||||
);
|
);
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
AsciiStrCpy(FullFileName, PrivateFile->FileName);
|
AsciiStrCpy(FullFileName, PrivateFile->FileName);
|
||||||
|
@ -1334,6 +1343,9 @@ Returns:
|
||||||
|
|
||||||
PrivateFile->Dirent = NULL;
|
PrivateFile->Dirent = NULL;
|
||||||
|
|
||||||
|
Done:
|
||||||
|
gBS->RestoreTPL (OldTpl);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1389,6 +1401,8 @@ Returns:
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
|
||||||
|
|
||||||
PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
|
PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
|
||||||
|
|
||||||
if (PrivateFile->fd < 0) {
|
if (PrivateFile->fd < 0) {
|
||||||
|
@ -1403,8 +1417,6 @@ Returns:
|
||||||
return EFI_ACCESS_DENIED;
|
return EFI_ACCESS_DENIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
|
|
||||||
|
|
||||||
Res = PrivateFile->UnixThunk->Write (
|
Res = PrivateFile->UnixThunk->Write (
|
||||||
PrivateFile->fd,
|
PrivateFile->fd,
|
||||||
Buffer,
|
Buffer,
|
||||||
|
|
Loading…
Reference in New Issue