17#include <IndustryStandard/Xen/io/console.h>
18#include <IndustryStandard/Xen/hvm/params.h>
19#include <IndustryStandard/Xen/event_channel.h>
25#define ASSERT(Expression) \
27 if (!(Expression)) { \
63 if (!mXenConsoleInterface) {
100 XENCONS_RING_IDX Consumer, Producer;
103 ASSERT (Buffer !=
NULL);
105 if (NumberOfBytes == 0) {
109 if (!mXenConsoleInterface) {
115 Consumer = mXenConsoleInterface->out_cons;
116 Producer = mXenConsoleInterface->out_prod;
120 while (Sent < NumberOfBytes && ((Producer - Consumer) <
sizeof (mXenConsoleInterface->out))) {
121 mXenConsoleInterface->out[MASK_XENCONS_IDX (Producer++, mXenConsoleInterface->out)] = Buffer[Sent++];
126 mXenConsoleInterface->out_prod = Producer;
129 }
while (Sent < NumberOfBytes);
156 XENCONS_RING_IDX Consumer, Producer;
159 ASSERT (Buffer !=
NULL);
161 if (NumberOfBytes == 0) {
165 if (!mXenConsoleInterface) {
169 Consumer = mXenConsoleInterface->in_cons;
170 Producer = mXenConsoleInterface->in_prod;
175 while (Received < NumberOfBytes && Consumer < Producer) {
176 Buffer[Received++] = mXenConsoleInterface->in[MASK_XENCONS_IDX (Consumer++, mXenConsoleInterface->in)];
181 mXenConsoleInterface->in_cons = Consumer;
201 return mXenConsoleInterface &&
202 mXenConsoleInterface->in_cons != mXenConsoleInterface->in_prod;
240 if (!mXenConsoleInterface) {
246 *Control = EFI_SERIAL_INPUT_BUFFER_EMPTY;
288 IN OUT UINT64 *BaudRate,
289 IN OUT UINT32 *ReceiveFifoDepth,
290 IN OUT UINT32 *Timeout,
292 IN OUT UINT8 *DataBits,
VOID EFIAPI MemoryFence(VOID)
#define RETURN_DEVICE_ERROR
#define RETURN_UNSUPPORTED
BOOLEAN EFIAPI SerialPortPoll(VOID)
RETURN_STATUS EFIAPI SerialPortSetAttributes(IN OUT UINT64 *BaudRate, IN OUT UINT32 *ReceiveFifoDepth, IN OUT UINT32 *Timeout, IN OUT EFI_PARITY_TYPE *Parity, IN OUT UINT8 *DataBits, IN OUT EFI_STOP_BITS_TYPE *StopBits)
UINTN EFIAPI SerialPortRead(OUT UINT8 *Buffer, IN UINTN NumberOfBytes)
RETURN_STATUS EFIAPI SerialPortInitialize(VOID)
RETURN_STATUS EFIAPI SerialPortSetControl(IN UINT32 Control)
RETURN_STATUS EFIAPI SerialPortGetControl(OUT UINT32 *Control)
UINTN EFIAPI SerialPortWrite(IN UINT8 *Buffer, IN UINTN NumberOfBytes)
INTN EFIAPI XenHypercallEventChannelOp(IN INTN Operation, IN OUT VOID *Arguments)
BOOLEAN EFIAPI XenHypercallIsAvailable(VOID)
UINT64 EFIAPI XenHypercallHvmGetParam(UINT32 Index)