]> git.proxmox.com Git - mirror_edk2.git/blob - EmbeddedPkg/Library/TemplateSerialPortLib/TemplateSerialPortLib.c
98087f9dc05d3b902fe83af740e84c37283f4836
[mirror_edk2.git] / EmbeddedPkg / Library / TemplateSerialPortLib / TemplateSerialPortLib.c
1 /** @file
2 Serial I/O Port library functions with no library constructor/destructor
3
4 Copyright (c) 2008-2009, Apple Inc. All rights reserved.
5
6 All rights reserved. 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 #include <Base.h>
17
18
19 #include <Library/SerialPortLib.h>
20
21 /*
22
23 Programmed hardware of Serial port.
24
25 @return Always return EFI_UNSUPPORTED.
26
27 **/
28 RETURN_STATUS
29 EFIAPI
30 SerialPortInitialize (
31 VOID
32 )
33 {
34 return RETURN_UNSUPPORTED;
35 }
36
37 /**
38 Write data to serial device.
39
40 @param Buffer Point of data buffer which need to be writed.
41 @param NumberOfBytes Number of output bytes which are cached in Buffer.
42
43 @retval 0 Write data failed.
44 @retval !0 Actual number of bytes writed to serial device.
45
46 **/
47 UINTN
48 EFIAPI
49 SerialPortWrite (
50 IN UINT8 *Buffer,
51 IN UINTN NumberOfBytes
52 )
53 {
54 return 0;
55 }
56
57
58 /**
59 Read data from serial device and save the datas in buffer.
60
61 @param Buffer Point of data buffer which need to be writed.
62 @param NumberOfBytes Number of output bytes which are cached in Buffer.
63
64 @retval 0 Read data failed.
65 @retval !0 Aactual number of bytes read from serial device.
66
67 **/
68 UINTN
69 EFIAPI
70 SerialPortRead (
71 OUT UINT8 *Buffer,
72 IN UINTN NumberOfBytes
73 )
74 {
75 return 0;
76 }
77
78
79
80 /**
81 Poll the serial device to see if there is any data waiting.
82
83 If there is data waiting to be read from the serial port, then return
84 TRUE. If there is no data waiting to be read from the serial port, then
85 return FALSE.
86
87 @retval TRUE Data is waiting to be read.
88 @retval FALSE There is no data waiting to be read.
89
90 **/
91 BOOLEAN
92 EFIAPI
93 SerialPortPoll (
94 VOID
95 )
96 {
97 return 0;
98 }
99