audk/MdePkg/Library/SerialPortLibNull/SerialPortLibNull.c

95 lines
2.0 KiB
C

/** @file
Null Serial Port library instance with empty functions.
Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <Base.h>
#include <Library/SerialPortLib.h>
/**
Programmed hardware of Serial port.
@return Always return RETURN_UNSUPPORTED.
**/
RETURN_STATUS
EFIAPI
SerialPortInitialize (
VOID
)
{
return RETURN_UNSUPPORTED;
}
/**
Write data to serial device.
@param Buffer Point of data buffer which need to be writed.
@param NumberOfBytes Number of output bytes which are cached in Buffer.
@retval 0 No data is to be written.
**/
UINTN
EFIAPI
SerialPortWrite (
IN UINT8 *Buffer,
IN UINTN NumberOfBytes
)
{
return 0;
}
/**
Read data from serial device and save the datas in buffer.
@param Buffer Point of data buffer, which contains the data
returned from the serial device.
@param NumberOfBytes Number of bytes which will be read.
@retval 0 No data is to be read.
**/
UINTN
EFIAPI
SerialPortRead (
OUT UINT8 *Buffer,
IN UINTN NumberOfBytes
)
{
return 0;
}
/**
Poll the serial device to see if there is any data waiting.
If there is data waiting to be read from the serial port, then return
TRUE. If there is no data waiting to be read from the serial port, then
return FALSE.
@retval FALSE There is no data waiting to be read.
**/
BOOLEAN
EFIAPI
SerialPortPoll (
VOID
)
{
return FALSE;
}