mirror of
https://github.com/acidanthera/audk.git
synced 2025-08-18 08:08:09 +02:00
These are implementations of SerialPortLib using SBI console services. - BaseSerialPortLibRiscVSbiLib is appropriate for SEC/PEI (XIP) environments - BaseSerialPortLibRiscVSbiLibRam is appropriate for PrePI/DXE environments Tested with: - Qemu RiscVVirt (non-DBCN case, backed by UART) - TinyEMU + RiscVVirt (non-DBCN case, HTIF) - TinyEMU + RiscVVirt (DBCN case, HTIF) Cc: Daniel Schaefer <git@danielschaefer.me> Cc: Sunil V L <sunilvl@ventanamicro.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Andrei Warkentin <andrei.warkentin@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
42 lines
782 B
C
42 lines
782 B
C
/** @file
|
|
Serial Port Library backed by SBI console.
|
|
|
|
Common functionality shared by PrePiDxeSerialPortLibRiscVSbi and
|
|
PrePiDxeSerialPortLibRiscVSbiRam implementations.
|
|
|
|
Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
#ifndef SERIAL_PORT_SBI_COMMON_H_
|
|
#define SERIAL_PORT_SBI_COMMON_H_
|
|
|
|
#include <Base.h>
|
|
#include <Library/SerialPortLib.h>
|
|
#include <Library/BaseRiscVSbiLib.h>
|
|
|
|
BOOLEAN
|
|
SbiImplementsDbcn (
|
|
VOID
|
|
);
|
|
|
|
BOOLEAN
|
|
SbiImplementsLegacyPutchar (
|
|
VOID
|
|
);
|
|
|
|
UINTN
|
|
SbiLegacyPutchar (
|
|
IN UINT8 *Buffer,
|
|
IN UINTN NumberOfBytes
|
|
);
|
|
|
|
UINTN
|
|
SbiDbcnWrite (
|
|
IN UINT8 *Buffer,
|
|
IN UINTN NumberOfBytes
|
|
);
|
|
|
|
#endif /* SERIAL_PORT_SBI_COMMON_H_ */
|