summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.h
diff options
context:
space:
mode:
authorRonald Cron <ronald.cron@arm.com>2014-10-27 10:40:33 +0000
committeroliviermartin <oliviermartin@Edk2>2014-10-27 10:40:33 +0000
commitfdd12bd56985bfc6090b972ddc07418eb4f7212a (patch)
tree7240f7d6057e4167a50928b04607e3254b3ae934 /ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.h
parent0f0a6fe907e6233f95546599ee3fe48d91259dce (diff)
downloadedk2-fdd12bd56985bfc6090b972ddc07418eb4f7212a.tar.gz
edk2-fdd12bd56985bfc6090b972ddc07418eb4f7212a.tar.bz2
edk2-fdd12bd56985bfc6090b972ddc07418eb4f7212a.zip
ArmPkg/SemihostFs: Fix open file issues revealed by SCT
Fix return codes in case of errors. Fix translation from EFI open mode to semi-hosting open mode to avoid the truncate to zero length of an already existing file opened in read/write or read/write/create mode. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ronald Cron <ronald.cron@arm.com> Reviewed-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16241 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.h')
-rw-r--r--ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.h b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.h
index a9b200b2a0..c02b36ae5f 100644
--- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.h
+++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.h
@@ -22,9 +22,35 @@ VolumeOpen (
OUT EFI_FILE **Root
);
+/**
+ Open a file on the host system by means of the semihosting interface.
+
+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is
+ the file handle to source location.
+ @param[out] NewHandle A pointer to the location to return the opened
+ handle for the new file.
+ @param[in] FileName The Null-terminated string of the name of the file
+ to be opened.
+ @param[in] OpenMode The mode to open the file : Read or Read/Write or
+ Read/Write/Create
+ @param[in] Attributes Only valid for EFI_FILE_MODE_CREATE, in which case these
+ are the attribute bits for the newly created file. The
+ mnemonics of the attribute bits are : EFI_FILE_READ_ONLY,
+ EFI_FILE_HIDDEN, EFI_FILE_SYSTEM, EFI_FILE_RESERVED,
+ EFI_FILE_DIRECTORY and EFI_FILE_ARCHIVE.
+
+ @retval EFI_SUCCESS The file was open.
+ @retval EFI_NOT_FOUND The specified file could not be found.
+ @retval EFI_DEVICE_ERROR The last issued semi-hosting operation failed.
+ @retval EFI_WRITE_PROTECTED Attempt to create a directory. This is not possible
+ with the semi-hosting interface.
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
+ @retval EFI_INVALID_PARAMETER At least one of the parameters is invalid.
+
+**/
EFI_STATUS
FileOpen (
- IN EFI_FILE *File,
+ IN EFI_FILE *This,
OUT EFI_FILE **NewHandle,
IN CHAR16 *FileName,
IN UINT64 OpenMode,