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