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