]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/SemihostLib/SemihostPrivate.h
ArmPkg/SemihostLib: Add library functions
[mirror_edk2.git] / ArmPkg / Library / SemihostLib / SemihostPrivate.h
index bb0a026d4e33c9ca56558f44e5d03597e32536d0..afc53274b094dc0a3cc5b85db71b7d8dbece5783 100644 (file)
@@ -33,11 +33,24 @@ typedef struct {
   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
@@ -116,6 +129,13 @@ _Semihost_SYS_FLEN(
   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
@@ -123,6 +143,13 @@ _Semihost_SYS_REMOVE(
   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
@@ -139,7 +166,9 @@ _Semihost_SYS_SYSTEM(
 #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
@@ -161,7 +190,9 @@ GccSemihostCall (
 #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
@@ -177,7 +208,9 @@ GccSemihostCall (
 #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