1 | /** @file
|
---|
2 | Declarations and macros for the console abstraction.
|
---|
3 |
|
---|
4 | Copyright (c) 2010 - 2011, 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 | typedef struct {
|
---|
22 | UINT32 Column;
|
---|
23 | UINT32 Row;
|
---|
24 | } CursorXY;
|
---|
25 |
|
---|
26 | typedef union {
|
---|
27 | UINT64 Offset;
|
---|
28 | CursorXY XYpos;
|
---|
29 | } XYoffset;
|
---|
30 |
|
---|
31 | /* The members Cookie through Abstraction, inclusive, are the same type and order
|
---|
32 | for all instance structures.
|
---|
33 |
|
---|
34 | All instance structures must be a multiple of sizeof(UINTN) bytes long
|
---|
35 | */
|
---|
36 | typedef struct {
|
---|
37 | UINT32 Cookie; ///< Special value identifying this as a valid ConInstance
|
---|
38 | UINT32 InstanceNum; ///< Which instance is this? Zero-based.
|
---|
39 | EFI_HANDLE Dev; ///< Pointer to either Input or Output Protocol.
|
---|
40 | DeviceNode *Parent; ///< Points to the parent Device Node.
|
---|
41 | struct fileops Abstraction; ///< Pointers to functions implementing this device's abstraction.
|
---|
42 | UINTN Reserved_1; // Ensure that next member starts on an 8-byte boundary
|
---|
43 | UINT64 NumRead; ///< Number of characters Read.
|
---|
44 | UINT64 NumWritten; ///< Number of characters Written.
|
---|
45 | EFI_INPUT_KEY UnGetKey; ///< One-key pushback, for poll().
|
---|
46 | UINT32 Reserved_2; // Force the struct to be a multiple of 8-bytes long
|
---|
47 | } ConInstance;
|
---|
48 |
|
---|
49 | __BEGIN_DECLS
|
---|
50 |
|
---|
51 | int
|
---|
52 | EFIAPI
|
---|
53 | da_ConOpen(
|
---|
54 | IN DeviceNode *DevNode,
|
---|
55 | IN struct __filedes *filp,
|
---|
56 | IN int DevInstance,
|
---|
57 | IN CHAR16 *Path,
|
---|
58 | IN CHAR16 *MPath
|
---|
59 | );
|
---|
60 |
|
---|
61 | __END_DECLS
|
---|
62 |
|
---|
63 | #endif /* _DEVICE_UEFI_CONSOLE_H */
|
---|