UINTN Location;\r
} SEMIHOST_FILE_SEEK_BLOCK;\r
\r
+typedef struct {\r
+ VOID *Buffer;\r
+ UINTN Identifier;\r
+ UINTN Length;\r
+} SEMIHOST_FILE_TMPNAME_BLOCK;\r
+\r
typedef struct {\r
CHAR8 *FileName;\r
UINTN NameLength;\r
} SEMIHOST_FILE_REMOVE_BLOCK;\r
\r
+typedef struct {\r
+ CHAR8 *FileName;\r
+ UINTN FileNameLength;\r
+ CHAR8 *NewFileName;\r
+ UINTN NewFileNameLength;\r
+} SEMIHOST_FILE_RENAME_BLOCK;\r
+\r
typedef struct {\r
CHAR8 *CommandLine;\r
UINTN CommandLength;\r
} SEMIHOST_SYSTEM_BLOCK;\r
\r
-#if defined(__CC_ARM) \r
+#if defined(__CC_ARM)\r
\r
#if defined(__thumb__)\r
#define SWI 0xAB\r
IN UINT32 *Handle\r
);\r
\r
+__swi(SWI)\r
+UINT32\r
+_Semihost_SYS_TMPNAME(\r
+ IN UINTN SWI_0x0D,\r
+ IN SEMIHOST_FILE_TMPNAME_BLOCK *TmpNameBlock\r
+ );\r
+\r
__swi(SWI)\r
UINT32\r
_Semihost_SYS_REMOVE(\r
IN SEMIHOST_FILE_REMOVE_BLOCK *RemoveBlock\r
);\r
\r
+__swi(SWI)\r
+UINT32\r
+_Semihost_SYS_RENAME(\r
+ IN UINTN SWI_0x0F,\r
+ IN SEMIHOST_FILE_RENAME_BLOCK *RenameBlock\r
+ );\r
+\r
__swi(SWI)\r
UINT32\r
_Semihost_SYS_SYSTEM(\r
#define Semihost_SYS_READC() _Semihost_SYS_READC(0x07, 0)\r
#define Semihost_SYS_SEEK(SeekBlock) _Semihost_SYS_SEEK(0x0A, SeekBlock)\r
#define Semihost_SYS_FLEN(Handle) _Semihost_SYS_FLEN(0x0C, Handle)\r
+#define Semihost_SYS_TMPNAME(TmpNameBlock) _Semihost_SYS_TMPNAME(0x0D, TmpNameBlock)\r
#define Semihost_SYS_REMOVE(RemoveBlock) _Semihost_SYS_REMOVE(0x0E, RemoveBlock)\r
+#define Semihost_SYS_RENAME(RenameBlock) _Semihost_SYS_RENAME(0x0F, RenameBlock)\r
#define Semihost_SYS_SYSTEM(SystemBlock) _Semihost_SYS_SYSTEM(0x12, SystemBlock)\r
\r
#elif defined(__GNUC__) // __CC_ARM\r
#define Semihost_SYS_READC() GccSemihostCall(0x07, (UINTN)(0))\r
#define Semihost_SYS_SEEK(SeekBlock) GccSemihostCall(0x0A, (UINTN)(SeekBlock))\r
#define Semihost_SYS_FLEN(Handle) GccSemihostCall(0x0C, (UINTN)(Handle))\r
+#define Semihost_SYS_TMPNAME(TmpNameBlock) GccSemihostCall(0x0D, (UINTN)(TmpNameBlock))\r
#define Semihost_SYS_REMOVE(RemoveBlock) GccSemihostCall(0x0E, (UINTN)(RemoveBlock))\r
+#define Semihost_SYS_RENAME(RenameBlock) GccSemihostCall(0x0F, (UINTN)(RenameBlock))\r
#define Semihost_SYS_SYSTEM(SystemBlock) GccSemihostCall(0x12, (UINTN)(SystemBlock))\r
\r
#else // __CC_ARM\r
#define Semihost_SYS_READC() ('x')\r
#define Semihost_SYS_SEEK(SeekBlock) (-1)\r
#define Semihost_SYS_FLEN(Handle) (-1)\r
+#define Semihost_SYS_TMPNAME(TmpNameBlock) (-1)\r
#define Semihost_SYS_REMOVE(RemoveBlock) (-1)\r
+#define Semihost_SYS_RENAME(RenameBlock) (-1)\r
#define Semihost_SYS_SYSTEM(SystemBlock) (-1)\r
\r
#endif // __CC_ARM\r