]> git.proxmox.com Git - mirror_edk2.git/blame - EmbeddedPkg/Library/TemplateSerialPortLib/TemplateSerialPortLib.c
Add the beginning of a GDB based Debug Agent. IA-32 and X64 don't have low level...
[mirror_edk2.git] / EmbeddedPkg / Library / TemplateSerialPortLib / TemplateSerialPortLib.c
CommitLineData
2ef2b01e
A
1/** @file\r
2 Serial I/O Port library functions with no library constructor/destructor\r
3\r
4 Copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
5 \r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#include <Base.h>\r
17\r
18\r
19#include <Library/SerialPortLib.h>\r
20\r
21/*\r
22\r
23 Programmed hardware of Serial port.\r
24\r
25 @return Always return EFI_UNSUPPORTED.\r
26\r
27**/\r
28RETURN_STATUS\r
29EFIAPI\r
30SerialPortInitialize (\r
31 VOID\r
32 )\r
33{\r
34 return RETURN_UNSUPPORTED;\r
35}\r
36\r
37/**\r
38 Write data to serial device.\r
39\r
40 @param Buffer Point of data buffer which need to be writed.\r
41 @param NumberOfBytes Number of output bytes which are cached in Buffer.\r
42\r
43 @retval 0 Write data failed.\r
44 @retval !0 Actual number of bytes writed to serial device.\r
45\r
46**/\r
47UINTN\r
48EFIAPI\r
49SerialPortWrite (\r
50 IN UINT8 *Buffer,\r
51 IN UINTN NumberOfBytes\r
52)\r
53{\r
54 return 0;\r
55}\r
56\r
57\r
58/**\r
59 Read data from serial device and save the datas in buffer.\r
60\r
61 @param Buffer Point of data buffer which need to be writed.\r
62 @param NumberOfBytes Number of output bytes which are cached in Buffer.\r
63\r
64 @retval 0 Read data failed.\r
65 @retval !0 Aactual number of bytes read from serial device.\r
66\r
67**/\r
68UINTN\r
69EFIAPI\r
70SerialPortRead (\r
71 OUT UINT8 *Buffer,\r
72 IN UINTN NumberOfBytes\r
73)\r
74{\r
75 return 0;\r
76}\r
77\r
78\r
79\r
80/**\r
81 Poll the serial device to see if there is any data waiting.\r
82\r
83 If there is data waiting to be read from the serial port, then return\r
84 TRUE. If there is no data waiting to be read from the serial port, then \r
85 return FALSE.\r
86\r
87 @retval TRUE Data is waiting to be read.\r
88 @retval FALSE There is no data waiting to be read.\r
89\r
90**/\r
91BOOLEAN\r
92EFIAPI\r
93SerialPortPoll (\r
94 VOID\r
95 )\r
96{\r
97 return 0;\r
98}\r
99\r