17#define CBMC_CURSOR_MASK ((1 << 28) - 1)
18#define CBMC_OVERFLOW (1 << 31)
58 CbMemRef =
FindCbTag (CB_TAG_CBMEM_CONSOLE);
59 if (CbMemRef ==
NULL) {
63 mCbConsole = (VOID *)(
UINTN)CbMemRef->cbmem_addr;
64 if (mCbConsole ==
NULL) {
98 if ((Buffer ==
NULL) || (NumberOfBytes == 0)) {
102 if (mCbConsole ==
NULL) {
106 Cursor = mCbConsole->cursor & CBMC_CURSOR_MASK;
107 Flags = mCbConsole->cursor & ~CBMC_CURSOR_MASK;
108 if (Cursor >= mCbConsole->size) {
114 if (Cursor + NumberOfBytes > mCbConsole->size) {
117 Flags |= CBMC_OVERFLOW;
120 if (NumberOfBytes > mCbConsole->size) {
123 NumberOfBytes = mCbConsole->size;
126 CopyMem (&mCbConsole->body[Cursor], Buffer, NumberOfBytes);
127 Cursor += NumberOfBytes;
129 if (Cursor == mCbConsole->size) {
133 Flags |= CBMC_OVERFLOW;
136 mCbConsole->cursor = Flags | Cursor;
138 return NumberOfBytes;
256 IN OUT UINT64 *BaudRate,
257 IN OUT UINT32 *ReceiveFifoDepth,
258 IN OUT UINT32 *Timeout,
260 IN OUT UINT8 *DataBits,
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID * FindCbTag(IN UINT32 Tag)
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)
#define RETURN_DEVICE_ERROR
#define RETURN_UNSUPPORTED