TianoCore EDK2 master
Loading...
Searching...
No Matches
Common.h File Reference
#include <Base.h>
#include <Library/SerialPortLib.h>
#include <Library/BaseRiscVSbiLib.h>

Go to the source code of this file.

Functions

BOOLEAN SbiImplementsDbcn (VOID)
 
BOOLEAN SbiImplementsLegacyPutchar (VOID)
 
UINTN SbiLegacyPutchar (IN UINT8 *Buffer, IN UINTN NumberOfBytes)
 
UINTN SbiDbcnWrite (IN UINT8 *Buffer, IN UINTN NumberOfBytes)
 

Detailed Description

Serial Port Library backed by SBI console.

Common functionality shared by PrePiDxeSerialPortLibRiscVSbi and PrePiDxeSerialPortLibRiscVSbiRam implementations.

Copyright (c) 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Common.h.

Function Documentation

◆ SbiDbcnWrite()

UINTN SbiDbcnWrite ( IN UINT8 *  Buffer,
IN UINTN  NumberOfBytes 
)

Write data from buffer to console via SBI DBCN.

The number of bytes actually written to the SBI console is returned. If the return value is less than NumberOfBytes, then the write operation failed.

Parameters
BufferThe pointer to the data buffer to be written.
NumberOfBytesThe number of bytes to written to the serial device.
Return values
>=0The number of bytes written to the serial device. If this value is less than NumberOfBytes, then the write operation failed.

Definition at line 110 of file Common.c.

◆ SbiImplementsDbcn()

BOOLEAN SbiImplementsDbcn ( VOID  )

Return whether the DBCN extension is implemented.

Return values
TRUEExtension is implemented.
FALSEExtension is not implemented.

Definition at line 22 of file Common.c.

◆ SbiImplementsLegacyPutchar()

BOOLEAN SbiImplementsLegacyPutchar ( VOID  )

Return whether the legacy console putchar extension is implemented.

Return values
TRUEExtension is implemented.
FALSEExtension is not implemented.

Definition at line 46 of file Common.c.

◆ SbiLegacyPutchar()

UINTN SbiLegacyPutchar ( IN UINT8 *  Buffer,
IN UINTN  NumberOfBytes 
)

Write data from buffer to console via SBI legacy putchar extension.

The number of bytes actually written to the SBI console is returned. If the return value is less than NumberOfBytes, then the write operation failed.

Parameters
BufferThe pointer to the data buffer to be written.
NumberOfBytesThe number of bytes to written to the serial device.
Return values
>=0The number of bytes written to the serial device. If this value is less than NumberOfBytes, then the write operation failed.

Definition at line 77 of file Common.c.