ArmPkg/SemihostFs: Fixed DataAbort in Semihosting File System
Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13501 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
7422411e38
commit
3bb46df2a3
|
@ -263,6 +263,7 @@ FileDelete (
|
||||||
|
|
||||||
Fcb = SEMIHOST_FCB_FROM_THIS(File);
|
Fcb = SEMIHOST_FCB_FROM_THIS(File);
|
||||||
|
|
||||||
|
if (!Fcb->IsRoot) {
|
||||||
// Get the filename from the Fcb
|
// Get the filename from the Fcb
|
||||||
NameSize = AsciiStrLen (Fcb->FileName);
|
NameSize = AsciiStrLen (Fcb->FileName);
|
||||||
FileName = AllocatePool (NameSize + 1);
|
FileName = AllocatePool (NameSize + 1);
|
||||||
|
@ -275,6 +276,9 @@ FileDelete (
|
||||||
|
|
||||||
// Call the semihost interface to delete the file.
|
// Call the semihost interface to delete the file.
|
||||||
Status = SemihostFileRemove (FileName);
|
Status = SemihostFileRemove (FileName);
|
||||||
|
} else {
|
||||||
|
Status = EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -358,6 +362,7 @@ FileSetPosition (
|
||||||
|
|
||||||
Fcb = SEMIHOST_FCB_FROM_THIS(File);
|
Fcb = SEMIHOST_FCB_FROM_THIS(File);
|
||||||
|
|
||||||
|
if (!Fcb->IsRoot) {
|
||||||
Status = SemihostFileLength (Fcb->SemihostHandle, &Length);
|
Status = SemihostFileLength (Fcb->SemihostHandle, &Length);
|
||||||
if (!EFI_ERROR(Status) && (Length < Position)) {
|
if (!EFI_ERROR(Status) && (Length < Position)) {
|
||||||
Position = Length;
|
Position = Length;
|
||||||
|
@ -367,6 +372,10 @@ FileSetPosition (
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
Fcb->Position = Position;
|
Fcb->Position = Position;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Fcb->Position = Position;
|
||||||
|
Status = EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue