Change mnemonic SEMIHOST_FILE_MODE_CREATE with mnemonic SEMIHOST_FILE_MODE_UPDATE.
The bit referred to by this mnemonic is for the semi-hosting open mode code the
equivalent of the + in the ISO C fopen mode terminology. This allows to select the
so called update mode for which both read and write are allowed on the open file.
The mnemonic SEMIHOST_FILE_MODE_UPDATE is more in line with the ISO C fopen mode
terminology. A description of the ISO C fopen modes can be found here :
http://pubs.opengroup.org/onlinepubs/
009695399/functions/fopen.html.
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@16237
6f19259b-4bc3-4df7-8a09-
765794883524
\r
// Add the creation flag if necessary\r
if (OpenMode & EFI_FILE_MODE_CREATE) {\r
- SemihostMode |= SEMIHOST_FILE_MODE_CREATE;\r
+ SemihostMode |= SEMIHOST_FILE_MODE_UPDATE;\r
}\r
\r
// Call the semihosting interface to open the file.\r
#define SEMIHOST_FILE_MODE_READ (0 << 2)\r
#define SEMIHOST_FILE_MODE_WRITE (1 << 2)\r
#define SEMIHOST_FILE_MODE_APPEND (2 << 2)\r
-#define SEMIHOST_FILE_MODE_CREATE (1 << 1)\r
+#define SEMIHOST_FILE_MODE_UPDATE (1 << 1)\r
#define SEMIHOST_FILE_MODE_BINARY (1 << 0)\r
#define SEMIHOST_FILE_MODE_ASCII (0 << 0)\r
\r
I'm currently having issues with this code crashing the debugger. Seems like it should work.\r
\r
UINT32 SemihostHandle;\r
- UINT32 SemihostMode = SEMIHOST_FILE_MODE_WRITE | SEMIHOST_FILE_MODE_BINARY | SEMIHOST_FILE_MODE_CREATE;\r
+ UINT32 SemihostMode = SEMIHOST_FILE_MODE_WRITE | SEMIHOST_FILE_MODE_BINARY | SEMIHOST_FILE_MODE_UPDATE;\r
\r
SemihostFileOpen ("c:\rvi_symbols.inc", SemihostMode, &SemihostHandle);\r
SemihostFileWrite (SemihostHandle, &Length, Buffer);\r