1 /** @file
2   Declarations and macros for the console abstraction.
3 
4   Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
5   This program and the accompanying materials are licensed and made available
6   under the terms and conditions of the BSD License which accompanies this
7   distribution.  The full text of the license may be found at
8   http://opensource.org/licenses/bsd-license.php.
9 
10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13   Depends on <kfile.h>, <Device/Device.h>, <Protocol/SimpleTextIn.h>, <Uefi/UefiBaseType.h>
14 **/
15 #ifndef _DEVICE_UEFI_CONSOLE_H
16 #define _DEVICE_UEFI_CONSOLE_H
17 
18 #include  <kfile.h>
19 #include  <Device/Device.h>
20 
21 /*  The members Cookie through Abstraction, inclusive, are the same type and order
22     for all instance structures.
23 
24     All instance structures must be a multiple of sizeof(UINTN) bytes long
25 */
26 typedef struct {
27   UINT32                      Cookie;       ///< Special value identifying this as a valid ConInstance
28   UINT32                      InstanceNum;  ///< Which instance is this?  Zero-based.
29   EFI_HANDLE                  Dev;          ///< Pointer to either Input or Output Protocol.
30   DeviceNode                 *Parent;       ///< Points to the parent Device Node.
31   struct fileops              Abstraction;  ///< Pointers to functions implementing this device's abstraction.
32   UINTN                       Reserved_1;   // Ensure that next member starts on an 8-byte boundary
33   UINT64                      NumRead;      ///< Number of characters Read.
34   UINT64                      NumWritten;   ///< Number of characters Written.
35   __mbstate_t                 CharState;    ///< Character state for the byte stream passing through this device
36   CHAR16                      UnGetKey;     ///< One-key pushback, for poll().
37 } ConInstance;
38 
39 __BEGIN_DECLS
40 
41 int
42 EFIAPI
43 da_ConOpen(
44   IN  DeviceNode         *DevNode,
45   IN  struct __filedes   *filp,
46   IN  int                 DevInstance,
47   IN  CHAR16             *Path,
48   IN  CHAR16             *MPath
49 );
50 
51 __END_DECLS
52 
53 #endif  /* _DEVICE_UEFI_CONSOLE_H */
54