]>
Commit | Line | Data |
---|---|---|
1e57a462 | 1 | /** @file\r |
2 | \r | |
3 | Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r | |
c63626b7 | 4 | Portions copyright (c) 2011, 2012, ARM Ltd. All rights reserved.<BR>\r |
1e57a462 | 5 | \r |
4059386c | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
1e57a462 | 7 | \r |
8 | **/\r | |
9 | \r | |
10 | #ifndef __SEMIHOSTING_H__\r | |
11 | #define __SEMIHOSTING_H__\r | |
12 | \r | |
13 | /*\r | |
14 | *\r | |
15 | * Please refer to ARM RVDS 3.0 Compiler and Libraries Guide for more information\r | |
16 | * about the semihosting interface.\r | |
17 | *\r | |
18 | */\r | |
3402aac7 | 19 | \r |
1e57a462 | 20 | #define SEMIHOST_FILE_MODE_READ (0 << 2)\r |
21 | #define SEMIHOST_FILE_MODE_WRITE (1 << 2)\r | |
22 | #define SEMIHOST_FILE_MODE_APPEND (2 << 2)\r | |
c20f8ec6 | 23 | #define SEMIHOST_FILE_MODE_UPDATE (1 << 1)\r |
1e57a462 | 24 | #define SEMIHOST_FILE_MODE_BINARY (1 << 0)\r |
25 | #define SEMIHOST_FILE_MODE_ASCII (0 << 0)\r | |
26 | \r | |
27 | BOOLEAN\r | |
28 | SemihostConnectionSupported (\r | |
29 | VOID\r | |
30 | );\r | |
31 | \r | |
32 | RETURN_STATUS\r | |
33 | SemihostFileOpen (\r | |
34 | IN CHAR8 *FileName,\r | |
35 | IN UINT32 Mode,\r | |
c63626b7 | 36 | OUT UINTN *FileHandle\r |
1e57a462 | 37 | );\r |
38 | \r | |
39 | RETURN_STATUS\r | |
40 | SemihostFileSeek (\r | |
c63626b7 | 41 | IN UINTN FileHandle,\r |
42 | IN UINTN Offset\r | |
1e57a462 | 43 | );\r |
44 | \r | |
45 | RETURN_STATUS\r | |
46 | SemihostFileRead (\r | |
c63626b7 | 47 | IN UINTN FileHandle,\r |
48 | IN OUT UINTN *Length,\r | |
1e57a462 | 49 | OUT VOID *Buffer\r |
50 | );\r | |
51 | \r | |
52 | RETURN_STATUS\r | |
53 | SemihostFileWrite (\r | |
c63626b7 | 54 | IN UINTN FileHandle,\r |
55 | IN OUT UINTN *Length,\r | |
1e57a462 | 56 | IN VOID *Buffer\r |
57 | );\r | |
58 | \r | |
59 | RETURN_STATUS\r | |
60 | SemihostFileClose (\r | |
c63626b7 | 61 | IN UINTN FileHandle\r |
1e57a462 | 62 | );\r |
63 | \r | |
64 | RETURN_STATUS\r | |
65 | SemihostFileLength (\r | |
c63626b7 | 66 | IN UINTN FileHandle,\r |
67 | OUT UINTN *Length\r | |
1e57a462 | 68 | );\r |
69 | \r | |
5521b5cc RC |
70 | /**\r |
71 | Get a temporary name for a file from the host running the debug agent.\r | |
72 | \r | |
73 | @param[out] Buffer Pointer to the buffer where the temporary name has to\r | |
74 | be stored\r | |
75 | @param[in] Identifier File name identifier (integer in the range 0 to 255)\r | |
76 | @param[in] Length Length of the buffer to store the temporary name\r | |
77 | \r | |
78 | @retval RETURN_SUCCESS Temporary name returned\r | |
79 | @retval RETURN_INVALID_PARAMETER Invalid buffer address\r | |
80 | @retval RETURN_ABORTED Temporary name not returned\r | |
81 | \r | |
82 | **/\r | |
83 | RETURN_STATUS\r | |
84 | SemihostFileTmpName(\r | |
85 | OUT VOID *Buffer,\r | |
86 | IN UINT8 Identifier,\r | |
87 | IN UINTN Length\r | |
88 | );\r | |
89 | \r | |
1e57a462 | 90 | RETURN_STATUS\r |
91 | SemihostFileRemove (\r | |
92 | IN CHAR8 *FileName\r | |
93 | );\r | |
94 | \r | |
5521b5cc RC |
95 | /**\r |
96 | Rename a specified file.\r | |
97 | \r | |
98 | @param[in] FileName Name of the file to rename.\r | |
99 | @param[in] NewFileName The new name of the file.\r | |
100 | \r | |
101 | @retval RETURN_SUCCESS File Renamed\r | |
102 | @retval RETURN_INVALID_PARAMETER Either the current or the new name is not specified\r | |
103 | @retval RETURN_ABORTED Rename failed\r | |
104 | \r | |
105 | **/\r | |
106 | RETURN_STATUS\r | |
107 | SemihostFileRename(\r | |
108 | IN CHAR8 *FileName,\r | |
109 | IN CHAR8 *NewFileName\r | |
110 | );\r | |
111 | \r | |
1e57a462 | 112 | CHAR8\r |
113 | SemihostReadCharacter (\r | |
114 | VOID\r | |
115 | );\r | |
116 | \r | |
117 | VOID\r | |
118 | SemihostWriteCharacter (\r | |
119 | IN CHAR8 Character\r | |
120 | );\r | |
121 | \r | |
122 | VOID\r | |
123 | SemihostWriteString (\r | |
124 | IN CHAR8 *String\r | |
125 | );\r | |
3402aac7 | 126 | \r |
1e57a462 | 127 | UINT32\r |
128 | SemihostSystem (\r | |
129 | IN CHAR8 *CommandLine\r | |
130 | );\r | |
3402aac7 | 131 | \r |
1e57a462 | 132 | #endif // __SEMIHOSTING_H__\r |