]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Include/Library/SemihostLib.h
ARM Packages: Removed trailing spaces
[mirror_edk2.git] / ArmPkg / Include / Library / SemihostLib.h
1 /** @file
2
3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4 Portions copyright (c) 2011, 2012, ARM Ltd. All rights reserved.<BR>
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __SEMIHOSTING_H__
17 #define __SEMIHOSTING_H__
18
19 /*
20 *
21 * Please refer to ARM RVDS 3.0 Compiler and Libraries Guide for more information
22 * about the semihosting interface.
23 *
24 */
25
26 #define SEMIHOST_FILE_MODE_READ (0 << 2)
27 #define SEMIHOST_FILE_MODE_WRITE (1 << 2)
28 #define SEMIHOST_FILE_MODE_APPEND (2 << 2)
29 #define SEMIHOST_FILE_MODE_CREATE (1 << 1)
30 #define SEMIHOST_FILE_MODE_BINARY (1 << 0)
31 #define SEMIHOST_FILE_MODE_ASCII (0 << 0)
32
33 BOOLEAN
34 SemihostConnectionSupported (
35 VOID
36 );
37
38 RETURN_STATUS
39 SemihostFileOpen (
40 IN CHAR8 *FileName,
41 IN UINT32 Mode,
42 OUT UINTN *FileHandle
43 );
44
45 RETURN_STATUS
46 SemihostFileSeek (
47 IN UINTN FileHandle,
48 IN UINTN Offset
49 );
50
51 RETURN_STATUS
52 SemihostFileRead (
53 IN UINTN FileHandle,
54 IN OUT UINTN *Length,
55 OUT VOID *Buffer
56 );
57
58 RETURN_STATUS
59 SemihostFileWrite (
60 IN UINTN FileHandle,
61 IN OUT UINTN *Length,
62 IN VOID *Buffer
63 );
64
65 RETURN_STATUS
66 SemihostFileClose (
67 IN UINTN FileHandle
68 );
69
70 RETURN_STATUS
71 SemihostFileLength (
72 IN UINTN FileHandle,
73 OUT UINTN *Length
74 );
75
76 RETURN_STATUS
77 SemihostFileRemove (
78 IN CHAR8 *FileName
79 );
80
81 CHAR8
82 SemihostReadCharacter (
83 VOID
84 );
85
86 VOID
87 SemihostWriteCharacter (
88 IN CHAR8 Character
89 );
90
91 VOID
92 SemihostWriteString (
93 IN CHAR8 *String
94 );
95
96 UINT32
97 SemihostSystem (
98 IN CHAR8 *CommandLine
99 );
100
101 #endif // __SEMIHOSTING_H__