]> 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 02836ca281aff6027c5ac90a64a8a117cfb14ed5..afc53274b094dc0a3cc5b85db71b7d8dbece5783 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
 \r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+  Copyright (c) 2013 - 2014, ARM Ltd. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 \r
 typedef struct {\r
   CHAR8   *FileName;\r
-  UINT32  Mode;\r
-  UINT32  NameLength;\r
+  UINTN    Mode;\r
+  UINTN    NameLength;\r
 } SEMIHOST_FILE_OPEN_BLOCK;\r
 \r
 typedef struct {\r
-  UINT32  Handle;\r
+  UINTN    Handle;\r
   VOID    *Buffer;\r
-  UINT32  Length;\r
+  UINTN    Length;\r
 } SEMIHOST_FILE_READ_WRITE_BLOCK;\r
 \r
 typedef struct {\r
-  UINT32  Handle;\r
-  UINT32  Location;\r
+  UINTN    Handle;\r
+  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
-  UINT32  NameLength;\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
-  UINT32  CommandLength;\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
@@ -115,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
@@ -122,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
@@ -138,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
@@ -160,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
@@ -176,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