You've already forked slimbootloader
mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-03-06 15:26:20 -08:00
bd1ea24cc1
Current implementation assumes serial port is the only input console device supported. But other input console devices can be added later on. This patch added a ConsoleInLib to abstract the input console interfaces. It also added PCDs to control enabled input console devices. Signed-off-by: Maurice Ma <maurice.ma@intel.com>
56 lines
1.5 KiB
C
56 lines
1.5 KiB
C
/** @file
|
|
Header file for console input library
|
|
|
|
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
|
|
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.
|
|
|
|
**/
|
|
|
|
#ifndef __CONSOLE_IN_H__
|
|
#define __CONSOLE_IN_H__
|
|
|
|
typedef enum {
|
|
ConsoleInSerialPort = BIT0,
|
|
ConsoleInUsbKeyboard = BIT1,
|
|
ConsoleInAll = 0xFFFFFFFF,
|
|
} CONSOLE_IN_DEVICE_TYPE;
|
|
|
|
|
|
/**
|
|
Poll a console to see if there is any data waiting to be read.
|
|
|
|
@retval FALSE There is no data waiting to be read from the console.
|
|
@retval TRUE Data is waiting to be read from the console.
|
|
|
|
**/
|
|
BOOLEAN
|
|
EFIAPI
|
|
ConsolePoll (
|
|
VOID
|
|
);
|
|
|
|
/**
|
|
Read data from a console device into a buffer.
|
|
|
|
@param Buffer Pointer to the data buffer to store the data read from the console device.
|
|
@param NumberOfBytes Number of bytes to read from the console device.
|
|
|
|
@retval 0 NumberOfBytes is 0.
|
|
@retval >0 The number of bytes read from the console device.
|
|
If this value is less than NumberOfBytes, then the read operation failed.
|
|
**/
|
|
UINTN
|
|
EFIAPI
|
|
ConsoleRead (
|
|
OUT UINT8 *Buffer,
|
|
IN UINTN NumberOfBytes
|
|
);
|
|
|
|
#endif
|