]> git.proxmox.com Git - mirror_edk2.git/blob - EmbeddedPkg/Include/Library/GdbSerialLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / EmbeddedPkg / Include / Library / GdbSerialLib.h
1 /** @file
2 Basic serial IO abstraction for GDB
3
4 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef __GDB_SERIAL_LIB_H__
11 #define __GDB_SERIAL_LIB_H__
12
13 /**
14 Sets the baud rate, receive FIFO depth, transmit/receive time out, parity,
15 data buts, and stop bits on a serial device. This call is optional as the serial
16 port will be set up with defaults base on PCD values.
17
18 @param BaudRate The requested baud rate. A BaudRate value of 0 will use the
19 device's default interface speed.
20 @param Parity The type of parity to use on this serial device. A Parity value of
21 DefaultParity will use the device's default parity value.
22 @param DataBits The number of data bits to use on the serial device. A DataBits
23 value of 0 will use the device's default data bit setting.
24 @param StopBits The number of stop bits to use on this serial device. A StopBits
25 value of DefaultStopBits will use the device's default number of
26 stop bits.
27
28 @retval EFI_SUCCESS The device was configured.
29 @retval EFI_DEVICE_ERROR The serial device could not be configured.
30
31 **/
32 RETURN_STATUS
33 EFIAPI
34 GdbSerialInit (
35 IN UINT64 BaudRate,
36 IN UINT8 Parity,
37 IN UINT8 DataBits,
38 IN UINT8 StopBits
39 );
40
41 /**
42 Check to see if a character is available from GDB. Do not read the character as that is
43 done via GdbGetChar().
44
45 @return TRUE - Character available
46 @return FALSE - Character not available
47
48 **/
49 BOOLEAN
50 EFIAPI
51 GdbIsCharAvailable (
52 VOID
53 );
54
55 /**
56 Get a character from GDB. This function must be able to run in interrupt context.
57
58 @return A character from GDB
59
60 **/
61 CHAR8
62 EFIAPI
63 GdbGetChar (
64 VOID
65 );
66
67 /**
68 Send a character to GDB. This function must be able to run in interrupt context.
69
70
71 @param Char Send a character to GDB
72
73 **/
74
75 VOID
76 EFIAPI
77 GdbPutChar (
78 IN CHAR8 Char
79 );
80
81 /**
82 Send an ASCII string to GDB. This function must be able to run in interrupt context.
83
84
85 @param String Send a string to GDB
86
87 **/
88
89 VOID
90 GdbPutString (
91 IN CHAR8 *String
92 );
93
94 #endif